Friday, January 27, 2006


If you enjoy audio books, here's a site with free audio books:

I'm currently listening to EarthCore, by Scott Sigler.

And here's another free audiobook by Scott:

If you enjoy these books, make a small donation to support the authors and servers.

Wednesday, January 11, 2006

ALSA Device Sharing

Users often experience "device busy" errors when two or more applications attempt to use the same sound card simultaneously via ALSA. The answer to this problem is to configure your applications to use an ALSA device name that is routed through the dmix plugin. For most systems, the "default" device is routed through dmix to the first sound card in the system. But what if you have a second sound card (such as headphones)? Most systems don't automatically have a device name that routes through dmix for the second card. Here's the solution. Put the following in your ~/.asoundrc file:

pcm.dmix2 {
type dmix
ipc_key 8543
ipc_key_add_uid true
ipc_perm 0666
slave {
pcm "hw:1,0"
# format S16_LE
# rate 16000

pcm.plugdmix2 {
type plug
slave.pcm "dmix2"

The "hw:1,0" tells dmix2 to route to the 1st device on the second card. Substitute what is appropriate for your system. The ipc_key number is completely arbitrary. Make up whatever number you like, so long as it is unique in the ALSA configuration. Now configure your applications to use device "plugdmix2". The plug pcm will automatically convert various formats for you to the format required by the device. If you want to learn more about .asoundrc files, here's a couple of links I can recommend:

Hardware/Software Mixing

PCM Plugins

Wednesday, January 04, 2006

Multiple Sound Cards and aRts

Here's a little tip for KDE users with multiple sound cards in their computer. Suppose you've configured aRts to use ALSA and want aRts to playback on the speakers of your first sound card, but input from the microphone on a second sound card (perhaps a headphone set). Create the following ~/.asoundrc file:

pcm.BiPlex {
type asym
playback.pcm "default"
capture.pcm "plughw:1,0"

Then in the KDE Control Center under Sound & Multimedia | Sound System, go to the Hardware tab, check Override device location and enter BiPlex. Click Apply and enjoy.