Suggestions / Bugfixes for AUv2 wrapper

Hi,

I have some suggestions for the AUv2 wrapper implementation:

No. 1

All busses are set to active in lines 531 and 553 in auwrapper.mm

component->activateBus (kAudio, kInput, inputNo, true);

irrespective of a busses’ flags. Imagine I have an kAux bus that doesn’t have the BusInfo::kDefaultActive flag set so it’s initially inactive. The AUWrapper would treat it as active out of the box unless the host explicitly calls into AUWrapper::SetConnection() to set it inactive. In some hosts this yields issues when you’re trying to auto detect whether an external sidechain signal is connected in your VST3 implementation when the plugin is run as an AU, e.g. REAPER.

Can we patch it to

component->activateBus (kAudio, kInput, inputNo, (info.flags & BusInfo::kDefaultActive) != 0);

?

No. 2

The dispatch interval for the parameter change listener is set to 200ms in line 814:

OSStatus status = AUListenerCreateWithDispatchQueue (
			    &paramListenerRef, 0.2, dispatch_get_main_queue (),
			    ^(void* _Nullable inObject, const AudioUnitParameter* _Nonnull inParameter,
			      AudioUnitParameterValue inValue) {
				  setControllerParameter (inParameter->mParameterID, inValue);
			    });

which corresponds to only 5 Hz. Could we set it to e.g. 50ms or 20ms to yield an acceptable refresh rate for automation playback?

Thanks.

Best,
Ray

Hi Ray,
we will check this. It’s too late for the next update, but afterwards I will have a look into it.

Cheers,
Arne

Hi Arne,

Regarding the Bus issue: I just noticed that some hosts don’t call into AUWrapper::SetConnection() at all. Instead they seem to keep all inputs connected and active and feed in zeros if appropriate depending on whether a sidechain input is connected. In those cases it wouldn’t be possible to detect the current state of a bus in a reliable manner. I also read a thread on Apple’s developer forum (I can’t find it right now but will look it up asap) where people had been wrestling with this in older Logic versions and came up with a hacked workaround in their Render function to make it work…bummer.

Best,
Ray