Linux USB audio latency reduction
When I re-installed my gigging machine in 2021, I was happy to get a roundtrip latency of ~9.9ms. I usually aim for less-than-10-ms latency, and as my (rather modest) machine wasn’t capable of smaller buffers, I decided that this was enough for me.
Around the same time, I read that an upcoming kernel upgrade was supposed to reduce USB audio latency. Linux kernel sound subsystem maintainer Takashi Iwai had cleaned up the USB audio driver with a positive effect on latency. I thought, “cool, I’ll have to check it out!” and then completely forgot about it (I’ll have to admit I wasn’t expecting something very spectacular).
I regularly updated my system and some time along the way, I installed the kernel upgrade containing Iwai’s patches, without even thinking about it.
A few weeks ago, I was testing a new sound interface and I re-measured my present setup for comparison.
First I thought it was an error. I measured it once again, rebooted, unplugged and re-plugged all my cables, and measured several more times. There it was: with the exact same setup, my latency had dropped from 9.9ms to 5.7ms!
Now my jack settings (-r48000 -p64 -n3
) yield a 4ms ‘jack latency’. This means that the ’external’ latency added by all the round trip via usb, converters and back has been reduced from 5.9ms to 1.7ms!
I know I don’t hear the difference under 10ms (that’s probably why I didn’t notice it earlier), so this might seem quite pointless. But first I find the achievement beautiful in itself, and second, it means much more overhead: I could double the buffer size and still be under 10ms if I need more processing power.
I must say I’m very impressed. Many thanks to Takashi Iwai for this incredible work!