I recently ran into some troubles with my VST plugin. Hopefully someone can shed a light on these problems.
Until now, I used AudioMulch 2.2.4 to develop my plugin (VST2). In AudioMulch, I’ve figured out, that when I load the plugin, the functions are called in the following order:
I do not know, why it is necessary to call prepareToPlay() twice, but at least, releaseResources() is called inbetween.
Now I wanted to upgrade my plugin to VST3. Since AudioMulch does not support VST3, I’m using the AudioPluginHost for development. Here, the functions are called in the following order:
Again, prepareToPlay() is called twice, but releaseResources() is not called inbetween. Since I’m loading a lib in prepareToPlay() that’s only allowed to be instantiated once, I’m running into trouble here.
Furthermore, when the plugin is deleted from the filter graph, I’m running into a second problem. Here, releaseResources() is also called twice. Which means that my already released memory is released again.
Can somebody tell my, why the hosts need to call the functions twice? What would be a proper way to implement the memory management here?
Can every host call the functions in an arbitrary order? Or is there some kind of standardization?
Thanks in advance,