problem recording from USB microphone

10 posts
by karl101 » Sun Sep 23, 2012 9:00 am
I have bought this cheap USB sound card to give my Pi a microphone input, it appears as expected in the list of USB devices:
Code: Select all
$ lsusb
Bus 001 Device 028: ID 0d8c:000e C-Media Electronics, Inc. Audio Adapter (Planet UP-100, Genius G-Talk)

the microphone appears in the alsamixer as device 1: Card: Generic USB Audio Device, and I have increased the gain to just before it goes red. I have pugged a microphone into the mic socket and it appears on the list of capture devices in arecord:
Code: Select all
$  arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Device [Generic USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

however, when I try to record something, I get errors:
Code: Select all
arecord -f S16_LE -d 20 -r 44100 -D hw:1,0 test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
arecord: set_params:1145: Unable to install hw params:
RATE: 44100
PERIOD_TIME: (125011 125012)
PERIODS: (3 4)

trying other methods from searching google also produces errors:
Code: Select all
$ arecord --duration=30 -vvvv -f S16_LE --file-type wav beggin.wav
arecord: main:682: audio open error: No such file or directory

Any ideas? thanks
Posts: 61
Joined: Wed Jan 11, 2012 10:09 am
by mrraspberrypi » Mon Oct 08, 2012 8:57 pm
im having similar issues with just crackled noise. im trying to get mine to encode to mp3 and stream to shoutcast server/icecast.

testing the soundcard initially by piping the recording to the playback (all from the same usb audio device) like this:

Code: Select all
$ arecord -D hw:1,0 -f S16_LE -c 1 -r 44100 | aplay -D plughw:CARD=1,DEV=0
Posts: 10
Joined: Tue Sep 25, 2012 2:37 am
by gazzwi86 » Thu Nov 22, 2012 11:05 am
Did you find any solution to the quality issue? I'm using a similar setup and the audio is really quiet and the crackling is really bad
Posts: 16
Joined: Thu Oct 04, 2012 4:02 pm
by pykoszk » Mon Dec 31, 2012 9:18 pm

I have met the same recording quality problem with USB microphone.

Sound is terrible - did You find a solution ???

Posts: 1
Joined: Mon Dec 31, 2012 9:11 pm
by observing » Wed Jan 09, 2013 1:08 pm
My experience with C-Media chipsets is that they don't support every combination of formats and sampling rates. If you are still having audio quality programs, I would suggest that you try a sampling rate of 48000 and the default format (U8). This combination has worked for me in the past.
Posts: 39
Joined: Mon Feb 27, 2012 12:18 pm
by mindracer » Tue Mar 05, 2013 8:01 pm
IM having problems with crackling too! I thought it was streaming with ffmpeg the problem,
but i used arecord and aplay and it crackles direct in .wav too

Im using a Daffodil USB soundcard. Anyone have any luck??
Posts: 8
Joined: Sat Mar 02, 2013 12:43 am
by GTBecker » Thu Mar 07, 2013 9:24 pm
I am using a CMedia 6206-based sound module (a Sabrent USB SND8) to capture audio successfully to stream [from a VLF receiver (lightning, spherics) at] - but if I add a USB hub, it becomes unusable.

Are you using a hub?

Posts: 3
Joined: Thu Mar 07, 2013 9:16 pm
by mindracer » Fri Mar 08, 2013 7:23 pm
I found a fix, apparently theres an issue with USB2 and our raspberry pi's that's well known and also being discussed in another thread, you have to add an argument in /boot/cmdline.txt to bring it to USB1 for the pack loss not to occur. But at the same time, if u put it to USB1, your usb keyboard stops working so you have to ssh into your raspberry
Posts: 8
Joined: Sat Mar 02, 2013 12:43 am
by DerSaidin » Sat Mar 09, 2013 3:04 am
I was having problems with a CMedia device:
When I tried to record the resulting file was completely silent.

I tried setting the USB to USB1 speed, didn't help.

I worked out that the microphone was muted (not the physical volume dial on it).
Code: Select all
ders@raspberrypi:~$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Front Left: Playback 26251 [40%] [on]
  Front Right: Playback 26251 [40%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined penum
  Capture channels: Mono
  Limits: Capture 0 - 65536
  Mono: Capture 50309 [77%] [off]

Note that last [off].

Code: Select all
ders@raspberrypi:~$ amixer set Capture 100% cap
Simple mixer control 'Capture',0
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined penum
  Capture channels: Mono
  Limits: Capture 0 - 65536
  Mono: Capture 65536 [100%] [on]

Then I was able to record with the command mentioned elsewhere in this thread:
ders@raspberrypi:~$ arecord -D plughw:1,0 -r 48000 test.wav
Posts: 1
Joined: Sat Mar 09, 2013 2:49 am
Location: Australia
by mindracer » Mon Mar 11, 2013 1:19 pm
try arecord -D hw:0,0
arecord -D hw:1,0
Posts: 8
Joined: Sat Mar 02, 2013 12:43 am