diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d5cf8de..c19d589e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed +- Fixed _Insert Piz Here_'s _midiLooper_ crashing in **REAPER** when the plugin + tries to use REAPER's [host function + API](https://www.reaper.fm/sdk/vst/vst_ext.php#vst_host) which currently isn't + supported by yabridge. We now explicitly ignore these requests. - Fixed VST2 speaker arrangement configurations returned by the plugin not being serialized correctly. No plugins seem to actually use these, so it should not have caused any issues. diff --git a/src/common/logging/vst2.cpp b/src/common/logging/vst2.cpp index cb471860..5ba012bf 100644 --- a/src/common/logging/vst2.cpp +++ b/src/common/logging/vst2.cpp @@ -322,6 +322,9 @@ std::optional opcode_to_string(bool is_dispatch, int opcode) { case audioMasterGetInputSpeakerArrangement: return "audioMasterGetInputSpeakerArrangement"; break; + case audioMasterDeadBeef: + return "0xdeadbeef"; + break; default: return std::nullopt; break; diff --git a/src/common/vst24.h b/src/common/vst24.h index b237370e..165360a5 100644 --- a/src/common/vst24.h +++ b/src/common/vst24.h @@ -89,6 +89,15 @@ */ [[maybe_unused]] constexpr int kVstProcessPrecision32 = 0; +/** + * Used by VST2 plugins in REAPER to obtain pointers to host-specific functions + * implemented by REAPER. + * + * https://www.reaper.fm/sdk/vst/vst_ext.php#vst_host + */ +[[maybe_unused]] constexpr int audioMasterDeadBeef = + static_cast(0xdeadbeef); + /** * The struct that's being passed through the data parameter during the * `effGetInputProperties` and `effGetOutputProperties` opcodes. Reverse diff --git a/src/plugin/bridges/vst2.cpp b/src/plugin/bridges/vst2.cpp index ea0a2a33..5872f963 100644 --- a/src/plugin/bridges/vst2.cpp +++ b/src/plugin/bridges/vst2.cpp @@ -147,6 +147,20 @@ Vst2PluginBridge::Vst2PluginBridge(audioMasterCallback host_callback) .value_payload = std::nullopt}; } } break; + case audioMasterDeadBeef: + logger.log(""); + logger.log( + " The plugin wants to use REAPER's host vendor " + "extensions"); + logger.log( + " which currently aren't supported by yabridge."); + logger.log(" Ignoring the request."); + logger.log(""); + + return Vst2EventResult{.return_value = 0, + .payload = nullptr, + .value_payload = std::nullopt}; + break; } return passthrough_event(&plugin, host_callback_function, diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index cd50c64e..8fed5970 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -554,6 +554,9 @@ class HostCallbackDataConverter : public DefaultDataConverter { case audioMasterUpdateDisplay: case audioMasterBeginEdit: case audioMasterEndEdit: + // NOTE: REAPER abuses the dispatcher to add their own opcodes + // outside of `audioMasterVendorSpecific` + case audioMasterDeadBeef: return nullptr; break; default: