Max / CoreAudio round trip latency
Hi, I know latency and its measurement is a tricky topic, but I am surprised by the results I'm getting on MacOS 10.11, Max 8.1.5, CoreAudio at 44100 Hz with internal mic and speaker:
i/o vs | round trip latency | expected minimal latency (2 x i/o vs)
32 ~33 ms 1.5 ms
64 ~35 ms 2.9 ms
128 ~38 ms 5.8 ms
256 ~45 ms 11.6 ms
512 ~64 ms 23.2 ms
1024 ~76 ms 46.4 ms
2048 ~122 ms 92.9 ms
I wonder if the observed additional latency of ~30 ms is from CoreAudio or from Max, and if it could be lowered somehow (or if there's a better way to measure and reason about this)?
For comparison, Live's audio settings report the expected minimal input latency, but an additional output latency of ~20ms:
Live buffer size | input latency | output latency | overall latency
32 0.7 ms 19.8 ms 20.5 ms
256 5.8 ms 24.1 ms 29.9 ms
2048 46.4 ms 64.8 ms 111 ms
This is measured with Graham Wakefield's smart gen~ based patch (originally from this thread: https://cycling74.com/forums/long-term-changes-in-audio-roundtrip-latency/replies/1#reply-58ed21b3c2991221d9ccaba6)
mic speaker combo will allways have more latency than cable connection.
using old latency test patcher
I/O vs and SIG vs set both to 32 gives 5,169 ms latency on cable
13 ms using Mic Speaker on 2008 MacBook Pro
Thanks for the hint alluding to CoreAudio presumably adding some AGC or other processing when the mic is involved. That would explain a part of the unexpected latency.
(Can't test it right now for lack of audio interface or line in.)
Late update: just after writing the above, I had tested with headphones plugged into the line out, and the latency dropped by ~15ms, so there is also a special CoreAudio processing step added (equalisation? compression?) when using the Mac's internal speakers.
After testing with a cable from out to in on an RME Fireface 400, latencies look much better. They are still ~4ms higher than the theoretical minimum, which makes me wonder if that's in the HW, drivers, CoreAudio or Max.
i/o vs | round trip latency | expected minimal latency (2 x i/o vs)
32 ~6 ms 1.5 ms
64 ~7 ms 2.9 ms
128 ~10 ms 5.8 ms
256 ~16 ms 11.6 ms
512 ~28 ms 23.2 ms
1024 ~51 ms 46.4 ms
2048 ~97 ms 92.9 ms
Hardware AD & DA also introduce some latency.
The 2 x i/o vs is added to hardware latency
which can vary from 0.5 up to 2 ms per conversion.
Measure Digital ?
P.S. I just had a look at RME UCX data which states delay of
14 samples for AD and 7 samples for DA conversion
compared to older 400 model which has delay of
43 samples for AD and 28 samples for DA.
I was struggling with big latencies as well lately and in my search I stumbled upon the "Enable Mixer Crossfade (adds Latency)" in the preferences, which I complete forgot about! I was experiencing latencies of 500+ ms, just because the crossfade and ramptimes were set quite high when in the past I was using that during livecoding with Max to get less clicks on recompiling of the dsp-chain. After disabling the crossfade the latency was back to the expected amount of latency (about 5-6ms added from cable/interface, using a focusrite liquid saffire 56, running osx 10.12 with max 8.1.10). This may not be the issue you ran into, but just wanted to add this for future reference. I remember that in Max 6 there was a nice mixer settings button in the user interface, but now this is quite hidden in the preferences (would actually be better if this was included in the Audio Status window).
Hi everyone, I opened a new thread to share an alternative gen version of this, using the old cable loop trick with two buffers to record the click. Please tell me what you think!
https://cycling74.com/forums/a-new-io-latency-test-patch-made-in-gen