LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How can I set the default audio device? (http://www.linuxquestions.org/questions/slackware-14/how-can-i-set-the-default-audio-device-713793/)

Hangdog42 03-23-2009 09:03 AM

How can I set the default audio device?
 
I recently built myself a computer and I'm running Slackware -current on it. My slight dilemma is that it has three audio devices and for the life of me, I can't figure out how to set one as the standard default.

The devices are:

1) Intel 82801JI (ICH10) which uses the snd_hda_intel module
2) ATI HD48x0 audio (which I'm not using at the moment)
3) Logitech USB headset


I want the Intel to be the default audio, however if I boot with the USB headset plugged in, it is always grabs the default, and the Intel audio is secondary. Since I don't always have the headset plugged in (and I want the Intel to be the default regardless), this causes a problem.

I tried running the following in my /etc/modprobe.d/sound file, but if the options line is there, the Intel chip simply isn't found (the exact error is "hda-intel: error creating card").

Code:

alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd-hda-intel index=0


From the googling I've done, I thought this would be the answer, but obviously not so, so any suggestions would be very welcomed.

kilgoretrout 03-23-2009 12:28 PM

You can try blacklisting the modules used by the Logitech USB headset by editing the /etc/modprobe.d/blacklist file.

Hangdog42 03-23-2009 12:38 PM

Sorry, I probably should have been clearer. I need to use both the Intel soundcard and the USB headset, so disabling the headset isn't what I'm after.

DavidHindman 03-23-2009 01:32 PM

I wonder if you're getting the error "hda-intel: error creating card" because by the time the hda-intel device is recognized, some other audio device has already been assigned to index slot 0. What happens if you create alias and options lines for your other audio devices as well, with index=1 and index=2 for the other devices?

Hangdog42 03-23-2009 03:42 PM

Quote:

Originally Posted by DavidHindman (Post 3485256)
I wonder if you're getting the error "hda-intel: error creating card" because by the time the hda-intel device is recognized, some other audio device has already been assigned to index slot 0. What happens if you create alias and options lines for your other audio devices as well, with index=1 and index=2 for the other devices?

THANK YOU! That definitely did the trick. Just for posterity, my /etc/modprobe.d/sound looks like this:

Code:

alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd-hda-intel index=0
alias snd-card-1 snd-usb-audio
alias sound-slot-1 snd-usb-audio
options snd-usb-audio index=1


Daedra 03-23-2009 03:48 PM

I've also used this method before and it works
http://princ3.wordpress.com/2006/10/...d-under-linux/

Ignore this method, use the above

DavidHindman 03-23-2009 04:16 PM

Quote:

Originally Posted by Daedra (Post 3485386)
I've also used this method before and it works
http://princ3.wordpress.com/2006/10/...d-under-linux/

I'd like to add a caution about using the method described in that article. That's the method that uses ~/.asoundrc or /etc/asound.conf to establish the default alsa audio device. It works for most sound applications, but not all. Specifically, it doesn't always work with Adobe Flash video players versions 9 and above. The symptom that's usually reported is that Youtube has video but has no sound.

I haven't found a workaround for the incompatibility of Flash versions 9+ with default audio devices defined in ~/.asoundrc and /etc/asound.conf.

Hangdog42 03-24-2009 07:30 AM

I was making the assumption that the .asoundrc approach was pretty much rendered obsolete by HAL. I never found a definitive article, but that seemed to be the gist of what I was reading.


All times are GMT -5. The time now is 03:13 PM.