Multiple PCM streams on Fedora Core (rawhide) using Alsa.



Alsa has been a big step forwards for multimedia in Linux over the past few years, however there are still a number of tweaks that need to be done to optimise it fully. One of the things I found today was the capability to play multiple sounds at once. This comes in great when you're using XMMS to play MP3s and still want to hear noises from programs such as gaim.

To enable this in Fedora Core, a little bit of tweaking is required to make it work. Firstly, you need to edit /etc/asound.conf to contain the following:

pcm.card0 { type hw card 0 }

pcm.!default { type plug slave.pcm "dmixer" }

pcm.dmixer { type dmix ipc_key 1025 slave { pcm "hw:0,0" period_time 0 period_size 2048 #1024 buffer_size 32768 #4096

periods 128

rate 48000 #44100 }

bindings { 0 0 1 1 } }

After doing this, if you use esd in gnome to play the wonderful events such as warning beeps etc, you need to edit /etc/esd.conf to contain something like:
[esd] auto_spawn=1 spawn_options=-terminate -nobeeps -as 2 -d default spawn_wait_ms=100

default options are used in spawned and non-spawned mode

default_options=

After this, reboot your PC, and away you go. Set everything such as gaim to use alsa (you may need to pick "command" and using "aplay %s" to make it work). Everything should be peachy from then on in!

Update: It seems this now works by default and was a bug in the setup for multi-soundcard systems on the particular version I was using during the Fedora 6 testing :)

Comments


Comments powered by Disqus