Commit Graph

530 Commits

Author SHA1 Message Date
Robbert van der Helm 087d5a6f87 Remind ourselves that we somehow survived 2020 2021-06-09 16:48:27 +02:00
Robbert van der Helm 53e4fa369f Bump to version 3.3.1 2021-06-09 16:36:02 +02:00
Robbert van der Helm 19e78e22b5 Reword changelog 2021-06-09 16:36:02 +02:00
Robbert van der Helm 70d18edce2 Fix version strings when building from tarball
When that tarball has been extracted in an (unrelated) git repository.
2021-06-09 16:19:01 +02:00
Robbert van der Helm 6fd31168d8 Reword changelog 2021-06-09 12:41:07 +02:00
Robbert van der Helm 7c9cd7b9e5 Fix uninitialized timed caches
This could prevent resizeable plugins from being resizeable in Ardour if
the initialized timestamp just happened to be greater than the current
time, since the returned result would then likely be some invalid value.
2021-06-09 12:31:03 +02:00
Robbert van der Helm fb1eefa880 Reorder changelog 2021-06-09 12:21:13 +02:00
Robbert van der Helm 65c05aac88 Indicate cached IPlugView::canResize() calls
We apparently forgot to pass the flag here after implementing it in the
log function.
2021-06-09 12:07:29 +02:00
Robbert van der Helm da5f6e9e7d Always initialize Microsoft COM unconditionally 2021-06-07 22:24:48 +02:00
Robbert van der Helm a7496fae77 Add thread names 2021-06-06 23:45:47 +02:00
Robbert van der Helm 974951e966 Translate mouse coordinates from Wine window
Instead of the parent Window. Tracktion Waveform does some weird things
with its VST2 editor embedding, so with the old approach this would
cause mouse clicks to be offset 27 pixels vertically and one pixel
horizontally.
2021-06-05 11:32:24 +02:00
Robbert van der Helm 7228d49507 Bump to version 3.3.0 2021-06-03 17:35:45 +02:00
Robbert van der Helm e8a0a66a53 Reword the changelog, again 2021-06-03 17:35:45 +02:00
Robbert van der Helm 2be6388830 Reword the changelog 2021-06-03 14:29:28 +02:00
Robbert van der Helm 712ef41a7f Make realtime scheduling less aggressive
On the Wine side. Instead of always having it enabled and disabling it
when it could potentially hurt (i.e. when handling GUI related things),
we'll now only enable it when it's potentially beneficial. This way we
don't have to constantly switch scheduling policies on the GUI thread.
2021-06-01 16:21:38 +02:00
Robbert van der Helm 5f4ffed90b Prevent allocations in Vst3Logger::log_query_interface
String constants will be converted to `std::string` because it's not
constexpr yet, and that will allocate for longer strings. Since this
function only prints something when `YABRIDGE_DEBUG_LEVEL` is set to 2
or higher that seems like a waste.
2021-05-31 18:07:19 +02:00
Robbert van der Helm 6a047497bc Only print query interface messages on log level 2 2021-05-31 17:44:43 +02:00
Robbert van der Helm 511aa14700 [yabridgectl] Fix reporting of new VST3 plugins
When yabridgectl sets up both a VST3 bundle containing both a 32-bit and
a 64-bit plugin. The libyabridge.so file already existed, so the
reported number was always off.
2021-05-31 17:05:34 +02:00
Robbert van der Helm db0f58d000 Fix the changelog entry for the plugin group fix
This of course happens for any VST2 plugin, not just multiple instances
of the same plugin.
2021-05-30 02:17:46 +02:00
Robbert van der Helm 27c96135cb Fix thread safety issue with VST2 plugin groups
While a VST2 plugin is being initialized in a plugin group, all host
callbacks would go over that new plugin instance's sockets. This would
cause a race condition if the host processes audio while loading
plugins. This issue has been there since the introduction of plugin
groups, but it's only noticeable in Bitwig Studio, and only when using
over thirty instances of the same plugin in a plugin group.
2021-05-30 02:06:52 +02:00
Robbert van der Helm 68d5d33cba Add a warning for low RLIMIT_RTTIME values
This will make it much easier to spot issues caused by PipeWire.
2021-05-27 14:22:58 +02:00
Robbert van der Helm d610c07e11 Enable mutual recursion on effGetProgramName()
PG-8X in REAPER has the same mutual recursion limitation the Voxengo
plugins had in Renoise, but with `effGetProgramName()` instead of
`effGetProgram()`.
2021-05-23 19:00:16 +02:00
Robbert van der Helm 0b9b1330ad Make sure effProcessEvents() also never allocates
This basically changes the default small vectors during VST2 event
processing from 256 bytes to the size of a `DynamicVstEvents`
object (which also includes a small_vector to hold MIDI events without
allocating) and makes them thread local. We already have a similar
optimization for VST3. There it's a bit neater since we already had to
separate audio processing functions from non-time critical functions.
Here we don't have that separation, so we just made these buffers thread
local, large enough to hold our predefined number of events, and we then
just shrink them to fit if these buffers grow even more (which can only
happen after reading or writing chunk data).

The change doesn't specifically target `effProcessEvents()`, but that's
where you would see the differences. This is also relevant for
`audioMasterProcessEvents()`.
2021-05-23 17:37:09 +02:00
Robbert van der Helm 29e0a0fd36 Reuse VST2 audio processing buffers on Wine side
Just like we made similar changes on the plugin side a few commits ago
to prevent allocations there.
2021-05-23 16:37:01 +02:00
Robbert van der Helm d2965e048d No longer zero out VST3 audio buffers
Apparently we also never did this for VST2 plugins, so this should be
safe. Filling the vectors with zeroes here had a non-negligible
performance impact according to perf.
2021-05-23 15:55:29 +02:00
Robbert van der Helm 8429919dfe Reuse VST2 audio processing buffers on plugin side 2021-05-23 15:25:36 +02:00
Robbert van der Helm 4e81c1c2b3 Reuse request on Wine side during VST2 processing
The object was constantly being recreated, resulting in memory
allocations caused by creating and destroying the audio buffer vectors.
2021-05-23 15:02:53 +02:00
Robbert van der Helm 6f321649c4 Do small vector optimization for all communication
I once read years ago somewhere on Stack Overflow that `std::vectors`
with that are preinitialized to a default size would allocate the
initial capacity on the stack. This of course doesn't make any
sense (run time sized stack allocations can cause all kinds of issues),
so we were still allocating with our default 64-byte sized buffers, but
just not as often.
2021-05-23 14:43:02 +02:00
Robbert van der Helm 4e289348c2 Clarify the VST3 mutual recursion change 2021-05-23 13:49:38 +02:00
Robbert van der Helm df93944f3b Prevent allocations caused by Logger::log_trace
C++ would always construct an `std::string` from the string constant
every iteration. Since this also happened when `YABRIDGE_DEBUG_LEVEL` is
not set to 2, this ended up causing unnecessary allocations.
2021-05-23 00:21:21 +02:00
Robbert van der Helm e700678a11 Also preallocate small buffers for VST2 events 2021-05-23 00:10:03 +02:00
Robbert van der Helm da8f4aae19 Preallocate small vectors for VST3 queues
Events, parameter changes, and the individual queues contained within
the parameter changes all use dynamic memory allocation. Preallocating
some memory for those things inside of the objects may prevent latency
spikes when they those objects are first filled. This is especially
useful for the parameter changes since there's no way to reserve memory
in a vector of vectors.
2021-05-22 23:38:31 +02:00
Robbert van der Helm 7c49fe739d Use our new custom std::variant bitsery extension
This prevents reinitializing `std::variant`s when the variant we want to
deserialize is already active. We store audio buffers in variants, so
reinitializing them results in a lot of unnecessary memory frees,
allocations and writes during every processing cycle.
2021-05-22 17:51:01 +02:00
Robbert van der Helm a96cfc8090 Allow mutual recursion between audioMasterUpdateDisplay and effGetProgram
This prevents Voxengo VST2 plugins from freezing in Renoise when
recalling their state. See the comments in the diff for why this is
necessary.
2021-05-20 15:28:00 +02:00
Robbert van der Helm e5bfb56756 Mention the disable_pipes option in the changelog
I somehow forgot to do this in the last commit.
2021-05-18 22:57:41 +02:00
Robbert van der Helm 883b6b7700 Manually close descriptors instead of using vfork
With `vfork()` the child process inherits the parents process image and
prevents copying them, but if it outlives its parent then the file
descriptors will still remain open. Manually closing all file
descriptors is the only solution here.

This was only an issue with Ardour since they don't open all of their
files with `FD_CLOEXEC`. Last update's watchdog timer somewhat mitigated
the issue, but Ardour should now no longer freeze when reopening because
of this. The watchdog timer is still necessary, since hanging Wine
processes will still prevent the Wine server from shutting down.
2021-05-16 15:28:53 +02:00
Robbert van der Helm 448243050a Always serialize in little-endian and skip checks
These checks are not necessary since we can trust ourselves to not try
to cause any buffer overflows.
2021-05-16 13:15:14 +02:00
Robbert van der Helm 37d706df63 Handle mutual recursion on plugin side globally
This makes much more sense, since all plugin instances will be sharing a
single GUI thread. What would happen was that resize calls from one
instance and GUI thread function calls from another instance would
collide. Using a single shared mutual recursion mechanism (just like on
the Wine side) fixes this.
2021-05-16 01:17:04 +02:00
Robbert van der Helm 70a546d160 Handle setting channel infos as mutually recursive
This was causing a timing issue with DMG plugins where the plugins would
try to resize after receiving new state (and not during the call), while
REAPER at the same time would try to set channel context information on
the plugin (which also has to be handled on the GUI thread).
2021-05-15 23:47:07 +02:00
Robbert van der Helm 171d8facee [yabridgectl] Improve the Wine check warning
This can also fail if you're using a version of yabridge that was
compiled against more recent libraries.
2021-05-15 23:03:23 +02:00
Robbert van der Helm 52cbc35867 [yabridgectl] Downgrade textwrap again
Partially reverts f02b9e646b. Newer
versions don't take the indentation into account when wrapping.
2021-05-15 22:47:06 +02:00
Robbert van der Helm 5577c4bfd8 Fix build on Wine 6.8 #103
Wine dropped `WINE_NOWINSOCK`, so now we sadly have to define this
globally instead.
2021-05-11 02:27:38 +02:00
Robbert van der Helm fcaac219a6 💥 Reduce allocations in VST3 audio sockets
We do this by using this new `MessageReference<T>` type to avoid copying
our `YaAudioProcessor::Process` struct and the contained `YaProcessData`
object. This is only part of the work, but this redesign lets us keep
the these objects alive on both the plugin and the host side. On the
plugin side, we'll simply serialize the data from the referred to object
without copying it. On the Wine side, we'll write the data to a
persistent thread local object, and then reassign the
`MessageReference<T>` to point to that object. This lets us serialize
'references', thus avoiding potentially expensive allocations. With
these last few changes alone VST3 plugins are already at the same
performance level as our optimized VST2 plugin groups.
2021-05-07 16:32:08 +02:00
Robbert van der Helm b6f96fc920 Cache IAudioProcessor::canProcessSampleSize() 2021-05-06 18:32:46 +02:00
Robbert van der Helm 9424c36993 Temporarily memoize IPlugView::canResize()
This makes VST3 plugin resizing more responsive, because this function
would otherwise be constantly running in lockstep from the GUI thread.
2021-05-05 19:44:44 +02:00
Robbert van der Helm 2c33048137 Mark the 3.2.0 release in the changelog
I somehow forgot about this.
2021-05-05 19:38:46 +02:00
Robbert van der Helm 018ad5293e Reword the changelog once more
It's always fun how you keep finding more spelling mistakes every time
you read something.
2021-05-03 13:06:23 +02:00
Robbert van der Helm a9b8225705 Reword the changelog
All entries with a longer explanation now also say what they do in the
first line, for if you don't want to read the entire thing.
2021-05-02 23:07:14 +02:00
Robbert van der Helm a9f9691b42 Don't copy any VST3 state preamble
Bitwig prepends some data when passing an `IBStream*` to the plugin, and
when we do copy it iZotope Rx7 plugins cannot load their state (even if
we also copy over the same seek position). Not copying that preamble
fixes the issue, and it seems like it doesn't break anything.
2021-05-02 22:00:53 +02:00
Robbert van der Helm dc37f03613 Fix styling in changelog 2021-05-02 21:58:34 +02:00