ASIO: wrong latencies reported

Discussion and support for general JUCE issues

ASIO: wrong latencies reported

Postby zamrate » Wed May 09, 2012 5:53 pm

I suggest to change following functions to:

Code: Select all
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.
User avatar
zamrate
JUCE UberWeenie
 
Posts: 1081
Joined: Mon Sep 24, 2007 5:33 pm

Re: ASIO: wrong latencies reported

Postby jules » Wed May 09, 2012 6:04 pm

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.
User avatar
jules
Fearless Leader
 
Posts: 17227
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: ASIO: wrong latencies reported

Postby zamrate » Wed May 09, 2012 6:21 pm

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).
User avatar
zamrate
JUCE UberWeenie
 
Posts: 1081
Joined: Mon Sep 24, 2007 5:33 pm

Re: ASIO: wrong latencies reported

Postby jules » Wed May 09, 2012 6:38 pm

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.
User avatar
jules
Fearless Leader
 
Posts: 17227
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: ASIO: wrong latencies reported

Postby kurt6string » Wed May 09, 2012 10:32 pm

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.
User avatar
kurt6string
JUCE UberWeenie
 
Posts: 126
Joined: Sun Dec 04, 2011 3:21 am
Location: Kapolei, Hawaii


Return to General JUCE discussion

Who is online

Users browsing this forum: Google [Bot], Google Feedfetcher and 2 guests