I have a built in a soundcard VIA 8237 and a USB Audiobox.
I have found a method for switching playback from one card to another. Unfortunately it doesn't work on the fly, the audio app must be restarted for it to take effect (tested with Slacko 5.3.1 using Firefox and aplay).
It involves writing to /etc/asound.conf
NOTE assumes /etc/asound.conf contains only two lines, something like:
defaults.pcm.card 0
defaults.pcm.device 0
Please back up /etc/asound.conf before using code and or tinkering.
for switching soundcard 0, device 0 the bash code using sed-
Code: Select all
#switch to soundcard 0, device 0
asoundconf=/etc/asound.conf
sed -i '1s/.*/defaults.pcm.card 0/' $asoundconf
sed -i '2s/.*/defaults.pcm.device 0/' $asoundconf
Code: Select all
#switch to soundcard 1, device 0
asoundconf=/etc/asound.conf
sed -i '1s/.*/defaults.pcm.card 1/' $asoundconf
sed -i '2s/.*/defaults.pcm.device 0/' $asoundconf
Ref.
http://ptspts.blogspot.co.uk/2009/03/ho ... -have.html
http://alsa.opensrc.org/MultipleCards