Anyone who’s done a dive through this site probably knows that I spent a lot of time with a real hate-on for PulseAudio. It’s not very performant compared to Jackd, nowhere near as flexible, and having two sound servers at the same time does eat up a lot of processing power for no perceivable benefit.
With time, however, I’ve learned to relax about a lot of things, and PulseAudio’s no exception. There are times when PulseAudio is the right tool for the job.
The key here is called “decoupling.” Take things one step at a time. Before now, I was a big proponent of Jack, because it can string so many things together into one gigantic process, allowing for some pretty intense processing at the same time as it’s also collecting audio and writing it to disk. And while this is still a valid benefit to Jack, it is tempered by something I’ve learned to hate over the years.
No matter how beefy your system is, there is always going to be bottlenecks. Often, it’s in the communication between your computer and its peripheral devices; the USB or PCI-E interface can only go so fast, compared to the sheer speed of the processor and RAM. This means that, if the buffer empties out or fills up, gaps will start to appear in your audio. In Jack, this means that those empty moments don’t get written, and a great big “Xrun” flag appears in your DAW or Jack utility. When working with multiple tracks or (especially) video, this ends up causing your different tracks to lose sync with one another, since some tracks will have moments written that others don’t.
Most of the time now, I would recommend using a dedicated hardware device to record audio. In this way, the device will have the least chance of dropped packets, processing lag, or synchronization issues of any other alternative.
What does this have to do with PulseAudio? Good question!
The key to preventing this disaster is to avoid processing sound at the same time you’re recording it. In this way, the system is focused on one thing at a time, instead of trying to juggle multiple tasks, each running at a different speed.
While it doesn’t have the complex routing capabilities of Jack, PulseAudio does have advantages when it comes to recording audio. For example, it provides “inputs” consisting of output from all programs interacting with it. This means that, with a PulseAudio-compatible recording program, you can record audio, not only from your microphones and instruments, but also from programs’ outputs.
More importantly, however, PulseAudio just works for recording. It gets your clean recording (you are recording it clean, right?) down with a minimum of fuss, so you can get to the work of processing it. Unlike Jack, PulseAudio will not dimply drop missing moments from your recording, causing worries about the xruns that would occur from processing the audio while recording it. There might be some sound artifacts that will need to be cleaned up, but at least the audio will keep proper time with the rest of your project.
“But Reteo, ” you might say, “Didn’t you just recommend using dedicated hardware to record?” Yes. Yes I did. You’re getting pretty sharp! Or maybe I’m talking to myself, I can’t tell sometimes.
Except, there are times when you want to record something specifically from your computer.
For example, Desktop recording is useful in a large number of applications, from the creation of tutorials, to the making of “Let’s Play” video game walkthoughs. This is becoming even more important, as most of the top 100 YouTube video producers today are people who publish themselves playing video games, and a good number of others publish tutorials by recording their desktops.
Another major use for PulseAudio is to record one of the increasing number of applications for which the ALSA-Jack Bridge will not work, because the apps select audio sources (or destinations) using either PulseAudio, or by devices’ long names, which are detected at bootup.
So, what this all comes down to is simple: PulseAudio has its place in the process. It shouldn’t be used for complex processing, but it makes a good, simple tool for recording audio.
Some tools to consider when planning to record are pretty well-known.
- For recording basic audio, you really can’t go wrong with Audacity. It’s not a digital audio workstation, but for basic recording, you don’t really need to go that far. Save the DAW for projects where you’re placing that recorded audio into a larger tapestry.
- For recording desktop video, you will want to check out Open Broadcaster Software. This program a lot of bells and whistles, including methods for mixing in video from a v4l capture device, your desktop, other video clips as needed, and even images that you can use as bugs or lower thirds. It also supports keybindings for just about everything, potentially turning your desktop into a form of broadcasting console, without needing to spend Tricaster prices. I’ll go into further detail in a future article.
So, there you have it. PulseAudio is not the devil, and can actually be useful. That being said, there is a benefit to knowing when to use it and when not to. Use PulseAudio when you want to record something on your desktop. Use Jack when you want to process your completed recordings. Use hardware to record anything not on the computer.
So stop worrying. Unlike the bomb, it won’t blow up in your face.