5
PreSonus | Learn - The Truth About Digital Audio Latency https://www.presonus.com/community/Learn/The-Truth-About-Digital-Audio-Latency[23/08/2015 04:24:55 AM] Log Into myPreSonus PreSonus.com Nimbit Shop The Truth About Digital Audio Latency By Wesley Elianna Smith In the audio world, “latency” is another word for “delay.” 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. Your brain is wired so that it doesn’t notice if sounds are delayed 3 to 10 milliseconds (ms). Studies have shown that sound reflections in an acoustic space 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. It is this amount of delay that we must battle constantly when recording and monitoring digitally. When Good Latency Goes Bad Roundtrip latency in digital-audio applications is the amount of time it takes for a signal (such as a singing voice or a face-melting guitar solo) to get from an analog input on an audio interface, through the analog-to-digital converters, into a DAW, back to the interface, and through the digital-to-analog converters to the analog 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 (unless they have a way to monitor themselves outside of the DAW application, such as a digital mixer or one of our AudioBox™ VSL-series interfaces). What’s Producing the Delay: a Rogue’s Gallery 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 (Mac ) or Control Panel (Windows ). Converters. Analog-to-digital converters in your interface transform an analog signal from a microphone or instrument into digital bits and bytes. This is a ferociously 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-analog converters that change the digital stream back into electrical impulses you can hear through a monitor speaker or headphones. Add another half-millisecond or so. LEARN ® ® Products Community Videos Support Buy

PreSonus _ Learn the Truth About Digital Audio Latency

  • Upload
    jpmac5

  • View
    7

  • Download
    0

Embed Size (px)

DESCRIPTION

Digital Audio Latency explained on Presonus Audiobox - iTwo

Citation preview

Page 1: PreSonus _ Learn the Truth About Digital Audio Latency

PreSonus | Learn - The Truth About Digital Audio Latency

https://www.presonus.com/community/Learn/The-Truth-About-Digital-Audio-Latency[23/08/2015 04:24:55 AM]

Log Into myPreSonusPreSonus.com Nimbit Shop

The Truth About Digital Audio Latency

By Wesley Elianna Smith

In the audio world, “latency” is another word for “delay.” 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 tostrike a piano key, for the key to move the hammer, for the hammer to strike the string, and for the sound toreach your ear.

Your brain is wired so that it doesn’t notice if sounds are delayed 3 to 10 milliseconds (ms). Studies haveshown that sound reflections in an acoustic space must be delayed by 20 to 30 ms before your brain willperceive 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. It is this amount of delay that we must battle constantly when recording andmonitoring digitally.

When Good Latency Goes BadRoundtrip latency in digital-audio applications is the amount of time it takes for a signal (such as a singing voice

or a face-melting guitar solo) to get from an analog input on an audio interface, through the analog-to-digital converters, into a DAW, back to theinterface, and through the digital-to-analog converters to the analog outputs. Any significant amount of latency can negatively impact the performer’sability to play along to a click track or beat — making it sound like they’re performing in an echoing tunnel (unless they have a way to monitorthemselves outside of the DAW application, such as a digital mixer or one of our AudioBox™ VSL-series interfaces).

What’s Producing the Delay: a Rogue’s GalleryIn practical terms, the amount of roundtrip latency you experience is determined by your audio interface’s A/D and D/A converters, its internal devicebuffer, its driver buffer, and the buffer setting you have selected in your digital audio workstation software (Mac ) or Control Panel (Windows ).

Converters. Analog-to-digital converters in your interface transform an analog signal from a microphone or instrument into digital bits and bytes. Thisis a ferociously 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 describeare the digital-to-analog converters that change the digital stream back into electrical impulses you can hear through a monitor speaker orheadphones. Add another half-millisecond or so.

LEARN

® ®

Products Community Videos Support Buy

Page 2: PreSonus _ Learn the Truth About Digital Audio Latency

PreSonus | Learn - The Truth About Digital Audio Latency

https://www.presonus.com/community/Learn/The-Truth-About-Digital-Audio-Latency[23/08/2015 04:24:55 AM]

Studio One buffer setting.

Smaller buffer, less delay(but an unhappy CPU).

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 ofthese in the digital signal chain.

USB Bus Clock Front BufferASIO (Driver) Input BufferASIO (Driver) Output BufferUSB Clock Back Buffer

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

Fast Drivers and Slow DriversThe biggest variable that contributes to how long this process will take is driver performance.

In computing, a driver is a computer program allowing higher-level computer programsto interact with a hardware device. For example, a printer requires a driver to interactwith your computer. A driver typically communicates with the device through thecomputer bus or communications subsystem to which the hardware connects. Driversare hardware-dependent and operating-system-specific.

One of the primary goals for engineers who design audio-interface drivers is to providethe best latency performance without sacrificing system stability.

Imagine that you’re playing an old, run-down piano and that there is a catch in thehammer action—so great a catch, in fact, that when you strike a key, it takes threetimes longer than normal for the hammer to strike the string. While you may still beable to play your favorite Chopin etude or Professor Longhair solo, the “feel” will bewrong 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 youoverdub a part while monitoring through your DAW.

Take a Couple Buffers and Call Us in the MorningA 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 istoo 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-recordingenvironment becomes less stable.

Consider this scenario: You’re playing your favorite virtual instrument, trying to add one more pad part to a nearly finished song. All 42 tracks areplaying back, and all of them use plug-ins. And then it happens: Your audio starts to distort, or you start hearing pops and clicks, or, worse, yourDAW crashes because your CPU is overloaded. The 64-sample buffer size you have set, in conjunction with the amount of processing that your songrequires, overtaxes your computer.

If you increase the buffer size, you can get the software crashing to probably go away. But it’s not that simple.

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

Let’s look at our piano example again, this time with a fully functioning baby grand and not that antique piano in desperateneed of repair. For simplicity’s sake, let’s pretend that there is no mechanical delay between the time your finger strikes thekey and the hammer strikes the string. Sound travels 340 meters/second. This means that if you’re sitting one meter from the

Page 3: PreSonus _ Learn the Truth About Digital Audio Latency

PreSonus | Learn - The Truth About Digital Audio Latency

https://www.presonus.com/community/Learn/The-Truth-About-Digital-Audio-Latency[23/08/2015 04:24:55 AM]

Larger buffer, more stableCPU...but more delay.

hammer, the sound will not reach your ears for a little more than 3 ms. So why does 3 ms not bother you a bit when you’replaying your grand piano, but a buffer setting of 2.9 ms (128 samples at 44.1 kHz) in your DAW make it virtually impossiblefor you to monitor your guitar through your favorite guitar amp modeling plug-in?

Decoding LatencyAs mentioned earlier, roundtrip latency is the amount of time it takes for a signal (such as a guitar solo) to get from the analog input on an audiointerface, through the A/D converters, into a DAW, back to the interface, and through the D/A converters to the analog outputs. But you can onlycontrol one of part of this chain: the input latency—that is, the time it takes for an input signal such as your guitar solo to make it to your DAW.

This is where driver performance enters the picture. There are two layers to any isochronous driver (used for both FireWire and USBinterfaces). The second layer provides the buffer to Core Audio and ASIO applications like PreSonus Studio OneTM and other DAWs.This is the layer over which you have control.

To make matters worse, you usually are not given this buffer-size setting as a time-based number (e.g., 2.9 ms); rather, you get a listof sample-based numbers from which to choose (say, 128 samples). This makes delay conversion more complicated. And mostmusicians would rather memorize the lyrics to every Rush song than remember that 512 samples equates to approximately 11 to 12ms at 44.1 kHz! (To calculate milliseconds from samples, simply divide the amount of samples by the sample rate. For example, 512samples/44.1 kHz = 11.7 ms.)

The buffer size that you set in your DAW (Mac) or in your device’s Control Panel (Windows) determines both the input and the outputbuffer. If you set the buffer size to 128 samples, the input buffer and the output buffer will each be 128 samples. At best, then, thelatency is twice the amount you set. However, the best case isn’t always possible due to the way audio data is transferred by thedriver.

For example, if you set your ASIO buffer size to 128 samples, the output latency could be as high as 256 samples. In that case, thetwo buffers combine to make the roundtrip latency 3117 samples. This means that the 2.9 ms of latency you set for your 44.1 kHzrecording has become 8.7 ms.

The analog-to-digital and digital-to-analog converters in an audio interface also have latency, as do their buffers. This latency can range from 0.2 to1.5 ms, depending on the quality of the converters. An increase of 1 ms of latency isn’t going to affect the quality of anyone’s performance. However,it does add to the total roundtrip latency. For our 128-sample example setting, adding 0.5 ms for each converter brings the roundtrip latency to 9.7ms. But 9.7 ms is still below the realm of human perception, and it shouldn’t affect your performance.

So Where Does the Extra Delay Really Come From?The culprit is that first mysterious audio-driver layer that no one ever discusses. This lowest layer has no relationship to audio samples or samplerate. In the case of USB, it is a timer called the USB Bus clock. (There is a similar clock for FireWire processes but we will only discuss the USB Busclock here.)

The USB Bus clock is based on a one-millisecond timer. At an interval of this timer, an interrupt occurs, triggering the audioprocessing. The problem that most audio manufacturers face is that without providing control over the lower-layer buffer, userscannot tune the driver to the computer as tightly as they would like. The reason for not exposing this layer is simple: The usercould set this buffer too low and crash the driver—a lot.

To get around this, most manufacturers fix this buffer at approximately 6 milliseconds. Depending on the audio driver, this could be6 ms input latency and 6 ms output latency. But like the ASIO buffer discussed earlier, even if these buffer sizes are set to the

same value, the resulting output latency can differ from the input latency.

For our example, let’s keep things simple and say that latency is 6 ms in both directions. Our mystery is solved: With most audio interfaces, there isat least 12 ms of roundtrip latency built into the driver before the signal ever reaches your DAW, in addition to the 9.7 ms latency we calculatedearlier.

Thus, you set 2.9 ms of delay in your DAW and end up with 21.7 ms of roundtrip latency. (All of the numbers in our examples are based onaverages. However, some manufacturers are able to optimize driver performance to minimize these technical limitations.)

Overcoming the ProblemMany audio-interface manufacturers have solved the problem of monitoring latency through a DAW by providing zero-latency monitoring solutionsonboard their interfaces.

One of the earliest solutions was the simple analog Mixerknob on the front panel of the PreSonus FirePod. Thisallowed users to blend the FirePod’s analog (pre-converter)input signal with the stereo playback stream from thecomputer. This basic monitoring solution is still available onsuch interfaces as the PreSonus AudioBox USB, AudioBox22VSL, and AudioBox 44VSL. Another solution, used in thePreSonus FireStudio™ family and many others, is to includean onboard DSP mixer that is managed using a softwarecontrol panel.

While both of these solutions resolve the problem of latencywhile monitoring, they provide a flat user experience bygiving control only over basic mix functions like volume,panning, solo, and mute.

Page 4: PreSonus _ Learn the Truth About Digital Audio Latency

PreSonus | Learn - The Truth About Digital Audio Latency

https://www.presonus.com/community/Learn/The-Truth-About-Digital-Audio-Latency[23/08/2015 04:24:55 AM]

AudioBox 44VSL Virtual StudioLive mixer and Fat Channel

Old-skool solution: Just grab some of the analog signal before it goes intothe A/D converters and send it back to your headphones. It works but you

can’t hear any effects or reverb.

Anyone who has ever recorded using one of ourStudioLive™ mixers (anyone who has ever tracked with anymixer, for that matter) knows how important it is to be able torecord a track while hearing effects (as well as compressionand equalization). For example, if reverb on a vocal is goingto be part of the final mix, it’s almost impossible to recordthe vocal “dry” — phrasing and timing are totally different when you can’t hear theduration and decay of the reverb.

The developers at PreSonus were intrigued by the idea that they could conceivablyprovide the user with some level of control over the USB Bus clock buffer and perhapsoffer another way of monitoring outside the DAW (while adding effects and reverb).After much experimentation, they discovered that most modern computers can easilyand stably perform at a much lower USB Bus clock buffer than previously thought. Onaverage, a 2 to 4 ms USB Bus clock buffer offers both excellent performance andstability. On a powerful computer like a fully loaded Mac Pro, they’ve been able tolower this buffer to the lowest USB Bus clock setting possible: 1 ms.

Given these discoveries, not giving the user control over the USB Bus clock buffer andtelling them that the only latency controls available are the ASIO and Core Audiobuffer sizes seems at best duplicitous, and at worst a failure to provide customers with the best latency performance a modern computer can provide.

This is where AudioBox VSL-series interfaces enter the picture. This new series of interfaces takes advantage of these technological discoveries andprovides users with the ultimate monitor-mixing experience, without including expensive onboard DSP and the proportional cost increase tocustomers.

Tracking with Reverb and Effects... without Being in a TunnelThe Virtual StudioLive software that comes with our AudioBox 22VSL, 44VSL and 1818VSL interfaces looks like — and performs like — the FatChannel on our StudioLive 16.0.2 mixer.

You get compression, limiting, 3-band semi-parametric EQ, noise gate, and high-pass filter. We’ve even included 50 channel presets from the 16.0.2just to get you started. Plus you get an assortment of 32-bit reverbs and delay, each with customizable parameters.

Optimizing AudioBox VSL SoftwareAudioBox VSL monitoring software runs between the USB Bus clock buffer and theASIO/ Core Audio buffer on your computer, so it is only subject to the latency from theUSB Bus clock buffer.

Unlike many manufacturers, PreSonus did not fix this buffer at 6 ms; rather, AudioBoxVSL offers a choice of three buffer sizes. To reduce the confusion of presenting theuser with two types of buffer settings, these USB Bus clock buffer settings are labeled“Performance Mode.”

This setting is available from the Setup tab in AudioBox VSL, and it directly affects theamount of latency you will hear in monitor mixes from AudioBox VSL software.

At the Fast setting, AudioBox VSL runs at a USB Bus clock buffer setting of 2 ms,while Normal sets the buffer to 4 ms, and Safe sets it to 8 ms. So when you set yourAudioBox VSL to run at the Fast USB Bus clock buffer setting, roundtrip latency will beapproximately 3.5 ms, including the time it

Page 5: PreSonus _ Learn the Truth About Digital Audio Latency

PreSonus | Learn - The Truth About Digital Audio Latency

https://www.presonus.com/community/Learn/The-Truth-About-Digital-Audio-Latency[23/08/2015 04:24:55 AM]

CPU Performance Meter in Studio One 2 Artist DAW (comes free withAudioBox VSL interfaces).

takes for the A/D – D/A converters to change analog audio to 1s and 0s and back to analog again.

To optimize these buffer settings for your particular computer:

Begin by creating a monitor mix in AudioBox VSL and setting thePerformance mode to Fast.Listen carefully for pops and clicks and other audio artifacts at a variety ofsample rates.Now load the AudioBox VSL with compressors, EQs, reverbs, and delays.If you hear audio artifacts, raise the Performance mode to Normal. On mostmachines, Normal will provide the best performance with the most stability. Ifyou have an older machine with a slower processor and a modest amount ofRAM, you may need to raise this setting to Safe. Keep in mind, however, thateven at 9 ms, AudioBox VSL is running at a lower latency than monitoringthrough most DAWs at the best ASIO/ Core Audio buffer setting—and thebest buffer setting will not work on a slower computer anyway.Once you have Performance mode tuned, the next latency component of thedriver to tune is the ASIO buffer size (Windows) or Core Audio buffer size(Mac). This time, load a large session into your DAW and experiment withthe buffer settings. Again, you are listening for pops and clicks and otheraudio artifacts.

If your DAW includes a CPU-performance meter (as Studio One does), you can use this to help you find the best buffer setting for your computer.

No matter how you set your ASIO/Core Audio buffer size, the monitoring latency in VSL is not affected. So you can set this buffer fairly high andlower it only when you are playing virtual instruments. Keep in mind that it’s still important to determine the lowest threshold at which your DAW canstill perform stably.

PreSonus.com Community Learn

ProductsRecording SystemsMixers and ControlSurfacesLive SoundReinforcementMonitoringPreamplifiers andProcessorsMobile AppsSoftwareAccessories

CommunityPreSonus ForumsPreSonus BlogArtistsLearnPreSonus Events

VideosPreSonus VideosPreSonus Live

SupportKnowledge BaseDownloadsProduct RegistrationProduct RepairsRepair StatusContact Support

BuyFind RetailersU.S. RepresentativesInternationalDistributorsThe PreSonus Shop

NewsPress ReleasesArticlesProduct Reviews

My PreSonusLogin/Signup

About PreSonusPreSonus HistoryContact UsCareersLEDC and PreSonus

Copyright ©2015 PreSonus Audio Electronics, Inc. All Rights Reserved.

PreSonus.com PreSonus for Educators PreSonus Home Audio WorxAudio Nimbit

Privacy Policy Terms of Use End User License Agreement Trademarks