This is embarrassing. Because the bus index was not being serialized,
all lookups were done for the bus with index 0. This meant that
sidechaining in Renoise didn't work because Renoise only allows
sidechaining to `kAux` busses and the first bus is always marked as
`kMain`. This would also cause Ardour to crash or freeze more often then
it should because while it does not support arbitrary bus I/O
configurations, it does support plugins with both a `kMain` and a `kAux`
input bus but since we would never get `kAux` busses Ardour just didn't
pass any buffers for the sidechain input.
If `yabridge-host.exe` were somehow to be run with a socket base
directory that's not inside of `$XDG_RUNTIME_DIR`/`/tmp`, then we'll now
warn instead of removing that directory. This should not be necessary,
but in case someone wants to write a wrapper around
`yabridge-host.exe.so` us using a custom `$WINELOADER` then this could
save a lot of headaches.
There is some sort of memory corruption going on and these plugins
usually segfault on the audio thread. I'm clueless as to what could be
causing this (I wouldn't be surprised if this is caused by an
interaction between the VST3 SDK and Wine's Windows.h implementation),
but it's probably best to disable loading 32-bit VST3 plugins completely
until this has been fixed.
Or technically, two, since the group bridge also does the same loop. We
no longer need special handling for VST2 and VST3 plugins, so we can
simplify things a bit here.
Even though the interface ID is passed as an FIDString and there is a
function to compare FIDStrings obviously doesn't mean that you're
supposed to use them! Duh.
`std::char_traits<wchar_t>::length()` would return the wrong length for
a wide string under Wine, and thus also for `String128`. This would
cause parts of the strings to get cut off. As a workaround we'll just
serialize the entire container including all null bytes at the end.
Since the restart will always be called from another thread, and when a
plugin asks for a restart during initialization this can quickly lead to
issues.
This is in some cases needed to get decent performance in REAPER, as
REAPER seems to query this information (which cannot change without the
plugin requesting a restart) four times per second.
In commit 9788f21e0e we changed the input
focus grabbing to only grab focus once per event cycle, because
otherwise Bitwig would fight over who was getting focus. This is a bit
hacky, and with this approach you could in theory still have an
unnecessary focus grab 60 times per second (i.e. the default event
polling rate). Now we instead check the current focus target, and only
request focus when it's actually necessary.
It sort of goes against yabridge's principles to not do these
unnecessary `audioMasterGetTime()` calls if the plugin does that, but it
also hurts the user experience to not have this as a default.
This works around an issue with REAPER. During every processing cycle
REAPER would query how many input and output busses we have, and it
would then enumerate over all of those busses. This meant that if a VST3
plugin has 32 output busses, then REAPER will do 34 extra function calls
before processing audio.
We didn't initialize the field, and we also didn't copy the updated
value back (since everything else is a pointer to the original data).
This fixes audio channels in REAPER randomly being silence, as this
field would otherwise be uninitialized.
Thanks a lot to @kytdkut for finding this issue!