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.

MP3 broadcasts

I have spent few hours today trying to implement another crazy idea of mine :) This time I want to have an mp3 broadcast continiously coming out of my home server. I was not sure where to start, so I have played with Icecast, Shoutcast, and Apache::MP3. The latest didn’t work yet because I forgot to add mod_perl to my web server, which I planning to do today/tomorrow. Apache::MP3 looks very nice on their example site, although I am not sure it is quiet what I need. If you are interested, you can find Apache::MP3 at CPAN. And Icecast I beleive is somewhere near NullSoft and WinAmp.
Some documentation on setting up things can be found at LDP and with the help of Google.