Ableton VST3 96khz - calling prepareToPlay for every buffer


I just found some weird behaviour if using a VST3 plugin in Ableton with a 96khz sample rate. When playing back audio the host seems to call prepareToPlay() over and over again - for every buffer. This leads to a stuttering sound in my case since I reset some states in prepareToPlay which is only meant to happen once before playing back audio.

The weird thing is that it only happens with VST3 at 96khz. AU works fine on all sample rates and so does VST3 if it is 48khz or 44.1khz.

Have been testing only on MacOS so far.

Has some experienced something similar and knows a way to fix it?

Did you try this on JUCE demo or simple jucer generated plug-in template?

just tried it on a Juce tutorial and there it worked fine and prepareToPlay is only called at playback start.

So apparently I am doing something wrong in my plugin. However, it is pretty hard to track down what triggers the prepareToPlay calls in the Ableton 96khz VST3 scenario. And I am clueless why it works fine in all other scenarios…

Are you calling updateHostDisplay, or other functions that call updateHostDisplay? This function may cause the plugin to request a restart from the host, which in turn might cause the host to deactivate and reactivate the plugin.

thanks for the hint! I will check if I call updateHostDisplay somewhere. But still weird why it only happens at 96khz then…

Couldn’t find anything that potentially could trigger the reload.
When debugging and looking at the call stack I can only find that
tresult PLUGIN_API setActive (TBool state)
is being called which then leads to releaseResources and prepareToPlay being called.

In Reaper for example VST3 works fine with 96khz.

Any ideas how I can further debug this issue?

Just found the issue.
setLatencySamples() was causing the reload