LWN.net Logo

Multi-track recording with Audacity

Audacity is one of the more popular audio editing systems for Linux. It features a straightforward user interface, recording and playback capabilities, and a number of useful editing options. Your author decided to see if Audacity was capable of working as a basic multi-track music recording system.

[Audacity] The hardware used for this experiment consisted of a fairly ancient 700 Mhz Pentium 3 box with 384 MB of RAM and an old IBM 20 GB hard drive. This machine was purchased second-hand at a yard sale for a mere $10. The sound card was an older no-frills Creative Labs model CT4810 PCI device.

Audio was generated with an electric guitar feeding into a guitar amplifier. The amplifier's line out was connected to the sound card's line in with a mono to stereo adapter plug.

The software consisted of the Ubuntu 6.06 LTS "Dapper Drake" distribution running the default stable version 1.2.4 of Audacity.

Setting up Audacity for multi-track recording took a bit of tweaking. The sample representation was changed to 16 bit integer mode and the audio i/o setting was changed to 2 channel (Stereo). The "Play other tracks while recording new one" setting was enabled, this is the critical feature that allows "sound-on-sound" recording. Tests using the default 32 bit floating point sample representation, single track recording and software play-through all resulted in serious dropouts and time distortion on the recordings. These problems also occurred with a more full-featured Sound Blaster Live card in the same system.

Once the correct settings were applied, recording was a simple matter of setting the input level below the clipping point using the input monitor VU meters, and pressing the record button. As with most multi-track recording, it was necessary to record, erase and retry most of the tracks. Audacity makes listening to and re-recording tracks easy, the rewind/play/stop/record buttons are identical to those found on a standard tape recorder, and the undo function (Control-Z) is used to remove a badly recorded track.

One minor problem showed up when playing back while recording. During the recording of the second track pair, the sound from the previously recorded first track pair made clicks and had some short sound dropouts. Fortunately, this problem only occurred while recording, the clicks disappeared when all of the tracks were played back simultaneously. This seemed to get worse as more tracks were added and may be symptomatic of insufficient CPU speed.

Once the desired number of tracks (3 stereo pairs) was correctly recorded, it was time to do a mixdown. This is a simple manner of setting the left/right pan setting for each stereo track pair and adjusting the output levels for a good volume balance between track pairs. The default 0 db track volume level produced audible clipping when multiple tracks were summed together, so it was necessary to attenuate all of the tracks by a few db. The final results can be easily exported to wav, ogg or mp3 format stereo files. The results of this (highly amateur) recording effort can be heard in this short ogg file.

This version of Audacity is a bit unpolished for multi-track audio recording work, but with a bit of effort, it can be made to function as well as an analog tape recorder. The output quality is very good, considering the inexpensive audio equipment that was used. Some of the editing effects such as track volume normalization, fade in/out and silencing of arbitrary sections make production of quality recordings much easier than with older analog equipment. Anyone who has ever waited for a reel-to-reel recorder to rewind will truly appreciate the instantaneous transport controls.

The inability to record mono tracks is an obvious deficiency, the recordings are twice as large as they should be, the screen fills up rather quickly and the total unique track count will be reduced for a given power of CPU. Despite this, Audacity can allow a junker computer to be turned into a useful piece of audio gear with a trivial amount of installation effort.


(Log in to post comments)

Multi-track recording with Audacity

Posted Oct 5, 2006 3:16 UTC (Thu) by ssavitzky (subscriber, #2855) [Link]

I've been using Audacity for a couple of years now, mostly on an 800MHz MiniITX board with a 4-channel M-Audio card. I had horrendous problems with dropouts at first, until I switched to a headless configuration with a separate X terminal. The dropouts disappeared, even with 32-bit samples.

I'm also recording to an NFS-mounted filesystem; this probably helps as well.

The kernel comes from the DeMuDi (Debian Music Distribution) project; it's a 2.4 kernel with low-latency patches applied. I don't think Audacity would work nearly as well with a stock kernel, though I haven't tried it.

Multi-track recording with Audacity

Posted Oct 5, 2006 4:07 UTC (Thu) by drag (subscriber, #31333) [Link]

Ya those drop-outs, pops and squeels are usually symptomatic of latency issues.

Basicly the buffer on the sound card is under running and the noises are artifacts of this. Now in the above case they didn't make it into the recording, but they often do and is very bad stuff. Especially when doing things like recording live music.

I don't understand all of it, but that's the jist of it.

Probably what happenned with you is your video card shared a IRQ with the sound card, or there was some innadiquacy with the drivers or the hardware that caused X to interfer with the sound card. This is especially common on Via-based hardware for some reason.

If your doing more advanced stuff you'd probably use Jackd, which is a audio deamon that is specificly designed for low latency audio work. You use it for managing and routing PCM and Midi signals from hardware device to hardware device and to and from program to programs. You'd use the qjackctl for a GUI interface. In that context then these artifacts show up as 'Xruns'.

This is something that is common to all general purpose operating systems.

This is also why people make a big deal of 'low latency' kernels and such. Anything under 10msec latency is generally considured 'undetectable' by humans. When you add up extra delays in your sound card, stereo receiver, midi devices, and other things like that then obviously you'll see that for live performances and recording/mixing then it's nice to have very low latency on your computer.

There are things you can do to tweak your setup to get better audio performance and reduce latency.

One thing is to use 'gpowertweak' which is just a front end for powertweak to manipulate different /proc settings. The main thing you want to do is go into your PCI devices settings and manipulate the 'PCI Latency' for each device.

This PCI latency is actually the amount of time a device gets to control the PCI buss. The bigger the number the more time it gets allocated.

Typically video cards will get very large windows.. like 256 or so. They don't need this, especially since they use the AGP bus. So reduce that down to 64 or 32 or something like that. It won't have any impact on performance, at least not from what I noticed. Then raise the number for the audio card to something like 256 or something.

That should help some.

Then doing something like giving your jack audio daemon 'realtime' rights helps a lot also. Or giving your audio app 'realtime' priority may help a lot.

The ultimate solution for Linux is to apply and enable the 'realtime-preempt' patches for the Linux kernel currently under heavy development by the very excellent Ingo 'Mingo' Molnar from Redhat.
http://people.redhat.com/mingo/realtime-preempt/

This will turn your Linux machine into a low-latency powerhouse. You can hit the disks as hard as you like. Use the CPU as much as you can, use the ram up and do all the "realtime" audio proccessing your system can handle and it should still give relaible sub-40msec performance. Sub-10msec on fast machines.

And I was talking about just this thing yesterday with a guy at work. I'll just post the links that I found for him then. Hope somebody finds them usefull.

Music Made With Linux, free downloads of songs from various artists. All made with Linux audio workstations.
http://lam.fugal.net/

Tux Power! Linux created music CD.
http://linuxaudio.org/en/music/

Links links and more links.
http://linux-sound.org/

Project originally sponsored by the European Commission. Created the 'Demudi' Debian-based audio distro. Most packages have been integrated back into Debian and are aviable also in Ubuntu via Universe/Multiverse.
http://www.agnula.org/

Planetccrma. Creating multimedia/audio packages for Fedora/Redhat operating systems.
http://ccrma.stanford.edu/planetccrma/software/

Studio ..to go! A commercial live cdrom distribution aiming at making any Windows desktop into a Linux audio workstation through a simple reboot. Has a Demo to download and also has a nice list of applications it provides and hardware that Linux supports well.
http://www.ferventsoftware.com/

Musix is a 100% free software distribution intended for musicians. Another Live cdrom that can be installed.
http://www.musix.org.ar/en/index.html

Dynebolic is a 'Rasta' flavored Live linux cdrom for music and dj'ng. It is designed specificly to run well on low-resource computers. The original live linux audio workstation cdrom.
http://www.dynebolic.org/

Ubuntu Studio. A wiki with howtos and links to packages and such for people that have Ubuntu installed and would like to turn it into a digital audio workstation. Lots of good information and it applies to more then just Ubuntu.
http://ubuntustudio.com/wiki/index.php/Welcome%2C_Musicia...

Jackd (along with gui configuration tools such as qjackctl) are used to provide I/O control for audio applications. Instead of having applications directly access the sound card for midi and pcm audio Jack will providing routing facilities so that you can route the output of one audio application or midi device into another application for creating complex music. Most audio applications support Jack.
http://jackaudio.org/

Realtime-preempt patches for the kernel provides ultra-low latency features and more importantly reliable scedualing. Designed principally for embedded applications were realtime performance is required. Still heavily worked on. Some projects like Demudi provide realtime-preempt patch'd kernels for interested users.

For audio workstation this can help increase reliability of your applications and lower the latency of recording and realtime editing of live music. (on a fast machine this can provide reliable operation with under 10ms latency) It will do things like help avoid things like 'xruns' which are buffer underruns in your sound card that will cause things like popping noises or distortion.
http://people.redhat.com/mingo/realtime-preempt/

Linux audio developers and Linux audio users mailing lists.
http://lad.linuxaudio.org/

no mono recording?

Posted Oct 5, 2006 10:04 UTC (Thu) by johill (subscriber, #25196) [Link]

I'm sure I've recorded mono tracks with audacity. In fact, just select mono in the device settings preferences, I'd think. I guess it's a bit odd that you need to switch that around all the time if you want to do both...

Multi-track recording with Audacity

Posted Oct 7, 2006 0:05 UTC (Sat) by Hawke (subscriber, #6978) [Link]

The sample representation was changed to 16 bit integer mode and the audio i/o setting was changed to 2 channel (Stereo).

The inability to record mono tracks is an obvious deficiency...

So the author found the setting used to record mono tracks and then complained that it was missing? WTF? In addition, you can split stereo tracks into two mono tracks or mix two mono tracks into one ("Quick mix").

The "Play other tracks while recording new one" setting was enabled, this is the critical feature that allows "sound-on-sound" recording.

Am I missing something or does this defeat the purpose of multi-track recording? Why would you do "sound on sound" recording when you can record each sound as a separate track and then mix them together in software? Furthermore, this seems to be the cause of the later dropouts and latency problems the author complains of. In fact, I find it difficult to get audacity to not play back the other audio tracks while recording the new one, regardless of the setting in preferences. (On further testing it seems as if the software initializes to "play other tracks while recording new one" but leaves the checkbox off; so checking and unchecking this preference will disable the feature.

Multi-track recording with Audacity

Posted Oct 10, 2006 22:15 UTC (Tue) by roelofs (subscriber, #2599) [Link]

Am I missing something or does this defeat the purpose of multi-track recording? Why would you do "sound on sound" recording when you can record each sound as a separate track and then mix them together in software?

I read that to mean that it's a playback option to simplify the recording of each new (separate) track in synchronized fashion, not that it's doing live mixing+recording of "sound on sound." The "silent" alternative (depending how you play music) would tend to result in different tracks having different lengths, which would require significantly more processing to correct without screwing up the pitches (frequencies).

But that's just the opinion of a signal-processing theorist, not of a practicing musician. ;-)

Greg

Multi-track recording with Audacity

Posted Oct 10, 2006 22:48 UTC (Tue) by MenTaLguY (subscriber, #21879) [Link]

(IAAPM) To put it more simply, it lets you play along in time with the stuff you've already recorded. Very useful.

Multi-track recording with Audacity

Posted Oct 10, 2006 23:19 UTC (Tue) by Hawke (subscriber, #6978) [Link]

Yeah, but that seems contrary to the author's description of it as "sound on sound". I agree that it's useful to listen to other tracks while you play the new one but describing that as "sound on sound" makes it seem like you're trying to mix the tracks such that the new track contains the previous track(s) as ambient sound (I'd call it "noise") with the new recording added to it.

Multi-track recording with Audacity

Posted Oct 11, 2006 19:35 UTC (Wed) by cook (editor, #4) [Link]

The term "Sound on Sound" dates back to the multi-track reel to reel audio recorders of the late 1960s, pioneered by the Beatles and others. The ability to record a new track while listening to others (in sync) is critical for making music. My ancient Teac 3340S reel to reel recorder calls this ability "SimulSync". There is a switch on the deck for playing back previously recorded channels via the recording tape head. There is a short time delay between the signals on the record and playback heads due to the tape movement, SimulSync removes that. Playback through an analog record head tends to sound very "muddy" (think low-pass filter) but it is sufficient for making musical recordings.

When I wrote the article I wanted to see how Audacity would work on a vanilla Linux system with no special kernel builds or other tricky technology that would be difficult for the average musician to install. Except for the mono-record problem, Audacity got the job done.

Multi-track recording with Audacity

Posted Oct 11, 2006 21:22 UTC (Wed) by Hawke (subscriber, #6978) [Link]

You saw my comment above about the mono-record problem, right?

Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds