How to enable USB Sound on a Raspberry Pi

When I converted my Raspberry Pi into an AirPi the sound from the 3,5mm onboard sound jack wasn’t great. So I decided to add a USB soundcard to my Raspberry Pi. This post describes what I did to get it to work.

I bought a cheap USB Sound Card from Ebay, the Logilink UA0053.

First you have to redirect the sound from the HDMI to the 3,5mm onboard sound jack with the following command:

amixer cset numid=3 1

Secondly make sure that the sound is properly configured

sudo nano /etc/modprobe.d/alsa-base.conf

#———————————————-

# the content of the file should look like this

# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe –ignore-install snd && { /sbin/modprobe –quiet snd-ioctl32 ; /sbin/m$
install snd-rawmidi /sbin/modprobe –ignore-install snd-rawmidi && { /sbin/modprobe –quiet snd-s$
install snd-emu10k1 /sbin/modprobe –ignore-install snd-emu10k1 && { /sbin/modprobe –quiet snd-e$
# Keep snd-pcsp from beeing loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2

#———————————————-

ctrl – x and Y to save

The last thing you have to do is to redirect the sound to the USB port.

sudo nano /etc/asound.conf

#———————————————-

# you have to make the content of the file look like this

pcm.!default {
type hw
card 1
device 0
}

#———————————————-

ctrl – x and Y to save
sudo reboot

Advertisements

3 thoughts on “How to enable USB Sound on a Raspberry Pi

  1. Pingback: Turning your Raspberry Pi into an AirPi with iOS6 support | raspberrypi4dummies

  2. Thomas

    Hi,

    thanks for sharing. I have the UA0053, I followed the instructions above and it worked for me in a sense that:

    aplay -D plug:hw:1 /usr/share/sounds/alsa/Front_Center.wav

    played the sound (with a bit of background noise though). However I completely failed to get anything recorded via arecord. Have you tried to record something via a mic attached to the UA0053?

    Any ideas highly welcomed.

    Thanks.
    Thomas

    Reply
    1. racer993 Post author

      Hi Thomas,

      I’haven’t tried recording. When I find the time I’ll have a look into it. If you find the solution, please keep me updated!

      Thx

      Regards,
      Racer

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s