1 (edited by truck 2023-12-23 06:23:03)

Topic: Understanding latency

RME UCX II pdf manual says:
Latency delay DA (6 x 1/fs) @ 44.1kHz = 0.13ms

So each sample takes 1000/44100 = 0.0227 ms.
6  samples takes  6x 0.0227ms = 0.1362 ms (which aligns with the pdf manual)
64 samples takes 64x 0.0227ms = 1.4528 ms

So why do DAW's show the output latency for RME UCX II as 2.4ms (at 44.1kHz 64 buffers), shouldn't it be 1.45ms?

https://www.youtube.com/watch?v=-woScyWOjtE&t=348s

How does a DAW determine/calculate the input and output latency values?
What's the point of UCX II being capable of DA 6 samples, if the DAW is going to add 32+ samples?

2

Re: Understanding latency

Simply continue reading that chapter in the manual.

Regards
Matthias Carstens
RME

Re: Understanding latency

Thanks MC.
For context, I play keyboard live, keyboard usb direct to macbook running mainstage, then usb out to audio interface, to headphones and line out speakers. So I only care about output latency.

So continuing that chapter:
"Mac OS X: The buffer size is defined within the application. A setting of 64 samples at 44.1 kHz causes a latency of 1.5 ms, for record and playback each": Fine.

"When performing a digital loopback test no latency/offset can be detected":
Loopback = "A playback and re-record of the same signal via DA and AD (loopback)"
I don't think loopback (or offsets) are relevant to me I just need DA (not DA + AD).

"Under Windows the Fireface UCX II uses a fixed additional buffer of 32 samples, under Mac 24 samples, which is added to the current buffer size": Ok that's useful.

* Is it the RME driver which adds that?

Mainstage I/O Safety Buffer
https://support.apple.com/en-nz/101938
"When you turn on the I/O Safety Buffer, MainStage will add an additional output buffer to protect against overloads due to unexpected CPU spikes. Its size is equal to the I/O Buffer Size setting, but it only affects the output buffer."

In the youtube example, he must have safety buffer off, because turning it on would yield 64+64+24 samples x 0.0227ms = 3.45ms.

So maybe my total output latency (with safety buffer off) is 64 (mainstage) + 24 (RME driver in Mac) + 6 (RME UCX II output)
94 samples x 0.0227ms = 2.13 ms

Is that right? What about the remaining 0.27ms (2.4 - 2.13)?
If we got the fastest Macbook on the planet, and applied the same 44.1kHz + 64samples settings, would the DAW display exactly the same output latency result?

4

Re: Understanding latency

Safety offset is on input and output = 48 samples.

The playback buffer is added by our driver.

The number seen in typical DAW programs is a the number found in the driver as info. It can be wrong (should be correct with RME). Measuring just one path is not possible, it requires loopback, so input and output latency.

Regards
Matthias Carstens
RME

5 (edited by ramses 2023-12-23 10:48:14)

Re: Understanding latency

truck wrote:

If we got the fastest MacBook on the planet, and applied the same 44.1kHz + 64 samples settings, would the DAW display the same output latency result?

Buffer size has nothing to do with CPU power.

You have a certain sample rate and a certain number of channels (all will be transferred, no matter whether in use or not) and this results in a constant bitstream which is being transferred buffered.

The purpose of the buffersize is to give the CPU more headroom to process audio and to read/write from the I/O port (USB, …) in time to not lose audio. Especially important if the system is under load or if drivers block a CPU core until the driver detaches itself from the particular core where it is running on.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: Understanding latency

Measuring just one path is not possible

I agree. I have already measured total RTL (key tap to sound out), and partial input latency (key tap to midi out re-cabled to line jack audio signal).

Buffer size has nothing to do with CPU power

Nice to have that confirmed thanks.

Is this correct for output, assuming 44.1kHz, and DAW buffer 64 samples, UCX II?

64 samples = DAW set by user
(plus DAW I/O Safety buffer, if enabled by user)
24 samples = OSX Core Audio - Safety Offset, required by OSX.
24 samples = RME USB driver - Playback buffer
7 samples = RME UCX II
119 samples x 0.0227ms = 2.7013ms

Re: Understanding latency

Whatever you add up, the latencies are very low wink

Addition: of course, a faster CPU helps to process the workload faster. But it also doesn't help if low-level routines (drivers) block CPU cores for too long on which audio-related processes are supposed to run. Drivers can only detach themselves from a core to maintain data integrity. How long a driver may occupy a CPU is coded in the driver, and these are all just programming "conventions". Poorly written drivers occupy CPUs for too long, these are the so-called DPC (deferred procedure calls) latencies. No audible audio latencies, just determine how agile a computer can react to a workload. Either efficient utilization of CPU resources, if the drivers only use the CPUs with a sense of proportion, or "driving with the handbrake on". Not so bad with benchmarks, but with audio because of the real-time requirements of such applications.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: Understanding latency

Whatever you add up, the latencies are very low

Totally agree, but it's still strange that the proposed minimal maths (2.7013ms) ends up with a bigger number than than the DAW (RME driver) is reporting (2.4ms).  Maybe the DAW/Driver doesn't have visibility into the "OSX Core Audio" step.

9

Re: Understanding latency

truck wrote:

agree. I have already measured total RTL (key tap to sound out)

...but seem to be unaware of the ultimate tool to give you all the info:

https://oblique-audio.com/rtl-utility.php

Regards
Matthias Carstens
RME

Re: Understanding latency

Thanks, yes I've used the RTL Utility, it has been immensely helpful for measuring the latency of the audio interface itself, and sound desks, and parts which have audio in and out.

For measuring the one way latency from keyboard key tap, to midi out, I made a cable similar to this:
https://gearspace.com/board/electronic- … ter-4.html

And found that my Yamaha CK88 takes 6.2ms seconds from keyboard tap to local audio out.  But unfortunately it takes 23ms from keyboard tap to producing a midi out signal. LaunchKey mini 25 mk3 takes 10ms. Komplete A49 takes 16ms. Nord Stage 3 takes about 27ms.

I actually had 4 feeds going into Ableton: 1) keyboard key press using a mic into audio interface input1.  2) midi out of keyboard converted to audio into audio interface input2.  3) midi out of keyboard, via audio interface midi din port, thunderbolt into macbook. 4) keyboard usb direct into macbook.  For these tests, the audio interface was only adding 0.6ms, due to 192kbps, minimal buffers. By comparing different items, I was able to measure one way traffic, although not perfectly accurate I admit.

Ironically we spend so much time and money on audio interfaces to trim 2-3ms, and all the while (for keyboardist anyway playing 88 note touch sensitive keyboards and using a DAW), there is a LOT of delay wasted inside the keyboard.

If anyone happens to know why an 88note keyboard takes 23-7=16ms to generate a midi signal, I'd be very interested, but I realise very off topic for an RME forum.

Thanks both for your comments here, they have really helped me to understand the Safety Offset and Playback buffer aspects.

Re: Understanding latency

It’s seems more effort is put into drum modules. The Roland modules have only a few ms delay from hitting a pad to a midi output. Alesis tend to be higher at around 10ms. There is a whole subject on edrum forums on the best drum modules for low latency midi. Latency on drums can be felt even at around 10ms

Babyface Pro Fs, Behringer ADA8200, win 10/11 PCs, Cubase/Wavelab, Adam A7X monitors.

12

Re: Understanding latency

truck wrote:

Thanks, yes I've used the RTL Utility, it has been immensely helpful for measuring the latency of the audio interface itself, and sound desks, and parts which have audio in and out.

Because of your former posts I am not convinced you used RTL at its fullest. After a RTL measurement open Log, right click on the spreadsheet title bar, then check all important infos that you want to see. On a Mac it can also show Reported In and Out latency, Safety Offset buffer In and Out and some more. Many people are not aware of these extra info being available under both Windows and macOS.

Regards
Matthias Carstens
RME

Re: Understanding latency

MC great tip! The extra columns inside the RTL Utility Log tab were very helpful.

I retested with my interface, summed these fields from the RTL Utility > Log tab:

OSX Out Buffer
OSX Out Safety
OSX Out Device
The total of these 3 is precisely what MainStage (safety buffer unticked) and Ableton Live report for latency out.

Thank you!