Sorting Out Linux Audio

In this book we use Audacity with ALSA and JACK. No PulseAudio, OSS, aRts, ESD, or whatever else might be lurking in the weeds.

The Linux audio landscape has been complicated for some years, with multiple subsystems and overlapping functionality, and now it is going through some significant changes. There is not a single Linux audio API that developers can target, but rather they must deal with a herd of audio servers and subsystems: the Open Sound System (OSS), the Advanced Linux Sound Architecture (ALSA), the Enlightened Sound Daemon (ESD) on Gnome, the analog Real time synthesizer (aRts) for KDE2/3, Phonon for KDE4, PulseAudio, and the JACK Audio Connection Kit.

ESD and aRts are entering retirement, so that thins the herd a bit, leaving PulseAudio (which runs on any Unix-type operating system), Phonon (KDE4) for controlling playback, and JACK for professional audio production. ALSA provides a common driver base for all of these that interacts directly with audio hardware, and it also provides a useful set of user tools, such as a mixer, device discovery, a simple player and recorder, and a speaker tester. PulseAudio is finding its way into many Linux distributions, such as Ubuntu and Fedora, and it looks like it will become the dominant desktop audio server.

PulseAudio is a sound daemon, while Phonon is a multimedia API supporting multiple audio frameworks, including PulseAudio. PulseAudio and Phonon provide playback mixers and routers and networked sound. Many Linux applications do not have audio device choosers. For example, the Firefox web browser only uses the default audio device. PulseAudio and Phonon let you control which audio device Firefox uses. I prefer to turn PulseAudio off when I’m using Audacity; Turning PulseAudio and Phonon Off in Turning PulseAudio and Phonon Off tells you how to do this.

What about OSS? Some folks prefer it, and you’re welcome to give it a try. ALSA is better supported in Linux, and it includes OSS emulation for applications that want OSS.

Note

The Adobe Flash Player music player is buggy and unreliable. For example, Pandora Radio, the wonderful online music broadcaster, relies entirely on Flash. It is a great service, and I am happy to be a paid subscriber. But Flash Player is an ongoing source of trouble. It loses its connection to the audio system periodically, and it doesn’t like changes in device routing, such as when changing from computer speakers to an external sound system. When it flakes out, it takes a either a browser refresh or a restart to get it going again. If you need an audio source for testing, you should look for something else.

JACK is a professional-quality, low-latency (meaning it adds no latency to your sound chain) sound server for connecting audio hardware to audio production software. JACK does not run standalone but requires alsa-base. JACK supports multiple audio backends: OSS; FFADO (formerly Freebob) for using FireWire recording interfaces on Linux; PortAudio, which is a simple cross-platform audio API; and CoreAudio, the Mac OS X audio API. Audacity uses PortAudio.

Let’s clear up some common confusions regarding PulseAudio and JACK. They address two different types of usage: PulseAudio is a device chooser and audio stream router for playback and recording, while JACK is an audio router for high-end audio production. JACK lets you route the output of multiple audio applications pretty much any way you want, so you can combine different synths and capture audio streams in various ways for recording. Pulse is CPU-intensive and creates too much latency for overdubbing and other latency-sensitive tasks, though both issues are improving as Pulse matures. It works fine for making simple recordings, and Audacity and JACK both support Pulse. You need the pulseaudio-module-jack plug-in for JACK support, which should be in your distro repositories.

When do you use JACK? You don’t need it when your recording interface handles all the connections you need for your recording session. If everything plugs into a single recording interface, just point Audacity to it, and you’re good to go. Though even here JACK can help by giving you flexible routing options, letting you mix the audio streams in different ways and making performance adjustments.

You need JACK when you are using a FireWire recording interface. You need it when you want to incorporate software audio applications into your Audacity recording session. (JACK has great MIDI support, though Audacity does not support MIDI.) A simple example that we’ll go into in detail (in Using JACK with Audacity in Using JACK with Audacity) is adding the excellent Hydrogen software drum machine to an Audacity recording session. If you want to use Hydrogen to create a drum track in Audacity, you need JACK to connect the two.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.105.137