Multiple sound carding with Linux

Yesterday and today I have been trying to solve a little problem o’mine. Since I started using the single computer for everything, there was a small dillema with sound. The thing is that I wanted to use the speakers to listen to mp3s and ogg, while use TV sound when watching movies. Having two sound cards in the same computer looked like a logical solution.

Luckily, both sound cards (Creative and Intel) were detected and configured by system-config-sound. Test sounds played nicely on both of them and I could even select the default sound card.

The question was how to use one card with some applications while using another with others. The answer was pretty simple – Advanced Linux Sound Architecture also known as ALSA.

aplay -l will show a list of detected sound cards. From than on it’s a breeze. Here is an example for mplayer to use a non-default card:

mplayer -ao alsa:mmap:noblock:device=hw=1.0 -fs dvd://1

The key here is the “device” argument and substituion of “:” with “=” and “,” with “.”.

Now, let Google cache this post for me to never have this problem again.