Add compatibility option to force flushing to zero

This prevents Kush Audio REDDI from taking down the DAW when the host
passes it denormalized audio to process. I've discovered that the issue
with this plugin had to do with denormals in the issue linked below, but
I didn't realize that we can just enable the FTZ flag for plugins that
don't already do so.

https://github.com/osxmidi/LinVst/issues/174
This commit is contained in:
Robbert van der Helm
2021-04-27 23:33:50 +02:00
parent 3aac8e3483
commit 2be41da9b6
8 changed files with 51 additions and 3 deletions
+6
View File
@@ -180,6 +180,12 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
sockets.host_vst_process_replacing.receive_multi<AudioBuffers>(
[&](AudioBuffers request, std::vector<uint8_t>& buffer) {
// HACK: When a plugin doesn't handle denormals properly, we can
// force the FTZ flag to be set to work around this
std::optional<ScopedFlushToZero> ftz_guard =
config.force_ftz ? std::make_optional<ScopedFlushToZero>()
: std::nullopt;
// As suggested by Jack Winter, we'll synchronize this thread's
// audio processing priority with that of the host's audio
// thread every once in a while
+8
View File
@@ -1211,6 +1211,14 @@ size_t Vst3Bridge::register_object_instance(
},
[&](YaAudioProcessor::Process& request)
-> YaAudioProcessor::Process::Response {
// HACK: When a plugin doesn't handle denormals
// properly, we can force the FTZ flag to be set
// to work around this
std::optional<ScopedFlushToZero> ftz_guard =
config.force_ftz
? std::make_optional<ScopedFlushToZero>()
: std::nullopt;
// As suggested by Jack Winter, we'll synchronize this
// thread's audio processing priority with that of the
// host's audio thread every once in a while