Production Expert

View Original

What Is Digital Audio Latency? Everything You Need To Know

When working with digital audio and especially digital audio workstations (DAWs) like Pro Tools, Logic Pro or Studio One, the word ‘latency’ is used a lot. In this article, we investigate what latency is, how it is caused, and what steps we can take to mitigate its effects.

We had an interesting question from community member Justin Richards about different interfaces having different Analog to digital conversion times.

The Question

“I have an Apollo interface with a Focusrite ISA428 (with ADC card installed). I’m using the Apollo as the primary clock source and sending word clock out from it into the Focusrite (which is set to Ext Word Clock). The audio from the Focusrite is returning to the Apollo via an ADAT lead.

If I split a microphone output to feed an Apollo input as well as a Focusrite input, and then record both inputs into Pro Tools, the ADAT output from the Focusrite records later than the Apollo. If I use the analogue output from the Focusrite (into an Apollo line input), it’s exactly in time.

This demonstrates the different converter times for the two units, and is something I’ve never considered before. Am I missing something, or is ‘conversion time’ something engineers should already know about and compensate for?”

We decided to explore this further and to dig into the issue of latency…

Latency = Delay

In the audio world, ‘latency’ is another word for ‘delay’. For example, it’s the time it takes for the sound from the front-of-house speakers at an outdoor festival to reach you on your picnic blanket, or the time it takes for your finger to strike a piano key, for the key to move the hammer, for the hammer to strike the string, and for the sound to reach your ear.

However, your brain is wired so that it doesn’t notice if sounds are delayed 3 to 10 milliseconds. Studies have shown that sound reflections in an acoustic space, for most people, must be delayed by 20 to 30 ms before your brain will perceive them as separate. However, by around 12 to 15 ms (depending on the listener), you will start to ‘feel’ the effects of a delayed signal.

This is why latency is not usually thought of as a problem in digital mixers. It’s not that digital mixers don’t have latency, they do, but only to the extent that their converters have latency, which, as we have identified, is small enough to be imperceptible in most circumstances.

However, there are situations where even a couple of milliseconds' delay can be a problem. For example, if you use speakers, rather than headphones, to enable musicians to hear themselves, you will get some spill into the mics, no surprises so far. But if the speakers are being fed by a digital mixer, you are likely to get 'comb filtering' between the spill and the direct sound.

What Is Round Trip Latency?

Roundtrip latency in digital-audio applications is the amount of time it takes for a signal, such as a singing voice or a guitar solo, to get from an analogue input on an audio interface, through the analogue-to-digital converters, into a DAW, back to the interface, and through the digital-to-analogue converters to the analogue outputs. Any significant amount of latency can negatively impact the performer’s ability to play along to a click track or beat, making it sound like they’re performing in an echoing tunnel.

What’s Producing the Delay?

In practical terms, the amount of roundtrip latency you experience is determined by your audio interface’s A/D and D/A converters, its internal device buffer, its driver buffer, and the buffer setting you have selected in your digital audio workstation software on a Mac computer or in the Windows Control Panel on a PC.

Converters. Analogue-to-digital converters in your interface transform an analogue signal from a microphone or instrument into digital bits and bytes. This is a complex process and takes a little more than half a millisecond on average. On the other end of a long chain, we’re about to describe are the digital-to-analogue converters that change the digital stream back into electrical impulses you can hear through a monitor speaker or headphones. This can add up to another millisecond or so.

We asked both Focusrite and Universal Audio for their thoughts on Justin Richards’ question. Universal Audio told us…

“This is normal and expected. Every A/D and D/A has its own unique timings, and this is something engineers should account for through ping tests. Of course, Pro Tools does allow Automatic Delay Compensation for hardware inserts on Avid HD systems, and this functionality is firmly on our radar for Apollo and LUNA.”

Focusrite told us…

“It seems they are measuring the difference in A > D conversion time between the ISA digital card and the Apollo, sounds like the ISA digital card’s conversion is slower than the Apollo. This has always been a problem with digital audio recording and, as yet, nobody has really come up with a great solution for dealing with it (that we’re aware of, anyway). 

The closest we’ve got to a solution ourselves is the “Dante Delay Compensation” option on Red 8Line/16Line, which allows a user to delay the analogue inputs on the Red to line up with signals they’re receiving from other devices over S/PDIF and Dante.

If the end-user wants 100% sample accuracy in their DAW then the best they can really do is shift audio recorded via the ISA back by x samples post-recording so it lines up with signals recorded directly via the Apollo.

It’s also worth noting that the digital card used in the user’s test will almost certainly be the older ISA ADC, which is now discontinued. The new ADN cards perform better than the older ADC cards in this regard, with the ADN2 about 0.8ms quicker than the old 2 channel ADC and the ADN8 about 0.4ms quicker than the old 8 channel ADC.”

Buffers. A buffer is a region of memory storage used to temporarily hold data while it is being moved from one place to another. There are four of these in the digital signal chain.

  • Transport front buffer (USB)

  • ASIO / Core Audio (driver) input buffer

  • ASIO / Core Audio (driver) output buffer

  • Transport back buffer (USB)

Each buffer contributes to the total delay present between the time you play that guitar solo and the time you hear it back in your headphones.

What About Thunderbolt?

You may wonder why Thunderbolt was omitted from the transport clock buffer types. Properly designed Thunderbolt drivers employ a Direct Memory Access (DMA) engine that reads digital audio data directly from memory without buffering, greatly improving both efficiency and latency, so they’re in a category of their own. More on that in a minute.

Fast Drivers and Slow Drivers

The biggest variable that contributes to how long this process will take is driver performance. In computing, a driver is a piece of computer code that enables computer applications to interact with a hardware device.

For example, a printer requires a driver to interact with your computer. A driver typically communicates with the device through the computer bus or communications subsystem to which the hardware connects. Drivers are hardware-dependent and operating-system-specific. One of the primary goals for engineers who design audio-interface drivers is to provide the best latency performance without sacrificing system stability.

Imagine that you’re playing an old, run-down piano and that there is a catch in the hammer action—so big a catch, in fact, that when you strike a key, it takes three times longer than normal for the hammer to strike the string. While you may still be able to play your favourite Chopin etude or Professor Longhair solo, the ‘feel’ will be wrong because you’ll have to compensate for the delayed hammer-strikes. You will have a similar problem if the buffer-size setting is too large when you overdub a part while monitoring through your DAW.

Take Two Buffers and Call Us in the Morning

A buffer is designed to buy time for the processor; with the slack the buffer provides, the processor can handle more tasks. When the buffer size is too large, it’s delaying the data (adding latency) more than is necessary for good computer performance. But if the buffer size is too small, the processor has to work faster to keep up, making it more vulnerable to overload, so your computer-recording environment becomes less stable.

Consider this scenario: You’re playing your favourite virtual instrument, trying to add one more part to a nearly finished song. All 62 tracks are playing back, and all of them use plug-ins. Then it happens: Your audio starts to distort, or you start hearing pops and clicks, or worse, your DAW crashes because your CPU is overloaded. The 64-sample buffer size you have set, in conjunction with the amount of processing that your song requires, overtaxes your computer. So the choice is a smaller buffer for less delay but an unhappy CPU or a larger buffer and a more stable CPU but with that comes more delay. If you increase the buffer size, you can probably stop the software from crashing. But it’s not that simple.

The more you increase the buffer size—for example, up to 128 samples—the more you notice the latency when trying to play that last part. Singing or playing an instrument with the feel you want becomes extremely difficult because you have essentially the same problem as with that rickety piano’s delayed hammer strikes. What you play and what you hear back in your headphones or monitor speakers get further and further apart in time. Latency is in the way. And you’re in that echo-y tunnel again.

Modern DAW applications like PreSonus Studio One, Avid Pro Tools and Apple Logic Pro have helped solve this problem by providing the capability to “freeze” audio files. When a track is frozen, the plug-ins processing your audio are rendered, while preserving the original plug-in settings. This removes the CPU load of the plug-in processing, while still enabling you to go back and make changes, allowing you to offload the processing that’s driving the need to increase the buffer size.

Many audio-interface manufacturers have solved the problem of monitoring latency through a DAW by providing zero-latency or low-latency monitoring solutions onboard their interfaces. One of the easiest solutions is to simply blend the analogue input signal with the playback from the computer. The simple analogue mixer knob on the front panel of the interface allows you to blend the analog (pre-converter) input signal with the stereo playback stream from the computer.

Other interfaces provide a Direct Monitor switch that sums the analog signal with the playback streams, giving you an equal mix of the two.

More advanced interfaces have an onboard DSP, which enables you to hear effects, as well as compression and equalization. For example, if a reverb on a vocal is going to be part of the final mix, it’s almost impossible to record the vocal ‘dry’ because phrasing and timing are totally different when you can’t hear the duration and decay of the reverb.

Back To Thunderbolt

The Intel Thunderbolt protocol opened new possibilities in low-latency monitoring. For example, with the PreSonus Quantum-series interfaces and its optimised Thunderbolt drivers for macOS and Windows, you can monitor from within your DAW, through your favourite plug-ins, with less than 2 ms of roundtrip latency.

How did PreSonus do it? Input and output latency were reduced by utilising high-quality analogue-to-digital and digital-to-analogue converters with the lowest latency possible, while still achieving 120 dB of dynamic range. This reduces the latency that cannot be controlled by the buffer size from within your DAW.

PreSonus chose to write the Quantum driver from the ground up. They were able to reduce the roundtrip latency below 1 ms working at 192 kHz sample rate with a 64 sample buffer using Studio One 3.5 on a MacBook Pro 2016, with 2.7 GHz Intel Core i7 running 10.12.5.

The Quantum driver utilizes the bus master Direct Memory Access (DMA) to transfer audio data directly to and from the main memory without using CPU processing and the overhead that would come with it. DMA supports 64-bit addressing on systems with 4 GB or more of RAM. A companion DMA engine in the Quantum hardware reads digital audio data directly between the ADC/DAC and the computer memory, one sample at a time.

For maximum efficiency, samples are transferred from the Quantum DMA engine directly into driver memory as a 32-bit word to match the way the Quantum driver handles the audio. Where possible, audio samples are also transferred into driver memory in the exact order that the driver expects. This helps to avoid alignment problems and the like, allowing you to run your Quantum drivers at extremely low buffer settings without overtaxing your CPU.

Other Solutions Are Available

It’s not only PreSonus that have developed solutions to mitigate latency similar solutions are available from other brands and for other DAWs.

Apogee Ensemble With Logic Pro

The Apogee Ensemble is a premium 1U 30x34 IO Thunderbolt 2 interface with 8 mic preamps boasting an impressive 75dB of gain, 2 instrument inputs and 2 headphone outputs. There are a lot of similarly equipped interfaces out here but the things which set the Ensemble apart from most of the alternatives are the pristine audio quality, flexible complement of IO and the powerful onboard DSP which offers latency-free tracking and flexible mixing courtesy of Apogee’s Dual Path workflow and deep integration with Logic Pro.

Apogee offers a range of FX Rack DualPath plugins. This DualPath technology allows users of compatible Apogee interfaces, such as the Ensemble, to access a near-zero latency workflow when working with these plugins. As these DualPath plugins are also available as native plugins this system is transparent in use with the plugins still available even when the Apogee DSP interface isn’t connected. A seamless experience

You can read more about this in our article Is This The Best Low Latency Workflow On The Market?

Universal Apollo Offers Near Zero Latency Recording

The UAD Apollo platform enables you to record through the full library of award-winning UAD Powered Plug-Ins, including vintage EQs, Compressors, Reverbs, Tape Machines and more at near-zero latency, regardless of your audio software’s buffer size, and without taxing your host computer’s CPU. It’s like having an endless analogue studio, in your rack or on your desktop.

We have a huge number of articles and tutorials covering working with the Universal Apollo DSP accelerated hardware to provide near-zero latency recording solutions.

For example, when used with Logic Pro we demonstrate how to combine Apollo hardware’s direct monitoring with Logic Pro’s software monitoring. Doing this allows for a simplified audio punch-in recording workflow with a consistent headphone mix in our article How to Combine Apollo hardware’s direct monitoring with software monitoring in Logic Pro X.

In our article Tutorial - Tracking Through UAD Plug-ins With Apollo Audio Interface - Part 1 Paul Drew looks at how to track through the UAD Apollo interface. Even though in this video Paul uses Pro Tools, the principle is exactly the same to track in Studio One.

Universal Audio LUNA Recording System

Simply put the LUNA Recording system is a recording, editing and mixing platform that delivers fantastic audio quality and performance from your Mac (a Windows version is planned) and Universal Audio Apollo and Arrow Thunderbolt-equipped hardware. 

In our article Universal Audio LUNA - A Tour Of The New FREE Recording System, James Ivey takes you on a guided tour of the LUNA software. Everything from getting started, installing and updating your LUNA Extension and setting up your hardware to looking at the three different types of track that LUNA deals with as well as learning how to navigate the application. 

LUNA gives Apollo Thunderbolt and Arrow owners a fast recording environment for music production, editing, and mixing. LUNA’s Accelerated Real-time Monitoring gives users seamless hardware and software integration for capturing audio through UAD plug-ins with no discernible latency, offering Apollo owners a natural, analogue-style workflow.

Avid Pro Tools HDX

Avid approach this challenge in a very different way by using dedicated DSP on cards in the computer and more recently putting them in the interface with the Pro Tools Carbon.

Up until recently, Pro Tools systems have been native, or they have been DSP systems. It’s easy to forget that when Pro Tools HD was created, latency was a big problem for those wanting to record audio. However, the cost of entry for Pro Tools DSP powered systems has been significant and for some quite complicated, especially when compared to a single interface solution.

Native Pro Tools is fundamentally the same as any other native DAW, but with Pro Tools as a front end, which for many is a huge advantage, the hardware required to run it is cheap but it suffers the same disadvantage as any other native DAW - Latency. 

If you have a powerful computer and you use it wisely you can work very effectively using native processing but Pro Tools HDX, while expensive, makes latency go away. You no longer have to think about it, and for music users, this is it’s biggest advantage. Pro Tools Carbon offers a hybrid, one-box solution and is the new way to get HDX performance without buying HDX.

The problem has always been that from native Pro Tools, using an all in one rack mounting interface from a 3rd party suitable for tracking a band. Moving up to an HDX system is a big jump in cost and one not many people are prepared to take. The costs and complexity of an HDX system are quite a way from a typical premium interface with 8 mic preamps and expansion options via ADAT, the kind of rig a project studio or a band who were serious about recording might have. It is these people for whom Pro Tools Carbon is perfect.

Pro Tools Carbon sits between Native and HDX. It is a self-contained tracking and mixing solution, which is suitable for tracking the majority of bands live, without having to think about latency. For example:

  • Tracking a four-piece band with 12 mics on the kit?

  • Need miking options on two guitars and bass and monitoring through amp modelling as well as the mics on the cabs?

  • Also, want to track vocals and BVs with room left to experiment with ambient mics down the corridor, and all at the same time?

No problem. 

  • Mix latency-free, independent foldback mixes from the Pro Tools mixer for all four musicians?

Again not a problem.

  • Punch in the whole band for spot fixes without any latency-related headaches or the realisation that your careful low buffer for low latency while tracking, high buffer for lots of plug-ins strategy falls down when you need to re-track the vocal during mixdown?

With Pro Tools Carbon all of that goes away and you have HDX-like, near-zero latency without the expense or complexity of an HDX system.

You can read more about Pro Tools Carbon in our article Pro Tools Carbon - Everything You Need To Know and you can see how it compares to other similar interfaces like the Apogee Ensemble and Universal Audio Apollo x8p in our article Pro Tools Carbon - How Does It Compare To The Competition.

What About Justin’s Original Question?

As a result of this in-depth investigation, we have learnt that…

  • different devices have different conversion times and if you are using mixed devices you will need to adjust the time, post-record to compensate for the different timing.

  • the time it takes to convert analogue audio to digital audio in an interface takes less than 1ms, which is the time it takes sound to travel approximately a foot.

  • conversion times are only a very small part of the latency involved in native DAWs. Buffering and driver design have a much more significant impact on the overall latency of a native based DAW.

  • to mitigate the effects of latency, we need to create a direct path so musicians can hear what they are doing without suffering the round-trip latency going through a Native DAW.

  • a more sophisticated solution involving DSP built into the interface or on separate cards provides near-zero latency monitoring paths with solutions offered by brands including Apogee, Avid, PreSonus and Universal Audio.

See this content in the original post