LWN.net Logo

Multi-track recording with Audacity

Multi-track recording with Audacity

Posted Oct 5, 2006 3:16 UTC (Thu) by ssavitzky (subscriber, #2855)
Parent article: Multi-track recording with Audacity

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.


(Log in to post comments)

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/

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