I bought an USB sound card. I'd like to set up my Linux desktop so that it prefers the USB device, if it is plugged in and automatically switches as the device is (un)plugged. Is it possible, and how?
find your card with
and then create /etc/asound.conf with following:
replace ("card 1" with number of your card determined above)
Alternatively, you can change ordering of your cards so your USB card will be card 0 and it will work without editing asound.conf
this is the method for selecting default sound card in Alsa. You may want to install Alsa for this method to work if you are using Pulse Audio.
will list your sound modules .The output of the command will be like this (eg):
you can pretty easily understand which one is your usb sound card from above.
edit this alsa-base.conf in such a way that your preferred card has an index =-2 / 0 and the other card has index =-1 / 1 (stick with -2 and -1 )
in this case usb device is preferred device.
if you are having two differnt cards with same name from the output, like this:
issue this cammand and find out which is which
then edit modules in this way:
a reboot may be necessary.so you might have to manually switch over your sound cards.