[BUG] setLatencySamples crashes Ableton Live 10 (VST3) [FIXED]

Thanks for posting this! We also got more and more reports on JUCE VST3 plugins crashing in Ableton Live 10 and indeed we do set the latency depending on user settings.

Anyone from the JUCE team who can comment and whether a fix can be provided?

1 Like

+1

Does the juce6 branch exhibit the same issue?
If not, perhaps something from it can be cherry-picked to juce5 to solve the problem

Does this bug also affect plugins that only set the latency in prepareToPlay ?

I recently released a Juce 5.4.7 VST3 that calls setLatencySamples in prepareToPlay and I did not notice issues in Live 10. No testers or customers have reported problems either.

1 Like

I reported this issue a while back, and was able to workaround it by avoiding calling setLatencySamples in the process loop.

This might help: JUCE 5.4.7: setLatencySamples() crashes Ableton when restoring session

I will probably move it outside the process as well, but I remember from my previous tests that some hosts didn’t like it. The problem is we can’t expect a call to prepareToPlay if the latency is calculated on a parameter change. Not all hosts call prepareToPlay at every playback or after setStateInformation.

As you say in your thread, in DSPModulePluginDemo setLatencySamples is called in the process. So, it would be nice to have someone from JUCE (@t0m, @reuk) explain what we should do.

In my plugin when user changes oversampling factor during playback I call setLatencySamples in parameterChanged rather than processBlock. I got that idea from @ericsen’s thread linked above. That seems to work OK - there is a brief interruption to audio as the host adjusts latency, but no crashes (in my experience).

I’m not using AudioProcessorValueTreeState, but I guess I can try to call it from the parameter itself. I’ll do some tests later this week. Thanks!

Thanks for reporting!

Yes, we should be a bit more selective about which flags we send to restartComponent() in the audioProcessorChanged() callback. We’ve added this in 51fe471 which fixes the crash in Live when re-opening sets, but plug-ins built with affected versions of JUCE will need to be re-built. This fix is on the develop and juce6 branches and it’ll make its way onto master when we do a release, hopefully in the next few days.

6 Likes

Perfect, the bug is gone, thank you!

Thanks @ed95! Much appreciated!