1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-28 02:30:05 +00:00
JUCE/modules/juce_audio_processors
reuk c8dae58fd2
VST3 Host: Avoid calling processBlock, prepareToPlay, and releaseResources simultaneously
The old design had us checking isActive inside our audio callbacks, and
also modifying isActive from prepareToPlay(), and releaseResources(). To
avoid race conditions, and to ensure that isActive actually reflects the
activation state of our plugin, we need to lock in these places. If we
don't lock, there's a chance that other threads will observe isActive to
be true while the plugin is not actually active (for example).

If you're not convinced, imagine this scenario:
- The message thread calls prepareToPlay. The plugin is activated.
- The audio thread starts calling processBlock, and gets as far as the
  isActive check. The plugin appears active, so we continue into
  processBlock.
- At the same time, the message thread calls releaseResources(). The
  processBlock call is still in progress, but the message thread is
  simultaneously making calls to setProcessing() and setActive(), which
  is a race.

Normally, it'd be up to the host of the AudioProcessor to ensure that
prepareToPlay() isn't called at the same time as processBlock().
However, VST3 plugins can request a restart at any time from the UI
thread, requiring us to call prepareToPlay() even while processBlock()
is running.
2021-05-12 11:14:34 +01:00
..
format Allow use of an external VST3 SDK on BSD 2021-04-01 08:39:25 +01:00
format_types VST3 Host: Avoid calling processBlock, prepareToPlay, and releaseResources simultaneously 2021-05-12 11:14:34 +01:00
processors PluginDescription: Also check deprecatedUid when matching plugin identifier strings 2021-04-22 14:28:52 +01:00
scanning XmlElement: Update loops to use new iterators 2021-01-28 20:14:11 +00:00
utilities PluginHostType: Added Adobe Audition on macOS 2021-04-22 12:16:25 +01:00
juce_audio_processors.cpp AutoResizingNSViewComponent: Fix display issues for certain plugin views 2021-05-06 15:51:09 +01:00
juce_audio_processors.h VST3: Add a new PluginDescription::uniqueId field 2021-04-07 15:14:20 +01:00
juce_audio_processors.mm Updated all license headers 2020-06-29 08:30:22 +01:00