oreilly.comSafari Books Online.Conferences.


Semi-Pro Linux-Based Recording
Pages: 1, 2


With some rough ideas for the available equipment, let's consider what Linux has to offer for our studio. The use of Unix for audio has grown over time. In the early days of Linux, the first audio apps were ported from flavors of Unix. At that time, mostly academic circles used Unix for audio with programs such as csound and snd.

The growth of Linux has also seen a growth in specialized development communities. Audio production is no exception. As a result, there is quite a variety of applications to use.

The most encyclopedic list of Linux audio apps is at Dave Phillips' Sound & MIDI Software For Linux. The items on the list are not rated in any way, so you will need to test them for yourself. Some are small hobby projects by beginning developers, and some compare quite well to big commercial projects with teams of experienced developers. has a variety of developer chats and articles on its software page and also articles on "making it" in the music section.

Linux Audio Dev is a mailing list where developers exchange information.

Linux Audio Users and Alsa Users are also mailing lists.

Another resource is the ALSA project. This was intended as a replacement for the then-current OSS/Free driver set. One of the aims of the ALSA project has been to create a more useful and usable API for higher-level audio devices. The ALSA drivers are now in the 2.6 kernel, so I'll say no more about OSS or OSS/Free.

One of the extremely useful things at the ALSA web site is their sound card matrix. Here you can check on the status of any card you're thinking of adding to your system.

Example Linux Apps

After you've decided which card or cards to use, the next step is to put together some applications to use for your music projects. Doing this on a one-by-one basis can be hard work, especially if you're not very experienced with handling libraries. One of the frequent causes for dismay among beginners is downloading a beautiful application only to find that it has megabytes of essential dependencies to track down and install. If you're using RPM, you may descend into RPM hell, where everything seems to clash with everything else.

As a good example of what not to do, when I first started with Linux audio, I added to an RPM system by willy-nilly, compiling any libraries I wanted. The system behavior grew more and more bizarre until a conversation with Eric Teidemann revealed that some libraries do not like to share the same roof with others.

These days there's a good and painless way around all of that. There are specialized collections of audio apps and even full-fledged distros that concentrate on bundling software that plays well together. They include:

  • Agnula, a Debian-based audio distro.
  • Planet CCRMA, an RPM-based collection of apps and kernel.
  • Gentoo doesn't lay claim to being a specialist audio collection, but using emerge will install most things you need.

One of the important issues addressed by a specialized distro or add-on is the one of latency. When processing music we want as little system lag as possible, and different techniques have developed for dealing with this with different kernels. For a background on this, see the Low-latency mini-how-to.

Now let's look at some apps.

Ardour and Others

Ardour is a recording application. In some ways, it is the Linux audio flagship: it is big and complicated, it has the ambition to compete with the likes of Pro Tools, and it is very good indeed. One caveat is that just as you wouldn't expect to know your way around Pro Tools in five minutes, don't expect to know your way around Ardour, either. Its great flexibility and power mean that you will need to read and experiment. There is a manual in development (though the author requests payment) and scattered tutorials for specific circumstances on the Web.

For quickly recording and editing a small sample, you can choose from a host of other apps, including audacity and good old snd. Another powerful recording app is Ecasound. This can be command-line or GUI, and with a little thought, can be used on machines with very low resources.


For some sorts of music, sequencers are a valuable tool. Jazz++ was the original big sequencer that handled audio for Linux. The new contender is Rosegarden, which does much the same thing, except has active development.


Trackers still have their adherents, primarily among the electro-dance set. Some interface with MIDI. The main contender used to be Soundtracker, but development has stopped and you will need an old version of ALSA to run it. Cheesetracker is a newer alternative.


JACK and LADSPA aren't apps. JACK is a protocol for Linux apps to share audio and LADSPA is a plugin protocol. This is part of a design philosophy that prefers small applications working together rather than one huge application that does everything, an analogue of the way Linux development itself works.

To use these JACK with the LADSPA collection of plugins, start JACK with jackd -d alsa (or whichever sound system you prefer), then use something like jack-rack to load effects into the stream.

An Example

Let's have a little session where we use Ardour to record the output of a drum machine, a synth, and some voice.

First, start JACK with the command jack -d alsa or equivalent. Alternately, use qjackctl.

Next, start jack-rack and examine some of the effects you can add.

To see your available connections, start qjackconnect. This will display the ins and outs available. At this point, you should only see jack_rack and alsa_pcm.

Now we need some input. Start hydrogen and play around to make a pattern or two.

Also start zynaddsubfx. Click on vK to bring up the keyboard on screen and play around some here too. Sometimes the sound seems to magically make its way to an output, but in theory, you should use qjackconnect to send outputs to inputs. For zynaddsubfx (you'll remember after typing it twice) click on the + icon in front of the app name to reveal the outputs. Highlight and connect them to alsa_pcm playback. Away you go!

Start ardour and add the inputs in the mixer section (edit section). Maybe you've made a nice pattern in Hydrogen, so let's start with that. Because Hydrogen has stereo output, we'll dedicate two tracks to it. Click on Record in the mixer strip, then click the red circle in the transport (the top left corner of the edit window), click the play icon, and click play in Hydrogen.

Oops, we didn't set the levels! Go to the mix window and do that now with the fader. When you've finished recording, click Stop in the transport.

Now let's add some synth. We can practice if we start Ardour playing tracks one and two while we tinkle away on zynaddsubfx. If you can't hear the synth, check qjackconnect. If you jump the gun and disconnect the synth from alsa_pcm and connect it in Ardour to the next track, you won't hear anything while the drums play. At least, I didn't. Set track three to record, click on the red button and play, and then play along with the drums.

So it goes. Note that so far, any extraneous noise has been irrelevant.

Now let's add a little voice by adding another input and making the appropriate connections for the mic. Alternately, you could use a simple recording app to record the voice and then import it into Ardour. (I had to do this because my test machine has no mic-in at all. So I recorded it elsewhere and transferred it over the network.) When you've finished, choose Export Session from Ardour. You can use Audacity to produce an Ogg Vorbis file from the WAV and to do some cleaning up if you wish.

When you're done you probably won't end up with anything like this, which I recorded as I wrote this. One weird thing is that, in playing this Ogg Vorbis file on the test system with XMMS, the word "girl" after "beautiful" disappears completely. Weird! Alsaplayer played it fine. The mic was a medium-priced AKG held too close to the mouth to reduce background noise.

Another weird thing that illustrates the minefield of making a mix quite well is that I transferred loosie.ogg over to a Mac OS 10.3 machine and played it again over the same speakers and using the ported version of Audacity (which I used to encode and play on Linux). The low midrange had disappeared! The voice, which had sounded lowish but intelligible on Linux, was now totally unintelligible. A while back, I also experimented with different MP3 encoders and found the results varied widely. Beware! My conclusion is that Red Book CD is the safest distribution medium at the moment.

Other Example Situations

As usual, your preferred genre may require a different approach. Here's how I would handle different musical styles.

Garage Band

The method and apps we've just explored will do fine for recording garage bands, except that we'll almost certainly need a mixer, particularly if there's a live drummer involved. You could use a multiple input soundcard and the Ardour mix GUI, or even only one mic if you're after a lo-fi sound (or if you really had no other choice).

Electronic Dance Music

We could use a tracker here or one of the sequencers. Jazz++ isn't JACK-capable, so Rosegarden seems a better bet. Another alternative is to use one of the apps in the next category in conjunction with something like Hydrogen or Rosegarden. If you create samples with Csound and load and play them with Hydrogen, you can dynamically alter their sound characteristics as you're recording the output, which could add to the interest of the result.


Csound and Pd are the first apps to come to mind in this section. They both require commitment as far as learning is concerned, but that commitment can lead to rich rewards given the scope of what you can do.

You can also alter, cut, and paste sound files in ardour, ecasound, audacity, or snd.

Violin and Voice

This is conceptually pretty much the same as the garage band, except that you'll want everything as clear as a bell with no distortion at all. Assuming a good setup, our problems are outside of the range of the computer, except we will want to record at as high a sampling rate as we can which implies a top-end soundcard. Why bother if, we'll end up reducing our output to the Red Book CD sample rate? It will give you more options with the original file, and you will have the pleasure of listening to the original recording in higher fidelity. This holds true for the other situations, as well.


One of the joys of experimenting with Linux audio is that trying a wide variety of software won't cost you a fortune. You can also produce very good results with older hardware, provided that you're careful and patient.

There is no law that says Linux software of any sort has to be free of charge. In a time of offshoring and outsourcing, there is added pressure on developers to make a living and pressure to make at least some money from development work. So if you use and like software where the developers have indicated that they welcome donations, then please give some thought to giving some money.

I think I'd like to see some developer teams bite the bullet and actually do something like Quake marketing, where the core is free and add-ons are not. Anecdotal evidence suggests that contributions to developers from ordinary users are almost non-existent. Where there are contributions, they most likely come from other developers.

Thanks to for the loan of a 3.3GHz P4 with 1GB of RAM.

John Littler is chief gopher for

Return to the

Linux Online Certification

Linux/Unix System Administration Certificate Series
Linux/Unix System Administration Certificate Series — This course series targets both beginning and intermediate Linux/Unix users who want to acquire advanced system administration skills, and to back those skills up with a Certificate from the University of Illinois Office of Continuing Education.

Enroll today!

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: