AudioPluginHost refuses to load VST3

I am updating a plugin and have made a few changes to the code, also migrating from Juce6 to Juce7. Well, everything compiles and works as expected, except that the AudioPluginHost refuses to load the VST3 binary. Not that it crashes or freezes or what, it just doesn’t load it, but it loads the VST2 version. Of course, other hosts can load and run the very same VST3 file as expected.

When I drag and drop the VST file, either the debug or the release version, as a soon as I release the mouse button just nothing happens.

What could be the cause?

I’m on the latest develop build of Juce7 so the AudioPluginHost is the last version to date, and I am running it in debug mode.

Build the AudioPluginHost as Debug and use breakpoints to see why your VST3 doesn’t load.

Rail

In the list of plugins, check that the plugin you’re trying to load hasn’t been disabled (it shouldn’t appear on the list at all - check that it’s not shown in red text at the bottom of the list).

If you’re on a recent mac, then perhaps the AudioPluginHost was built for a different architecture than the plugin.

There’s not enough information in the question to guess futher. Your best bet is to try using the debugger to see what’s going on after dropping the file.

In the file MainHostWindow.cpp at line 987:

            OwnedArray<PluginDescription> typesFound;
            knownPluginList.scanAndAddDragAndDroppedFiles (formatManager, files, typesFound);

After dropping the VST3 file, the array typesFound has size zero.
If I try with other plugins, including mine, they do load.

I need to understand what’s so special with this particular plugin that isn’t recognized as a valid VST3 plugin from the AudioPluginHost but works with other hosts.

Ok, I didn’t notice the plugin was blacklisted. Even after removing it from the list, it doesn’t work.
If I run my project in debug mode, set the VST3 project as startup project and attach the AudioPluginHost to the debugger, set a breakpoint at the very beginning of the PluginProcessor constructor, the point is never hit, the plugin code doesn’t even get into execution. The host disables the file without trying to run it.

I don’t understand, I have debugged this plugin millions of times during its development and until the last time it was updated a few months ago, under Juce 6.1.6 and Visual Studio 2019. I have recently switched to Juce 7 and am using VS 2022, and have already completed other projects with this configuration, everything is ok except with this particular plugin.

The standalone works, the VST2 also works, the VST3 (release) loads in all hosts. Only the AudioPluginHosts refuses to load it.

Did you step into scanAndAddDragAndDroppedFiles() and see what’s going on? You have all the tools to figure it out.

Rail

I had to switch to in-process scan to find what was going on. The “out of process” did not let the plugin to run in the debugger, so I could not see if it was running or not, and if it hit an exception or something else.

Well, after switching to “in-process” I could notice that the host is calling releaseResources() without calling prepareToPlay() first, this caused some of the objects used in my code to make calls to methods on pointers that had not been created.

I think the host should not call releaseResources() if no resources have been created by prepareToPlay(). This is the reason why the same plugin did not cause any issues in all other hosts I have tried. Also, something in that area must have changed since JUCE 6.1.6 because the exact same code used to work well before I switched to JUCE 7.

Your code should not depend on the order of the calls to prepareToPlay() or releaseResources()… if there’s a dependency… fix it.

In general you should check if a pointer is nullptr before using it anyway.

Rail