ASIO: wrong latencies reported


I suggest to change following functions to:

int getOutputLatencyInSamples() { return outputLatency; } //+ currentBlockSizeSamples / 4; } int getInputLatencyInSamples() { return inputLatency; } // + currentBlockSizeSamples / 4; }

No idea why you’re adding currentBlockSize/4, but it’s definitely not right (I verified). Just stick to what the driver returns.


It’s empirical. I tested a bunch of devices, found that their reported latencies were mostly wrong, and that value gave a decent approximation for the majority of them.

I did that a few years ago now, things may have improved by now. Or maybe you’re just lucky enough to be trying a device that’s accurate? I don’t know.


There’s a good reason why the ASIO standard gives manufacturers the chance report these values - it’s so that applications can use them. If you try to “fix” something like manufacturer-reported values with a rather questionable “empirical way” (which would after all require testing tens, if not hundreds of ASIO soundcards), you’re gonna break the values of those manufacturers who reported them correctly - as it just occured in my case (American Audio Versaport with drivers from Ploytec - and Ploytec do most USB ASIO drivers for Windows, so I believe many of their reported latencies must be just right).


I totally understand and agree.

But at the time I wrote this (I think it might even have been way back when I was doing tracktion), it was a practical choice. The only cards that got the latency right were high-end ones which were running at such low block sizes that this extra kludge made no noticeable difference. Whereas the cards that reported the wrong latency were the crap consumer ones running with big blocks, and for them this fudge factor improved things a lot.

But yes, you’re probably right that removing it might be a good idea now. I’ve not tested any drivers for a long time, but I’m sure they must be better than they used to be.


I wouldn’t believe anything ASIO4All reports…And unfortunately it still gets used a lot. There is a yearly, large crop of newbies trying to do things the fastest, simplest way with the hardware they have that seem to still use it. I’ve had nothing but trouble with it anytime I’ve encountered it.