Thursday, June 17, 2010

Audio Recording in Linux: An Introduction [PART 1]

Today I want to start a series of articles about Music and Audio production under Linux, discussing the tools available for the working musician and demonstrating that Windows or Mac are not the only options out there. There are several awesome tools available for those of us interested in recording music with our favorite OS.

If you are coming from a different OS or simply are starting up with audio/music recording, there are number of things you must take into account before you set up your system and start buying audio recording gear.

HARDWARE

Assuming that your computer hardware is fully supported by Linux, the next most important thing is to find audio recording hardware that is also compatible. Probably the most important one is that which interacts with your computer: a good sound card.

There is a huge variety of sound cards in the market, from cheap yet convenient kits to fully professional workhorses. Your needs will dictate which type of model you should go after. For example, an important criteria is whether you will be recording many tracks at once, only a few, or maybe only one at a time. There are obviously many other important things to keep in mind, such as the sampling rate capabilities, the quality of the AD/DA converters, etc., but those are maybe more relevant for the expert music producer.

Unfortunately for us Linux users, the main filter comes from the existing limitations in hardware support. For example, soundcards using firewire or USB ports are usually more problematic than PCI ones. Long story short, it is important that you do some research and make sure that whatever device you have in mind, Linux supports it. On top of that, it is also important that your recording software can manage that soundcard efficiently.

In this article I will be talking about Ardour as the main recording tool, so here are some examples of sound cards that I know work very well with Ardour and are natively supported in Linux:

- M-AUDIO Delta series, Models 1010, 1010LT, 66 and 44. These soundcards offer reasonable quality at very afordable prices. Perfect for starters that want to set up a small yet capable home studio or for solo musicians for whom multitracking is no big deal. I own a Delta 1010LT myself and I am quite happy with it.

- RME Hammerfall HDSP, Models 9632 and 9652. Another set of cards that are widely used among Linux users, offering higher quality, higher price tags, but still certainly affordable. One thing to keep in mind is that, while M-AUDIO Delta series usually include their own mic preamps, RME's don't, so you will need an extra device that covers that part.

Note that many other soundcards will probably be supported, but I am listing here those I have seen other Ardour users provide good feedback on. The ALSA project site does provide a list of preferred soundcards, which you can find HERE.

Another very important element for recording is a decent pair of speakers. Once again, there are hundreds of options available in the market, so pick whichever best fits your needs. My only recommendation is that you buy active speakers (unless you buy or already have a poweramp, passive monitors will not work) with a minimum of 50 watt power. Even if you are unlikely to get the most out of that power at home, believe me, the headroom is always welcome. Moreover, you will never be forced to push your speakers to their limit.

NOTE: When using your speakers, make sure you turn them on LAST in the boot order, and shut them down FIRST. In other words, start your computer and only turn on your monitors when you have logged in. Then, as you are about to close your session, shut them down first. That will avoid any cracks and pops that would surely damage your speakers.

So now you have a soundcard that can record and reproduce audio, and a set of speakers that can rock pretty loud, what else? If your soundcard does not include mic preams (as is the case with RME models), you need to get a mic preamplifier. Once again, there are lots of options out there, from very cheap solid state models to incredibly expensive tube ones. Whatever you decide, my recommendation would be that you buy tubes. They warm up the tone and make it sound less "digital". Finally, in order to capture sounds, you will need a microphone. The list of options available is once again endless, so your choice should be based on the instrument you plan to record and on your budget, of course.

As you can imagine, there will surely be other bits and pieces of recording gear required, such as mic stands, cables, etc. Those go beyond the scope of this article, so consult your music shop in case you are not sure about what you need.

DISTROS

The next important thing when starting up is to find out which distro would best cover audio recording basics. For the most part, if your soundcard is supported, good and current ALSA support is all you need to get going. Having said so, there is always a certain amount of manual tweaking required to get things really up and running. If you are a musician who simply wants to get going with audio recording in Linux, avoiding excessive manual tweaking, I recommend the following:

1.- Dedicated partition and installation. I consider it important to keep an isolated environment for my recording stuff. By doing so, I avoid mixing my day to day activities with my recording work, keeping the latter clean and fit by the time I hit the red button. If you can't get any free space for a new partition or don't feel confortable with partition management, I recommend buying a secondary drive (SATA drives are incredibly cheap nowadays) for the task.

2.- Allocate lots of space. Be sure to allow lots of disk space for your partition. I would say 100GB is the minimum you should aim for, but more is probably better. Keep in mind that audio files are very heavy, specially if recording at very high rates. If you add to that the fact that Ardour keeps unused sources, you could end up eating up your drive or partition very quickly. It is better to have excessive disk space than to have less than enough, which would most likely force you to start over.

3.- Use a specialized distro. Now that you have a location solely dedicated to audio recording, why not use a distro that has been designed for it? There are several options, Ubuntu Studio being one of the most popular ones and the one I will be presenting here.

UBUNTU STUDIO

Ubuntu Studio builds on the great Ubuntu foundations to create a distro with very specific goals in mind: Audio, video and photo manipulation. The installation of Ubuntu Studio is, as could be expected, fairly similar to what users get in standard Ubuntu. Please visit the project SITE to find out more about it. You will find screenshots, plenty of information and the downloadable ISO images, of course. To install Ubuntu Studio, burn the ISO into a DVD and run the installation by booting from the Live DVD. The instructions on screen should easily get you through the process.

Once installed, UbuntuStudio provides its own custom Look&Feel, iconset, wallpapers and window borders. The application catalog is huge, including all sorts of packages related with multimedia authoring and edition. As could be expected, GNOME is the desktop manager and most of the standard Ubuntu practices apply in Ubuntu Studio just fine. Software installation is managed from the Software Center or from Synaptic, Software updates are handled by the Update manager, etc. In other words, an Ubuntu user should feel right at home using Ubuntu Studio.

FIRST STEPS WITH UBUNTU STUDIO

Before we can start recording, there are a number of things we need to configure in our newly installed Ubuntu Studio instance.

1.- Ensure your user is part of the Audio group: Simply go to System menu > Administration > Users and Groups and check the Audio group properties. If your user is not part of the group, add it.

2.- Edit the securitylimits.conf file: Open a terminal and type the following command:

sudo gedit /etc/securitylimits.conf

Append the following at the end of the file:

@audio - rtprio 99
@audio - nice -19
@audio - memlock unlimited

3.- Save, exit and reboot.

TO BE CONTINUED...

All should now be ready to start using our audio recording applications, which I will cover in future installments of these series. In the next one, I will discuss a bit more about Ubuntu Studio basic navigation and applications and the JACK audio server. The Hydrogen drum machine and finally Ardour, the fabulous open source digital audio workstation, will play main roles in successive parts.

Thanks for reading!

4 comments:

  1. Hi Chema!
    I couldn't agree more on the importance of knowing the Linux support for your audio hardware. A tip: Even if you don't intend to use Linux for making music by now, when deciding on what audio card to buy, write the line "Is it supported by alsa/ffado?" in your checklist.
    However, even if audio hardware support is far from ideal, you sound a bit too pessimistic about it. There are sixteen different firewire models with full support and several more that somehow work or are on the way to work (see ffado site). As for PCI, I have an m-audio audiophile 2496 that works like a charm with alsa-jack.
    Even with some commercial and many onboard cards you can get jack running, at least to have an idea of what ardour and other apps can do.
    Another correction, if you don't mind: Starting from ubuntustudio lucid, it is not needed anymore to edit /etc/security/limits.conf. The PAM limits jack recommends are automatically set in /etc/security/limits.d/audio.conf once jackd is installed.
    Thank you for this excellent blog.

    ReplyDelete
  2. Old Yamaha cards like pro 1000 series are still supported in Linux and they offer fantastic value in terms of quality and features, even the cheaper 724 chipset Yamaha original Waveforce cards do swell job in terms of sound quality and monitoring.

    ReplyDelete
  3. Thanks for your comments!

    @Pablo: Of course I don't mind about those corrections, and I am glad to see that things are getting easier. Me, I am still using my Ubuntu Studio 9.04, so I didn't know about that, but again, good news!

    On a different note, sorry if that sounded negative there, but it's not really that. I just wanted to play it safe and recommend cards I know work like a charm with both Ardour and Linux. Having said so, very happy to see that there are more and more options out there.

    ReplyDelete
  4. Is Linux great for audio recording. What are the software's that can be downloaded to make this possible?

    ReplyDelete