diff --git a/CHANGELOG.md b/CHANGELOG.md index ab36d9c8..1adb4eaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,11 @@ Versioning](https://semver.org/spec/v2.0.0.html). - The socket endpoint used by a plugin group host process to accept new connections now gets removed when the group host process shuts down. Previously this would leave behind a file in the temporary directory. +- Fixed the VST3 version of _IK Multimedia's T-RackS 5_ causing offline + rendering to stall indefinitely. This could happen when exporting or bouncing + audio in **Bitwig Studio 4.1** or in **REAPER**. That plugin deadlocks when it + receives timer events while doing offline audio processing, so we now prevent + that from happening. ## [3.6.0] - 2021-10-15 diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 58601ae2..63e8103c 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -114,8 +114,11 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context, bool Vst3Bridge::inhibits_event_loop() noexcept { std::lock_guard lock(object_instances_mutex); - for (const auto& [instance_id, object] : object_instances) { - if (!object.is_initialized) { + for (const auto& [instance_id, instance] : object_instances) { + // HACK: IK Multimedia's T-RackS 5 will deadlock if it receives a timer + // proc during offline processing, so we need to prevent that from + // happening. + if (!instance.is_initialized || instance.is_offline_processing) { return true; } } @@ -1429,6 +1432,15 @@ size_t Vst3Bridge::register_object_instance( }, [&](YaAudioProcessor::SetupProcessing& request) -> YaAudioProcessor::SetupProcessing::Response { + Vst3PluginInstance& instance = + object_instances.at(request.instance_id); + + // See the comment in + // `Vst3Bridge::inhibits_event_loop()` + instance.is_offline_processing = + request.setup.processMode == + Steinberg::Vst::kOffline; + const tresult result = object_instances.at(request.instance_id) .interfaces.audio_processor->setupProcessing( diff --git a/src/wine-host/bridges/vst3.h b/src/wine-host/bridges/vst3.h index d9cf932e..5152aa38 100644 --- a/src/wine-host/bridges/vst3.h +++ b/src/wine-host/bridges/vst3.h @@ -244,6 +244,14 @@ struct Vst3PluginInstance { * have, but we'll just do this out of precaution. */ bool is_initialized = false; + + /** + * Whether the plugin instance is currently in offline processing mode or + * not. Needed as a HACK for IK Multimedia's T-RackS 5 because those plugins + * will deadlock if they receive a timer proc on the Win32 message loop + * while doing offline processing. + */ + bool is_offline_processing = false; }; /**