Alsa Software mixing with DMix

2005-08-15 07:56:58 PST

Tags:

Well, I noticed that my laptop didn't want to support multiple audio channels. Woo. Lets hear it for built in sound cards. So I did some research and came up with alsa + the dmix plugin. It allows alsa to do software multiplexing. So to get it to work drop something like this in your home directory:

~/.asoundrc
pcm.dsp0 {
    type plug
    slave.pcm "dmix"
}

ctl.mixer0 {
    type hw
    card 0
}

Thats part of it. That makes /dev/dsp the old OSS sound device multiplex. I think alsa generally is ok (/dev/pcm ?). However mpd's default config doesn't play nice with this. So in /etc/mpd.conf change:

ao_driver               "alsa09"
ao_driver_options      "dev=hw:0,0"

to

ao_driver               "alsa09"
#ao_driver_options      "dev=hw:0,0"

Assuming you're like me and enabled Alsa in mpd to being with. Just comment out the options that specify using the hardware directly. Won't work. With no parameters it goes through dmix fine. Now I seem to have all the audio channels I could want.

More info at http://alsa.opensrc.org/index.php?page=DmixPlugin.

2 Responses to “Alsa Software mixing with DMix”

  1. I suggest doing away with ALSA’s OSS-compatibility entirely, as it seems to be pointless. For the odd thing which demands it, there is “aoss”, the user-space OSS-to-ALSA wrapper (emerge alsa-oss.) Just about everything of value seems to support/prefer ALSA nowadays. For UT, and anything else which uses OpenAL, the following .openalrc is advised:

    $ cat .openalrc
    (define devices ‘(alsa))

    Lastly, I can’t imagine why you’d want to run mpd on a laptop. The whole point of it is to separate the “playing” from the “controlling” so that one may do the “playing” on something with decent audio equipment.

    ALSA’s shite is in /dev/snd.

  2. Thanks for the tip. I’ll probably start migrating that way.

    I use mpd because it’s still very light wieght. I don’t really feel like using Totem or Rhythmbox or other super Gnome-y apps (that also use decent amounts of memory) just to play mp3s, and mpd/gmpc does the trick nicely while still fitting in with my desktop. Also, it makes for easy media key binding, and persistant playlists between reboots and lots of other fun little hacks.

Leave a Reply

Valid XHTML 1.0!
Valid CSS!
Mindstab.net is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
19 queries. 0.407 seconds.