kaherdin
Posts: 5
Joined: Sat Feb 16, 2013 11:54 am

How do I select my USB Sound Card for output?

Sat Mar 02, 2013 2:47 pm

I have googled it, yes, and I've read these forums yes, and because I want to learn (acctually yes!) I am now asking;

I have a USB Sound Card plugged into my Raspbian setup. I have configured ALSA once before to maximise the volume output. The setup is right now beening used as a music render using gmrender-resurrect.
I want to select my USB Sound Card to be the output source of the sound to get rid of some clicks and popping noices when playing music.
- How do I select my usb sound card?

I can see it as "card 1" when doing lsusb and aplay -l and such but there are no step by step hints for me here to utilize to make this work for me.

Anyone care to help me out?

User avatar
malakai
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: How do I select my USB Sound Card for output?

Sat Mar 02, 2013 3:14 pm

http://lifehacker.com/5978594/turn-a-ra ... iving-room has a lot of good stuff about USB Sound and I think

Code: Select all

amixer cset numid=3
will output to USB.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

kaherdin
Posts: 5
Joined: Sat Feb 16, 2013 11:54 am

Re: How do I select my USB Sound Card for output?

Sat Mar 02, 2013 5:23 pm

This happend today for me

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

Code: Select all

options snd-usb-audio index=0
so that my hw:0,0 ist the USB soundcard

then
sudo nano /etc/asound.conf to;

Code: Select all

pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw
        card 0
}
then sudo reboot

then I actually pulled the usb sound card while the RPI was on, and then I, reinserted it
sudo reboot again

and guess what, It now works. I know. Silly but hey, it floats my boat.

dlgfm
Posts: 3
Joined: Mon Mar 04, 2013 6:21 pm

Re: How do I select my USB Sound Card for output?

Mon Mar 04, 2013 6:33 pm

Hello,

I am trying to get the USB audio working.
But I it does not work. When I do all this settings I only see the following output:

pi@raspberrypi ~ $ aplay police_s.wav
Wiedergabe: WAVE 'police_s.wav' : Unsigned 8 bit, Rate: 22000 Hz, mono
aplay: set_params:1081: Sample-Format nicht unterstützt
Available formats:
- S16_LE

But no sound is played.

Markus

kaherdin
Posts: 5
Joined: Sat Feb 16, 2013 11:54 am

Re: How do I select my USB Sound Card for output?

Mon Mar 04, 2013 6:58 pm

dlgfm wrote:Hello,

I am trying to get the USB audio working.
But I it does not work. When I do all this settings I only see the following output:

pi@raspberrypi ~ $ aplay police_s.wav
Wiedergabe: WAVE 'police_s.wav' : Unsigned 8 bit, Rate: 22000 Hz, mono
aplay: set_params:1081: Sample-Format nicht unterstützt
Available formats:
- S16_LE

But no sound is played.

Markus
You tried lsusb? What does it say?

Cloudcentric
Posts: 982
Joined: Fri Sep 14, 2012 9:13 am

Re: How do I select my USB Sound Card for output?

Mon Mar 04, 2013 9:36 pm

dlgfm wrote:Hello,

I am trying to get the USB audio working.
But I it does not work. When I do all this settings I only see the following output:

pi@raspberrypi ~ $ aplay police_s.wav
Wiedergabe: WAVE 'police_s.wav' : Unsigned 8 bit, Rate: 22000 Hz, mono
aplay: set_params:1081: Sample-Format nicht unterstützt
Available formats:
- S16_LE

But no sound is played.

Markus
Yes but have you Raspbian "wheezy" installed ?? if so, is it fully updated/upgraded ?? Then I found a tutorial which is undertaken from the command line:

If the Sound quality is not adequate then using a USB Sound Card or USB PCM2704 Sound Board is an alternative, on the command line type the following, then press the enter key, the last entry will launch the Leafpad text editor, where the 7th line up needs to have a # placed in front of the writing:

sudo modprobe snd_bcm2835
sudo amixer cset numid=3 0

leafpad /etc/modprobe.d/alsa-base.conf

In Leafpad the line 7 up from bottom reads: options sound-usb-audio index=-2 place a # before options

sudo reboot

http://debianarmpi.blogspot.co.uk
http://www.jackenhack.com/raspberry-pi- ... y-problems
I know everything about nothing"

diomoidapple
Posts: 2
Joined: Sat Apr 18, 2015 4:05 pm

Re: How do I select my USB Sound Card for output?

Tue May 05, 2015 9:39 pm

This tutorial was great and helped me to set my USB sound card as the default device. I even learned a few things too!

http://computers.tutsplus.com/articles/ ... -mac-55876

jwatte
Posts: 186
Joined: Sat Aug 13, 2011 7:28 pm

Re: How do I select my USB Sound Card for output?

Tue Aug 08, 2017 7:05 pm

This is the reference Google shows when googling for Raspberry Pi USB audio.
Unfortunately, on a recent Raspbian, there is no modprobe.d/alsa-base.conf, and no /etc/asound.conf
Presumably, the ever-changing Linux sound infrastructure has moved on to something else, but what is it now?

jwatte
Posts: 186
Joined: Sat Aug 13, 2011 7:28 pm

Re: How do I select my USB Sound Card for output?

Thu Aug 10, 2017 11:43 pm

The ALSA parameters have moved into other places (such as /usr/share/alsa)
However, the reason the Teensy doesn't by default succeed in loading, is that the snd_usb_audio module wants "index 0" that's already taken by the BCM audio.

The fix is to create a new file in modprobe.d (I call mine /etc/modprobe.d/snd_usb_audio.conf) and add the necessary config in there:

Code: Select all

options snd_usb_audio index=1
Btw: What's with all the configs moving into /usr/share? That used to be a place to put, like, data files and documentation.
Configs should live in /etc! With configs in /usr/share, mounting /usr as read-only isn't really going to be possible anymore.
(and a bunch of the original separation of /bin and /usr/bin has also changed, with things merging into /usr/bin and forwarding symlinks.)
This is not progress; this is regress!

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 20 guests