Sidechaining again lol

Ok, so here’s the thing. Whenever I try to change if a sidechain input has been selected or not in Bitwig I end up on this jassert, which says that the host is misbehaving by not deactivating the plugin before trying to change its channel layout. I had crashes before, but not sure anymore if they are related. After all this means that processBlock is probably still being called while its buffer is being resized to fit to the new layout. I think I have told Bitwig about this some time ago already but they are not exactly known for prioritizing on fixing critical bugs, so I just want to know what everyone’s hack to get around this is currently. Because apparently sidechaining works in that host with most plugins, so there must be something that can be done. My initial idea was to call suspendProcessing(true) at the start of isBusesLayoutSupported() but unfortunately that method is const, so it’s not possible and now i’m out of ideas. i have made a sidechain plugin before, but there it was only safe, because it didn’t have any buffers that needed to be resized on changing the channel layout and jasserts don’t make their ways into release.

it always jasserts, no matter if you add or remove a sidechain input. crashes only happen when your processBlock call has a buffer in there that needs a setSize() call with (avoidReallocation ofc), because due to bitwig not stopping playback there is no prepareToPlay call that setSize back to the maximum amount of channels.

That’s why I think it would make sense if JUCE automatically handled suspending the process and calling prepareToPlay during a change of the channel layout, to prevent hosts from causing bugs like that.

The same assert is being hit when debugging any of my juce plugins in FL Studio on windows, I always commented it out back then while debugging.
Never had any crashes.

1 Like

i mean, i don’t care too much about the jassert, as it goes away in release anyway. but it would be cool if it wasn’t triggered at all, assuming that bitwig and fl have no interest in fixing that very soon anyway