Block size bug when using Tracktion Engine to make an AUv3 plugin

I am a building an AUv3 plugin using Tracktion Engine, and have noticed a bug with the block size used in Tracktion plugins.

I have been able to reproduce the problem with the EngineInPluginDemo provided with Tracktion engine.

In this demo, when building it as an AUv3 plugin, the FourOSC tracktion plugin that generates a click sound uses a blocksize of 2048 samples, no matter what the host specified.
Using breakpoints in Xcode’s debugger, I can see that when I change the block size in the host that holds the EngineInPluginDemo instance (AUM on iOS), the EngineInPluginDemo::prepareToPlay function is called with the host’s block size, but the FourOSCPlugin::prepareToPlay function is never called.

I have made the same experiment with a VST3 build of EngineInPluginDemo in Reaper. In this case, I see that both prepareToPlay functions (EngineInPluginDemo’s and FourOSCPlugin’s ones) are called when the Reaper’s block size changes. And that the FourOSCPlugin uses the proper block size.

2 Likes

Does this also happen when running as stand alone?

And are you using the latest tip of the develop branch?
I have a feeling this might be something that got fixed when I removed the block latency requirement from the Engine-as-a-plugin.