Assertion failure in juce_VST3_Wrapper.cpp:2646


I ran into this problem when loading my VST3 in the AudioPluginHost provided by Juce. The comment above the assertion line:

    tresult PLUGIN_API setState (IBStream* state) override
        // The VST3 spec requires that this function is called from the UI thread.
        // If this assertion fires, your host is misbehaving!

        if (state == nullptr)
            return kInvalidArgument;
        // other stuffs

My plugin is the hello world audio plugin template without modification, and the standalone version was built with no problem. The issue occurred when I tried to build the vst3: I set the executable as a pre-built release of the AudioPluginHost, and clicked run. The first time the host panel opened, there was no error, and then I added the plugin to the panel and saved the filter graph. After that, every time the host was loaded with the plugin already there, the above issue appeared.

Some times when I right-clicked on the plugin, another assertion failure appears: it was “JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED” in juce_Component.cpp:1936. I also attached the screenshot below.

I’m on Linux with Pulse Audio and Jack installed, and there are many usb and audio devices connected to the computer. I found that the input and output devices in the audio settings of the host always changed randomly when the host was loaded even though I saved the filter graph. It’s a bit weird and makes me think maybe the issue may be due to some wrong system-wise audio settings. That’s just my guessing and I just get started to Juce and Linux audio and have no clue what’s happening.