Assertion Failure in AudioPluginHost

I am doing the first Audio Plugin Tutorial, but when using AudioPluginHost.jucer I scan for new VST3 plugins I get the the following error message:
JUCE Assertion failure in juce_VST3PluginFormat.cpp:232
I am using JUCE version 7.0.5 with XCode

That assert appears to mean that the function is to be called from the message/GUI thread and not a background or real-time thread. If you’re still getting the problem, you could try posting a little more info so others can reproduce the problem or spot something that might be wrong.

1 Like

This is the function that calls jassert, found in the file called “juce_VST3PluginFormat.cpp”

/** Gives the total number of channels for a particular type of bus direction and media type */
static int getNumSingleDirectionChannelsFor (Vst::IComponent* component, Direction busDirection)
{
    jassert (component != nullptr);
    JUCE_ASSERT_MESSAGE_THREAD // this is line 232

    const auto direction = toVstType (busDirection);
    const Steinberg::int32 numBuses = component->getBusCount (Vst::kAudio, direction);

    int numChannels = 0;

    for (Steinberg::int32 i = numBuses; --i >= 0;)
    {
        Vst::BusInfo busInfo;
        warnOnFailure (component->getBusInfo (Vst::kAudio, direction, i, busInfo));
        numChannels += ((busInfo.flags & Vst::BusInfo::kDefaultActive) != 0 ? (int) busInfo.channelCount : 0);
    }

    return numChannels;
}

The error happens when I scan a folder for new or updated VST3 plugins.
Scanning for AU or LV2 plugins works fine.
The plugin I coded is still blank, it only shows the “Hello World” prompt and does nothing else.

If you have other VST3 plugins installed, the AudioPluginHost may be failing with one of those before it even gets to scan your plugin. What is the call stack leading to the asserting line in the Juce plugin hosting code?

2 Likes

I don’'t think that other VST3s are the problem. If I delete all the data of my plugin the scan doesn’t fail, but if I rebuild then it give the same error.
Here is the output I get: