Page 1 of 1

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

Posted: Thu Apr 04, 2013 5:30 pm
by georgekok97
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?

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Tue Apr 09, 2013 3:53 pm
by -rst-
You might want to try another application (maybe arecord) to see if the system is setup ok.

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Tue Apr 09, 2013 4:17 pm
by georgekok97
I have tried arecord and it doesn't work... Any other suggestion?

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Tue Apr 09, 2013 4:23 pm
by shuckle
Do you see anything with dmesg or lsusb?
Does linux regocnize the microphoneat all?
What linux version do you use? uname -a

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Tue Apr 09, 2013 4:32 pm
by georgekok97
It recognizes the Microphone.

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

I use the latest Raspbian version.

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Wed Apr 10, 2013 9:56 pm
by FTrevorGowen
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.

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Thu Apr 11, 2013 7:14 pm
by georgekok97
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!

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Wed May 08, 2013 6:51 pm
by tejonbiker
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.

Re: Raspberry Pi Won't Record from USB Microphone

Posted: Thu May 09, 2013 10:57 am
by georgekok97
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!

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

Posted: Wed Apr 11, 2018 4:41 pm
by uj7
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

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

Posted: Thu Apr 12, 2018 3:29 pm
by FTrevorGowen
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.

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

Posted: Thu Apr 12, 2018 3:54 pm
by mahjongg
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.

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

Posted: Fri Jun 22, 2018 10:43 pm
by JustaLiriK
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?

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

Posted: Thu Dec 06, 2018 9:18 am
by shishirbitm
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.

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

Posted: Tue Dec 18, 2018 4:24 pm
by viveksanagari

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.

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

Posted: Wed Dec 26, 2018 2:55 pm
by rpiuser2016