How do I configure X to use an alternate audio device?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I configure X to use an alternate audio device?
The jack built into my computer stopped working. I now use a usb-audio converter. I changed asound.conf to use it but the X apps that I have tried still send sound to the built-in speakers. I assume I need a new OutputDevice section in xorg.conf, but I can't find a model for how to write it.
Avoid using custom asound.conf if possible (especially if using Pulseaudio). The easiest way is to disable your onboard audio device in the BIOS if it allows such an option.
Another way is to add a line like this in /etc/modprobe.d/alsa-base.conf:
Code:
options snd-hda-intel enable=0 #use enable=0,0 if you also need to disable HDMI audio
Also, make sure you don't have a line in alsa-base.conf that prevents USB audio devices from getting index 0.
I misdiagnosed. Outside of X I used mplayer, which I configured to use the usb device; the X clients use the default alsa device, which was the builtin. It seems that alsa always makes device 0 the default device, that one cannot configure it otherwise. Thus, preventing the builtin device's modules from loading makes the usb device the default.
Curiously Firefox still makes no noise (xine does), which would seem to make this a Firefox problem.
You probably need the gstreamer-plugin stuff and other things for firefox to work. I believe in my case it works with alsa natively, but not with pulseaudio. Various configuration tricks to make it work with pulseaudio, but not the default in debian iirc.
Yes, device 0 is the default device. But you CAN re-order your driver modules to make any audio device have the index of 0. Although a tad old school to accomplish that and might be quirky if you have multiple sound devices of the same type using the same driver. Basically alsa.conf stuff in /etc/modprobe.d/ to make that happen.
Most times I can get away with NOT using pulseaudio and changing the .asoundrc to say which device index to use.
$ echo "defaults.pcm.card 1" > .asoundrc
Literally as simple as that, unless your distro installed and configured your audio system by default. And pulseaudio by default. Also note that if you do not setup forced indexing, that soundcards can get a different index between reboots. If you have more than one. And most do since your video card, webcam, and everything has a soundcard now. If it's just output or just input, it's still a soundcard.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.