Commit Graph

1600 Commits

Author SHA1 Message Date
Robbert van der Helm c1b23b90a2 [yabridgectl] Expand libyabridge* auto detection
There are no yabridge packages for Debian and Fedora based distros, but
we'll now also search through the paths used there.
2021-02-06 21:09:30 +01:00
Robbert van der Helm 391206eea8 Work around incorrect wchar_t text serialization
`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.
2021-02-02 15:43:53 +01:00
Robbert van der Helm 81d401f06a Add mutexes for the VST3 data caches
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.
2021-01-30 23:26:57 +01:00
Robbert van der Helm 27370ab54b Remove debug prints 2021-01-30 23:11:25 +01:00
Robbert van der Helm b5dd806b2d Cache VST3 parameter information
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.
2021-01-30 22:24:05 +01:00
Robbert van der Helm 8bba5d8773 Mention that REAPER's bridges should be disabled
This can absolutely destroy performance when using VST3 plugins. REAPER
also does something similar with bus information from the audio
thread (for which we had to build in a caching layer), but with these
plugin bridges a VST3 plugin will quickly use ten times as much CPU time
as it should be using.
2021-01-30 19:49:05 +01:00
Robbert van der Helm 68bf2029b3 Fix type of X11 event mask 2021-01-30 16:38:08 +01:00
Robbert van der Helm fc3c3524fd Hide IAudioProcessor::getLatencySamples in logs
On verbosity level 1
2021-01-30 16:11:29 +01:00
Robbert van der Helm fb7531d74b Greatly clean up the input focus grabbing
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.
2021-01-30 15:40:24 +01:00
Robbert van der Helm 1043776e52 Differentiate between cached values in logs
If it turns out we forgot to flush this cache in some place.
2021-01-30 13:56:58 +01:00
Robbert van der Helm 68e10cd24c Flush the bus info cache in more places
The current approach 'works', but better err on the safe side. Once this
caching layer is no longer necessary we should just remove it.
2021-01-30 13:48:42 +01:00
Robbert van der Helm 0adca3e33c Revert "Remove cache_time_info and always cache time info"
This reverts commit cfb171c991.

No idea why, but this cache breaks SPL Transient Designer Plus. Perhaps
it overwrites the time info?
2021-01-30 02:37:27 +01:00
Robbert van der Helm 9858db25d2 Show IComponent::getBusCount on verbosity level 1
The only reason this was hidden is because REAPER spams it, but it also
spams `IComponent::getBusInfo` which we cannot hide.
2021-01-30 01:51:14 +01:00
Robbert van der Helm 10b7930779 Also clear bus cache on IAudioProcessor::setActive
Now we need a workaround for our REAPER workaround because REAPER
doesn't follow the audio processing workflow diagram, amazing!
2021-01-30 01:42:20 +01:00
Robbert van der Helm 6339618984 Fix response logging filtering with bus info cache
The response logging wasn't getting filtered.
2021-01-30 00:45:45 +01:00
Robbert van der Helm cfb171c991 Remove cache_time_info and always cache time info
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.
2021-01-30 00:20:35 +01:00
Robbert van der Helm f5b4a28bd0 Cache bus information during processing
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.
2021-01-30 00:02:06 +01:00
Robbert van der Helm 3f7f67fc2d Get rid of no longer used mutex
This was left over from a very early version of yabridge. It's not
needed since we have to initialize all VST2 plugins from the same thread
anyways.
2021-01-28 23:45:44 +01:00
Robbert van der Helm 62ab9a1c1a Reword comment
Forgot to add this to the last commit.
2021-01-27 21:01:34 +01:00
Robbert van der Helm 6e5ea3a4d8 Skip event loop with partially initialized plugins
This should prevent T-RackS 5 from potentially stalling indefinitely
when using plugin groups.
2021-01-27 19:23:21 +01:00
Robbert van der Helm 72e29d044a Add a function for temporarily blocking event loop
This can be used to prevent the Win32 message loop from running while
there are plugins in some partially initialized state.
2021-01-27 19:00:11 +01:00
Robbert van der Helm 04d0ff0949 Fix serializing silence flags
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!
2021-01-26 23:59:56 +01:00
Robbert van der Helm cf9ae47f99 Return kNotImplemented with vst3_no_scale
Ever since 0bed2b7bc0 REAPER will randomly
not play back one or more audio channels for plugins that support
IPlugViewContentScaleSuport. If you return `kNotImplemented` then this
bug doesn't occur. REAPER should definitely fix this soon. With
`kResultFalse` this issue still occurs, hence this change so you can use
`vst3_no_scale` to work around this REAPER bug.
2021-01-26 22:49:00 +01:00
Robbert van der Helm 2c7fd94f3b Add a TODO for inhibiting the event loop
During the early steps of plugin initialization.
2021-01-26 15:43:10 +01:00
Robbert van der Helm ffe46e225c Relay Wine STDIO with SCHED_OTHER
I haven't seen this cause issues myself, but it would not surprise me if
a plugin that produces a constant stream of FIXMEs would steal resources
from audio processing if the threads that are relaying those messages
are set to SCHED_FIFO.
2021-01-24 17:02:56 +01:00
Robbert van der Helm 19fd99b58e Get rid of old fixmes related to the CID migration 2021-01-24 16:55:11 +01:00
Robbert van der Helm 21ff906bf8 Handle connection point proxy from GUI thread
FabFilter plugins will exchange messages that have to be handled from
the GUI thread, or they'll get stuck waiting on a synchronisation
object. This probably hurts GUI performance significantly but luckily it
only affects Ardour.
2021-01-24 15:42:25 +01:00
Robbert van der Helm 77414c80d6 Allow null pointers in IEditController::setComponentHandler 2021-01-24 14:51:18 +01:00
Robbert van der Helm 0044bc6b60 Allow passing null pointers to IPlugView::setFrame 2021-01-24 14:44:42 +01:00
Robbert van der Helm d5e4424463 Also sync VST3 audio thread scheduling priorities
The exact same thing as the last commit, but for VST3 plugins.
2021-01-23 15:22:10 +01:00
Robbert van der Helm f03b9b1497 Sync VST2 audio thread scheduling priorities
We'll periodically copy the scheduling priorities from the host's audio
threads to the Wine plugin host's audio threads. The overhead of doing
this is about 1 microsecond on my system, so doing this every cycle
really adds up. But getting the Unix epoch time and comparing some
timestamps has a neglegible overhead, so this should give you the best
of both worlds.

Next we'll do the same thing for VST3 plugins.

As suggested by @jhernberg
2021-01-23 15:14:52 +01:00
Robbert van der Helm 96511ca8a3 Make realtime priority setting more granular
On the plugin side.
2021-01-23 14:43:06 +01:00
Robbert van der Helm 33dd469d36 Allow setting different priorities than 5 2021-01-23 14:24:01 +01:00
Robbert van der Helm 7c636ffcb1 Mention issues caused by 32-bit prefixes 2021-01-23 12:24:30 +01:00
Robbert van der Helm 91d0b405ec Add a migration script for Renoise
Now all migration scripts are done.
2021-01-22 22:51:08 +01:00
Robbert van der Helm 34136dd9cc Fix the class ID conversion in plugin factory
This is what you get for mindlessly copy-pasting.
2021-01-22 21:49:45 +01:00
Robbert van der Helm 52b723ef7d Add a migration script for Ardour 2021-01-22 21:29:35 +01:00
Robbert van der Helm e171881666 Mention how to download and run migration scripts 2021-01-22 20:27:42 +01:00
Robbert van der Helm 4e21cdb89b Add a migration script for Bitwig
This sadly has to be a semi-manual process, but at least it works!
2021-01-22 20:16:25 +01:00
Robbert van der Helm dfb9d18aa3 Add a class ID migration script for REAPER 2021-01-22 19:39:23 +01:00
Robbert van der Helm 0bba724cf9 Add a readme for the class ID conversion scripts 2021-01-22 14:55:29 +01:00
Robbert van der Helm 1b804bd5ea 💥 Convert between UID formats for class IDs
This is a breaking change. Old projects containing VST3 plugins running
through yabridge will no longer work without modifications. I'll write
some scripts to convert the class IDs stored in those project files soon
a migration path.

The UIDs reported by the plugin were apparently wrong, which meant that
the native Linux VST3 version of plugin X and the normal Windows VST3
version of plugin X used different class ideas than the Windows VST3
version of plugin X running through yabridge. Those things are supposed
to be compatible, so we sadly needed to make this change at some point.
2021-01-22 14:24:40 +01:00
Robbert van der Helm 4f4f455f13 Add a todo for a failsafe for the socket cleanup 2021-01-22 14:18:21 +01:00
Robbert van der Helm d3d57a3fe0 Use UID conversion for GetControllerClassId 2021-01-22 14:13:27 +01:00
Robbert van der Helm ae0d7263b8 Use UID conversion for IsPlugInterfaceSupported
I assume that this would also be necessary here, right?
2021-01-22 13:50:06 +01:00
Robbert van der Helm 4a5c961b63 Get rid of unused bitsery FUID extension
This would need a UID conversion to be safe anyway, so it's better to
just get rid of it.
2021-01-22 13:47:11 +01:00
Robbert van der Helm 249b82f846 Add conversions for the garbled UIDs
We'll need this to make sure the reported class IDs match up with the
actual IDs.
2021-01-22 13:47:11 +01:00
Robbert van der Helm 29410e3992 Add fixmes for incorrect byte orders
As pointed out on the Discord. Fixing this will require a breaking
change, but right we report incorrect plugin IDs meaning that projects
saved under Windows cannot be opened under Linux with yabridge so this
really needs a fix.
2021-01-22 01:28:25 +01:00
Robbert van der Helm 4812757f1a Add a function for getting the current priority 2021-01-22 00:44:43 +01:00
Robbert van der Helm 58c687f9d7 Revert "Don't override existing host thread priorities"
This reverts commit 9b0324f4a7.

Since the plugin is initialized from the GUI thread, this doesn't make
any sense.
2021-01-22 00:38:44 +01:00