I am developing a VST host software (currently on Windows). All works fine so far.
However if I load NI Maschine2 as VST3 and open its UI and press the on/off button next to the NI logo in the title bar inside maschine my host crashes in
juce::VST3PluginInstance::processAudio(juce::AudioBuffer & buffer, juce::MidiBuffer & midiMessages, Steinberg::Vst::SymbolicSampleSizes sampleSize, bool isProcessBlockBypassedCall)
with a nullptr exception.
I tested the same in Bitwig and AudioHostPlugin, both just silence the output when i press the button inside maschine. My code to invoke processing is:
if (auto plugin = device->plugin()) {
bool process_bypassed = plugin->isSuspended() || device->muted();
if (!process_bypassed) {
if (auto bypass = plugin->getBypassParameter()) {
if (juce::approximatelyEqual(bypass->getValue(), 0.0f)==false) {
process_bypassed = true;
}
}
}
try {
if (!process_bypassed) {
plugin->processBlock(buffer, midi);
}
else {
plugin->processBlockBypassed(buffer, midi);
}
}
catch (...) {
}
}
I assume I have to use processBlockBypassed to avoid the crash but I can not figure out the state change of the VST3. I am also using a juce::AudioProcessorListener to listen to the VST but I do not get any callbacks before the crash.
Any advice would be highly appreciated.
