Latency

Discuss hardware/software tools and techniques involved in capturing sound, in the studio, live or on location.
Post Reply

Latency

Post by curiousMike »

Current offerings of recording hardware have too much latency, at least for me in my commercial recording studio. We are told that this is a result of the the processing power needed to handle A/D-D/A conversions of the large audio files. How can this be so when modern processors have in excess of 3 Ghz of processing power (that's 3 BILLION instructions per second)? Even with 24 tracks of 48k audio there are only 1.2 Million samples (rounded up) times 2 for round trip is still only 2.4 million samples to deal with.
Some of the products on offer have latency in excess of 40 milliseconds. The manufacturers claim that this is a limitation of our computers. If this is true, then how come the equipment which I currently use, which I bought TWENTY years ago, has a round trip (from console to digital recorder back through console) latency of only 6 samples? To top it all off, both of these units have a processor that is only 366 Mhz!
curiousMike
Posts: 2 Joined: Mon Oct 23, 2023 3:46 am

Re: Latency

Post by MaestroMikeT »

Hi, CuriousMike!
Could you please elaborate a little, and give some examples? When you say there are interfaces advertising 40ms of latency I can’t really put my finger on wich might those be.
Someone more knowledgeable than me might chime in and explain the inner twiddlings, but maybe you’re comparing the ubiquitous USB interface of now versus the pci interface of yore, wich had tremendous performance latency-wise, and wich were the de facto cards to have if you were a pro. In fact, yes, there are modern USB interfaces with poor latency compared to those, and wich rely on direct hardware monitoring for overcoming unacceptable delay recording/overdubbing/playing vstis. I should now, in one of my systems I have still a Delta 1010 PCI with wich I NEVER ever had the need to use direct monitoring, always monitored through Nuendo with plugins without noticeable latency.
So perhaps you could search the likes of RME Radat or Aio Pro (the one I’m eyeing for my next upgrade).
MaestroMikeT
Poster
Posts: 67 Joined: Thu May 07, 2020 3:24 pm

Re: Latency

Post by Wonks »

A lot is down to the overhead of the operating system. If you are talking of a bespoke recording system such as RADAR, then its operating system is based purely around recording and doesn’t have to also accommodate wi-fi, Bluetooth, video, multiple windows, anti-virus etc.

You are also looking at many people using computers with very little expansion capability, so you have to use interfaces with standard connections such as USB and Thunderbolt, and work with their shortcomings with regard to streaming audio.

40ms is at the very slow end of performance and nearer 6-7ms for round trip performance is far more common.

As you are talking of 48kHz rates, are you saying that your old system had a round trip latency of 6 samples, or 0.125 ms?

If you had hardware that linked the A/D output direct to the input of the D/A, I guess you could do that, but that’s not doing anything with the data and is akin to simple direct monitoring on an interface. It takes time to get the data into a DAW, process it and get it out again. Those sort of times (6 samples) aren’t comparing like for like.
User avatar
Wonks
Jedi Poster
Posts: 19208 Joined: Thu May 29, 2003 12:00 am Location: Freethorpe, Norfolk, UK
Reliably fallible.

Re: Latency

Post by merlyn »

What's important for monitoring through software is the round trip latency.

A/D > propagation delay > hardware buffer > software buffer > processing > software buffer > hardware buffer > propagation delay > D/A

The signal is going through the input and output stages. The part that has sped up with faster CPUs is the processing part, but as you can see that is only one part of the process. Propagation delay and a hardware buffer built into an interface don't add much. I have an RME PCI card and the hardware adds 60 samples. This isn't a lot compared to the software buffer that ALSA, Core Audio or ASIO use. This is a DMA buffer, but it doesn't get called that any more as everything gets dumbed down.

A DMA buffer is an area of system memory that the software uses, which is copied to the hardware. A software buffer of, say 128 samples is fairly normal, and that is on the input and output. So the software buffer is where most of the latency is coming from.

You would think that CPUs getting faster would lead to lower latency. To get the lowest latency, we need a real time operating system which unfortunately Windows, Linux and macOS aren't. It may seem that a computer responds instantly, but it doesn't. It's an illusion. User requests like mouse clicks go into a queue (the scheduler) and CPUs are fast enough to make the response seem instant.

Why don't we get real time OSes? Well, I don't imagine there's a lot of profit in it.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Latency

Post by James Perrett »

merlyn wrote: Mon Oct 23, 2023 2:06 pm Why don't we get real time OSes? Well, I don't imagine there's a lot of profit in it.

Real time OS's exist but they're not cheap and they aren't general purpose. You would normally only have a single application installed on one. I've used non-audio devices that run the VxWorks operating system on PC hardware with added DSP. Back in the 90s we also tried VRTX for our underwater vehicle but ended up taking a different approach.

These days general purpose operating systems running on fast computers work well enough for most people who don't need the guaranteed response times that real time operating systems offer.
User avatar
James Perrett
Moderator
Posts: 16990 Joined: Mon Sep 10, 2001 12:00 am Location: The wilds of Hampshire
JRP Music - Audio Mastering and Restoration. JRP Music Facebook Page

Re: Latency

Post by merlyn »

Perhaps I should have said "why don't we get Cubase for QNX?". See above.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Latency

Post by ajay_m »

well my current setup on Reaper reports 1.2ms in, 1.8ms out at 96KHz, 128 sample buffer. And no, I'm not using an RME interface. Pretty happy with this level of performance!
ajay_m
Frequent Poster
Posts: 1673 Joined: Mon Jan 16, 2017 7:08 pm

Re: Latency

Post by merlyn »

Sure, but how many plugins can you use at that latency? The lower the buffer size, the quicker the DSP load goes up, and the less plugins can be used. If you have a powerful machine, it may be enough. Software reported latency is a lot better than it was in say 2000, but it would still make sense to measure the latency with e.g. RTL Utility to have a definitive figure.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Latency

Post by curiousMike »

Thanks for all the responses. My digital console and my digital recorder ( I don't want to mention brand names because I am not promoting any company over another) are connected by optical (lightpipe) cables. I do most of my recording at 48K. I don't generally use any DSP when laying down tracks because if you have the original unadulterated sound you can do anything you want to with it later, but if you process it in any way, sometimes you lose something that you can't get back. Both of the computers contained within these devices are dedicated only to the musical functions of these devices. My question is still, if they could achieve this low level of latency 20 years ago with a 366Mhz processor, why can't they do it now (they should be able to achieve it even with DSP processing). Latency is important in a commercial studio, because overdubs with a latency of 7 milliseconds is a nightmare.
curiousMike
Posts: 2 Joined: Mon Oct 23, 2023 3:46 am

Re: Latency

Post by Wonks »

It would help us a lot to know just what equipment you are talking about to put it in context.

What was the old system with sub 1ms latency, and what is the new system with 7ms? And if there is no processing being added on the way in, why isn’t there any direct monitoring facility available with no or extremely low latency?
User avatar
Wonks
Jedi Poster
Posts: 19208 Joined: Thu May 29, 2003 12:00 am Location: Freethorpe, Norfolk, UK
Reliably fallible.

Re: Latency

Post by merlyn »

If you're talking about going from a digital desk to a digital recorder and back via ADAT, then that stays in the digital domain. It's simply shuffling bits around. There's nothing fancy going on.

Where did you get the six samples figure? It's good, but perhaps not that surprising for staying in the digital domain.

Despite what James says about underwater robots, hardware generally uses a real time operating system. There are exceptions, like a Yamaha Motif, which is running Linux under the bonnet. Linux can be tweaked to be pretty near real time. It still isn't technically 'hard real time', but it's close enough to run a synth with unnoticable latency.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Latency

Post by Wonks »

Six samples sounds very much like the basic A/D and D/A processing delay. Even if kept all digital, there will probably some extra buffering involved when moving things round.
User avatar
Wonks
Jedi Poster
Posts: 19208 Joined: Thu May 29, 2003 12:00 am Location: Freethorpe, Norfolk, UK
Reliably fallible.

Re: Latency

Post by tea for two »

A quick giggle search.

Global PC market USD 187billion in 2023.
Global Medical devices which require RTOS
market USD 512billion in 2022.
Global audio hardware equipment market USD 31billion in 2021.
Global PC audio music market just under USD 7billion in 2021.

Within the Global PC market I'm afraid audio music is seen as poor as a church mouse.
Gaming is where the lolly is with consumer cpu gpu brands bending over backwards for better gaming performance as is screen manufacturers even on mobiles Global market USD 457billion in 2021 for mobiles.
Video too is where the lolly is given the USD 29billion in 2021 in ad revenues on utube that video content makers bring in for google/alphabet.

Developments chase the moolah.
Just not worth it for them with regards to audio on pcs.
tea for two
Frequent Poster
Posts: 4009 Joined: Sun Mar 24, 2002 12:00 am

Re: Latency

Post by Johnsy »

curiousMike wrote: Mon Oct 23, 2023 4:12 am If this is true, then how come the equipment which I currently use, which I bought TWENTY years ago, has a round trip (from console to digital recorder back through console) latency of only 6 samples?

Hi Mike,

I'm not sure where you're getting this number from, but unless I've misunderstood something, I'm afraid it must be wrong. Even the fastest high-quality ADCs and DACs of twenty years ago had latency in the 30-120 sample range at best - and that's for a single conversion.

Six ms (288 samples @ 48kHz) might be in the ballpark for the round trip, but not six samples.

BTW, a genuine analogue-back-to-analogue round trip of 7ms is very good. The pro-audio standard is <10ms.
Last edited by Johnsy on Tue Oct 24, 2023 3:50 pm, edited 1 time in total.
Johnsy
Frequent Poster
Posts: 572 Joined: Tue Apr 06, 2004 12:00 am

Re: Latency

Post by merlyn »

I don't think Mike is including any A/D or D/A. I think this is the delay in the digital domain. There are four steps where a sixteen bit sample has to be transmitted serially over ADAT, and that could be where the delay is coming from.
merlyn
Frequent Poster
Posts: 1643 Joined: Thu Nov 07, 2019 2:15 am
It ain't what you don't know. It's what you know that ain't so.

Re: Latency

Post by Johnsy »

merlyn wrote: Tue Oct 24, 2023 3:47 pm I don't think Mike is including any A/D or D/A. I think this is the delay in the digital domain. There are four steps where a sixteen bit sample has to be transmitted serially over ADAT, and that could be where the delay is coming from.

Got it. My mistake. Yep. That all adds up. :thumbup:

P.S., Sorry Mike!
Johnsy
Frequent Poster
Posts: 572 Joined: Tue Apr 06, 2004 12:00 am

Re: Latency

Post by Johnsy »

Mike,

The fundamental answer to your question is that todays kit is doing block-based processing (because it's basically a general-purpose computer) rather than sample-by-sample processing as it was twenty years ago (when it was a handful of DSP chips glued together with FPGAs).

This design can much more efficiently process large numbers of channels, but the downside is the buffering latency, which is a fixed penalty - you incur it whether you actually use the DSP or not.
Johnsy
Frequent Poster
Posts: 572 Joined: Tue Apr 06, 2004 12:00 am
Post Reply