We are running into an issue with our new iOS AUv3 apps. In particular, latency is failing to update after construction (if changed at the start of the audio buffer).
While troubleshooting in AUM, I received this example code from a Kymatica plugin:
- (NSTimeInterval)latency {
NSTimeInterval l = _param_lookahead.value / 1000.0;
if(_limiterEnabled)
l += _limiterDuration * 2.0;
return l;
}
- (void)setLimiterDuration:(float)limiterDuration {
[self willChangeValueForKey:@"latency"];
_limiterDuration = limiterDuration;
[self didChangeValueForKey:@"latency"];
}
Here is the relevant code in JUCE’s AUv3 wrapper:
if (count >= n)
return overviewParams.get();
NSMutableArray<NSNumber*>* retval = [[NSMutableArray<NSNumber*>alloc] initWithArray: overviewParams.get()];
[retval removeObjectsInRange: NSMakeRange (static_cast<unsigned int> (count), static_cast<unsigned int> (n - count))];
return [retval autorelease];
}
//==============================================================================
NSTimeInterval getLatency() const
{
auto& p = getAudioProcessor();
return p.getLatencySamples() / p.getSampleRate();
}
NSTimeInterval getTailTime() const
{
return getAudioProcessor().getTailLengthSeconds();
}
In general, the AUv3 latency method is overridden on line 841, but no notification is sent to the host as far as I can tell.
Just edited my post to clarify the bug. I want to bump this to see if anyone else is having this trouble.
reuk
December 5, 2022, 4:04pm
3
Thanks for reporting, I’ve got a fix for this on the way.
1 Like
Thank you for the fix! I can confirm that this now works on my end.
reuk
December 14, 2022, 5:02pm
5
For the record, the relevant change:
committed 11:12AM - 14 Dec 22 UTC
This can be tested by toggling 'Distortion' on and off in the
DSPModulePluginDem… o, and checking the latency reported in the node
statistics in AUM.
1 Like