Craig Box's journeys, stories and notes...


Audio on Ubuntu

Ian recently mentioned a new Skype beta for Linux, using ALSA. Did you know that ALSA has supported software mixing "out of the box" since 1.0.9rc2? This means everything from Ubuntu Breezy up did sound mixing, and you didn't even know it. That means if Linux can play sound to your sound card, it will automatically mix multiple sound inputs at once, in hardware if possible, on the CPU if not.

GNOME uses the Enlightened Sound Daemon (ESD) to provide its audio notifications. ESD is, amongst other things, a software mixer - before ALSA, it would take control of the sound device and applications would connect to ESD, which would mix the sound together. Since Breezy, Ubuntu has used ESD with an ALSA backend, meaning that sound mixing "just works" for any application using ESD or ALSA for sounds. The only leftover was applications that wanted to write directly to /dev/dsp device, which can only ever be used by one person at a time. Skype was the last application I could name that didn't talk to ALSA natively, and unfortunately it had issues operating with ESD's dsp emulator, esddsp.

ESD hasn't been maintained for some years, and is probably going to be replaced with the new PulseAudio, formerly known as PolypAudio, a program designed to be a drop in ESD replacement.

Then, of course, there is Gstreamer, which can loosely be compared to DirectX's DirectShow. gstreamer-properties (or Preferences -> Multimedia Systems Selector) lets you set gstreamer to output to ALSA. I assume it's the default in recent Ubuntu releases, so you can play as many sounds, via as many methods, as you like.

crb@machine:~$ apt-cache search gstreamer | grep alsa
gstreamer0.10-alsa - GStreamer plugin for ALSA
gstreamer0.8-alsa - ALSA plugin for GStreamer

Which is it, though? 🙂

Tags: , ,

2 Responses to “Audio on Ubuntu”

  1. Glynn Foster says:

    Yeah, unfortunately 0.8 and 0.10 are binary incompatible, so there are applications written that haven't been ported to 0.10 yet. They're parallel installable, so you can have both on your system at the same time with little harm [I think!].

  2. Craig says:

    I was meaning more the "ALSA for Gstreamer" or the "Gstreamer for ALSA" 😉

Leave a Reply to Craig