georgekok97
Posts: 37
Joined: Thu Jul 26, 2012 11:11 am

Raspberry Pi Won't Record from USB Microphone (solved)

Thu Apr 04, 2013 5:30 pm

I have a Plug-and-Play USB Microphone.

I use the following command to record for Voice Recognition:

Code: Select all

sox -r 16000 -t alsa default recording.flac silence 1 0.1 2% 1 1.5 2%
I get this error:

Code: Select all

sox FAIL sox: `default' No such device: Operation not permitted
(tried with "sudo" prefixed but nothing)

I try to use "pulse" and other channels from the Command aplay -L, but I always get an error.

I even tried to change the /etc/asound.conf file to disable the default channel and use other channels, as I read to a post, but didn't work...

I run the alsamixer command and set the USB Microphone but still doesn't record....


Any Suggestions how to fix it?

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Raspberry Pi Won't Record from USB Microphone

Tue Apr 09, 2013 3:53 pm

You might want to try another application (maybe arecord) to see if the system is setup ok.
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

georgekok97
Posts: 37
Joined: Thu Jul 26, 2012 11:11 am

Re: Raspberry Pi Won't Record from USB Microphone

Tue Apr 09, 2013 4:17 pm

I have tried arecord and it doesn't work... Any other suggestion?

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Raspberry Pi Won't Record from USB Microphone

Tue Apr 09, 2013 4:23 pm

Do you see anything with dmesg or lsusb?
Does linux regocnize the microphoneat all?
What linux version do you use? uname -a

georgekok97
Posts: 37
Joined: Thu Jul 26, 2012 11:11 am

Re: Raspberry Pi Won't Record from USB Microphone

Tue Apr 09, 2013 4:32 pm

It recognizes the Microphone.

I tried with aplay -L and lsusb.....

I use the latest Raspbian version.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4902
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Raspberry Pi Won't Record from USB Microphone

Wed Apr 10, 2013 9:56 pm

Hi georgekok97,
FWIW Some time ago I made a few notes on getting a headset working with a "Daffodil USB Sound Adapter" which includes a microphone input. I used "audacity" for the final tests. There may be something there within the "audio setup" process that you've "missed" (IIRC it took me a while to get a "mixer" working and setup volume levels etc.). They can be found within my website at http://www.cpmspectrepi.webspace.virgin ... apter.html .
HTH, Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

georgekok97
Posts: 37
Joined: Thu Jul 26, 2012 11:11 am

Re: Raspberry Pi Won't Record from USB Microphone

Thu Apr 11, 2013 7:14 pm

Thanks I will check it out and Post a new reply later!


EDIT:


I saw the commands you used.

The truth is that at my commands (that I used for recording), I set the Input Audio Device like this (example):

Code: Select all

arecord example.wav -D sysdefault
while you use (and probably correct):

Code: Select all

arecord example.wav -D sysdefault:CARD=Set
I will check again the Channels available when I plug the USB Mic In, and I will try the new command and I will post if my Problem is solved!



Thanks!

tejonbiker
Posts: 30
Joined: Tue Aug 28, 2012 1:36 am

Re: Raspberry Pi Won't Record from USB Microphone

Wed May 08, 2013 6:51 pm

arecord example.wav -D sysdefault:CARD=1 works flawlessly for me, I have a Logitech C170 with Webcam and built in Mic. Thanks for the info.

georgekok97
Posts: 37
Joined: Thu Jul 26, 2012 11:11 am

Re: Raspberry Pi Won't Record from USB Microphone

Thu May 09, 2013 10:57 am

arecord example.wav -D sysdefault:CARD=1 works flawlessly for me, I have a Logitech C170 with Webcam and built in Mic. Thanks for the info.

Works! It Works!

Thanks very very much!

uj7
Posts: 1
Joined: Wed Apr 11, 2018 4:20 pm

Re: Raspberry Pi Won't Record from USB Microphone (solved)

Wed Apr 11, 2018 4:41 pm

When tried "arecord exm.wav -D sysdefault:CARD=1" not working for me..

I got this error
ALSA lib confmisc.c:767:(parse_card) cannot find card '1'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM sysdefault:CARD=1
arecord: main:788: audio open error: No such file or directory

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4902
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Raspberry Pi Won't Record from USB Microphone (solved)

Thu Apr 12, 2018 3:29 pm

uj7 wrote:
Wed Apr 11, 2018 4:41 pm
When tried "arecord exm.wav -D sysdefault:CARD=1" not working for me..
I got this error
ALSA lib confmisc.c:767:(parse_card) cannot find card '1'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM sysdefault:CARD=1
arecord: main:788: audio open error: No such file or directory
Unfortunately my (and probably others) suggestions in this "ancient"** thread are almost certainly "out-of-date" - Raspbian has moved on from Wheezy. through Jessie, and is now Stretch and I was working with either a B1 or B2 Pi back then.
Trev.
** Last post nearly 5 years ago, in 2013.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11722
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Raspberry Pi Won't Record from USB Microphone (solved)

Thu Apr 12, 2018 3:54 pm

That is the problem with necromancing such an old thread, try what you want to do while using a modern (still supported) OS like raspbian Stretch, and if it doesn't work ask a new question here, while giving all the relevant information.

JustaLiriK
Posts: 9
Joined: Thu Jun 05, 2014 1:03 pm
Location: Ardèche France

Re: Raspberry Pi Won't Record from USB Microphone (solved)

Fri Jun 22, 2018 10:43 pm

Re: Raspberry Pi Won't Record from USB Microphone (solved)
Quote mahjongg
by mahjongg » Thu Apr 12, 2018 3:54 pm

That is the problem with necromancing such an old thread, try what you want to do while using a modern (still supported) OS like raspbian Stretch, and if it doesn't work ask a new question here, while giving all the relevant information.
Except for having a post in a thread mentioning the version of the OS, is there any way to get this this information in the title?
Codez comme Da Vincy

shishirbitm
Posts: 2
Joined: Thu Dec 06, 2018 9:15 am

Re: Raspberry Pi Won't Record from USB Microphone (solved)

Thu Dec 06, 2018 9:18 am

Hi, I am not able to record on raspberry pi with following device. Although i can find my device configured below. Kindly help.

Playback works but record doesn’t work. Also I am trying to record programatically through java audio, that also doesn’t work. Recording file has constant slight noise and no recording sound.

Playback works fine but recording doesn’t:
Playback command: Works well
arecord –format=S16_LE –rate=16000 | aplay –format=S16_LE –rate=16000

Recording doesn’t work:
arecord –format=S16_LE –rate=16000 test.wav

Below are the device listing:
=================
aplay -l
=================
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: BT300M [Plantronics BT300M], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
======================
pi@raspberrypi:~ $ arecord -l
======================
**** List of CAPTURE Hardware Devices ****
card 1: BT300M [Plantronics BT300M], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
==================
lsusb
==================
Bus 001 Device 004: ID 047f:0416 Plantronics, Inc.
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

alsamixer is also fine, I can see both capture and playback is correctly configured.

viveksanagari
Posts: 9
Joined: Tue Dec 18, 2018 4:11 pm

Re: Raspberry Pi Won't Record from USB Microphone (solved)

Tue Dec 18, 2018 4:24 pm

Code: Select all

 arecord --device=hw:1,0 --format S16_LE --duration=10 --rate 44100 -c1 test.wav 

From https://learn.adafruit.com/usb-audio-ca ... ding-audio link this code worked for me to record audio.

Code: Select all

 --device=hw:1,0 
from the above command says to capture the audio from that particular capture device. From https://trac.ffmpeg.org/wiki/Capture/ALSA link hw:<X>,<Y>, where <X>=card, <Y>=device.
The card and device number of your desired capture device can be seen by typing

Code: Select all

 arecord -l 
in the terminal.


Return to “General programming discussion”