Friday, January 18, 2013

Raspberry Pi and Usb Sound Card

I Have Usb Sound Card that uses cmedia chipset and im uses wheezy raspbian image, its not work properly, then im switch to Arch linux and my usb sound card work flawlessly :)

here s step :

Plug your usb sound card to raspberry pi then ,  check USB Sound card recognized by linux


[ 1893.885590] usb 1-1.2: new full-speed USB device number 5 using dwc_otg
[ 1893.987344] usb 1-1.2: New USB device found, idVendor=0d8c, idProduct=000c
[ 1893.987380] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 1893.987398] usb 1-1.2: Product: C-Media USB Headphone Set
[ 1894.029804] input: C-Media USB Headphone Set   as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.3/input/input1
[ 1894.030729] hid-generic 0003:0D8C:000C.0001: input,hidraw0: USB HID v1.00 Device [C-Media USB Headphone Set  ] on usb-bcm2708_usb-1.2/input3



Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. LAN9500 Ethernet 10/100 Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 001 Device 004: ID 05a9:4519 OmniVision Technologies, Inc. Webcam Classic

then install alsa-utils alsa-firmware alsa-plugins
pacman -S alsa-utils alsa-firmware alsa-plugins

after install, then reboot raspberry pi


wait until system is up

then check the snd_usb_audio loaded by linux


Module                  Size  Used by
ipv6                  297427  10
spidev                  5232  0
leds_gpio               2275  0
led_class               3586  1 leds_gpio
spi_bcm2708             4522  0
i2c_bcm2708             3759  0
snd_usb_audio         104017  0
snd_usbmidi_lib        18131  1 snd_usb_audio
snd_hwdep               5941  1 snd_usb_audio
snd_rawmidi            21144  1 snd_usbmidi_lib
gspca_ov519            32216  0
snd_seq_device          6466  1 snd_rawmidi
snd_pcm                77452  1 snd_usb_audio
gspca_main             20149  1 gspca_ov519
videodev              105941  2 gspca_main,gspca_ov519
snd_page_alloc          5177  1 snd_pcm
evdev                   9370  0
media                  13412  1 videodev
snd_timer              19790  1 snd_pcm
snd                    58415  7 snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_rawmidi,snd_usbmidi_lib,snd_seq_device


Its ok now , usb sound card ready to use, run alsamixer


set the speaker volume , mic and make sure that speaker not muted, test configuration using


speaker-test 1.0.26

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 16384
Period size range from 1024 to 1024
Using max buffer size 16384
Periods = 4
was set period_size = 1024
was set buffer_size = 16384
 0 - Front Left
Time per period = 2.654825
 0 - Front Left

it will make  pink noise sound at your speaker

test recording your voice , plug headset at usb sound card

 arecord -d 10 test.wav

then playback again

 aplay test.wav

you will hear your recorded sound, sucess

have nice try, good luck


  1. I can manage the output in wheezy raspbian
    modify the pcm.!default in etc/asound.conf

    pcm.!default {
    type hw
    card 0
    device 0

    but I can't record with arecord

    Would you please cat the /etc/asound.conf from Arch

  2. You can create the asound.conf file at etc/ if it isn't there.
    This will cover all users.
    Alternatively you can create an .aroundrc file with the same detail in the users home directory if you only want to make the changes for one user.

    I did the abovoe and it forces' the USB to be the device used so if the USB Audio is not plugged in I get an error. The onboard Broadcom Audio is there and can be seen with alsamixer -d 0 but it's not set to be used.
    Still working to find a graceful solution to this.