mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Inhibit event loop during VST3 offline processing
This prevents T-RackS 5 from causing the export in Bitwig Studio 4.1.0 beta 2 to freeze.
This commit is contained in:
@@ -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
|
- The socket endpoint used by a plugin group host process to accept new
|
||||||
connections now gets removed when the group host process shuts down.
|
connections now gets removed when the group host process shuts down.
|
||||||
Previously this would leave behind a file in the temporary directory.
|
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
|
## [3.6.0] - 2021-10-15
|
||||||
|
|
||||||
|
|||||||
@@ -114,8 +114,11 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context,
|
|||||||
bool Vst3Bridge::inhibits_event_loop() noexcept {
|
bool Vst3Bridge::inhibits_event_loop() noexcept {
|
||||||
std::lock_guard lock(object_instances_mutex);
|
std::lock_guard lock(object_instances_mutex);
|
||||||
|
|
||||||
for (const auto& [instance_id, object] : object_instances) {
|
for (const auto& [instance_id, instance] : object_instances) {
|
||||||
if (!object.is_initialized) {
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1429,6 +1432,15 @@ size_t Vst3Bridge::register_object_instance(
|
|||||||
},
|
},
|
||||||
[&](YaAudioProcessor::SetupProcessing& request)
|
[&](YaAudioProcessor::SetupProcessing& request)
|
||||||
-> YaAudioProcessor::SetupProcessing::Response {
|
-> 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 =
|
const tresult result =
|
||||||
object_instances.at(request.instance_id)
|
object_instances.at(request.instance_id)
|
||||||
.interfaces.audio_processor->setupProcessing(
|
.interfaces.audio_processor->setupProcessing(
|
||||||
|
|||||||
@@ -244,6 +244,14 @@ struct Vst3PluginInstance {
|
|||||||
* have, but we'll just do this out of precaution.
|
* have, but we'll just do this out of precaution.
|
||||||
*/
|
*/
|
||||||
bool is_initialized = false;
|
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user