Commit Graph

61 Commits

Author SHA1 Message Date
Robbert van der Helm a1c9d0fbf5 Report a rolling minimum and maximum instead
Over the last 2048 processing cycles. Should give a better idea of the
spread.
2021-06-24 11:38:30 +02:00
Robbert van der Helm 4ff01cce6c Report the mean and max VST3 audio processing time
Every five seconds.
2021-06-24 11:38:30 +02:00
Robbert van der Helm aaf3e7438c Use unordered maps for VST3 plugin instances
The better algorithmic time complexity should help when using many (say,
hundreds) of instances of a single VST3 plugin.
2021-06-11 14:48:28 +02:00
Robbert van der Helm dec19dc12a 💥 Reimplement VST3 audio processing
In the same way as 50c25c1cf0 did it for
VST2 plugins. Input and output audio data is now stored in a shared
memory buffer instead of being sent over the sockets. This reduces the
bridging overhead to a minimum since copying data was the most expensive
operation we were doing and we now only need to copy the entire buffer
once per processing cycle.
2021-06-11 13:59:37 +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 8ba6e4a937 Noexcept qualify the VST3 proxy implementations
For the same reasons mentioned in the last commit.
2021-05-14 17:30:05 +02:00
Robbert van der Helm 671587f981 Further reduce allocations by reusing responses
On the plugin's side, still need to do a lot of work on the Wine side of
things.
2021-05-07 17:00:43 +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 8f310ed89b Rename ParameterInfoCache to be more general 2021-05-06 18:16:33 +02:00
Robbert van der Helm 6231ab7816 Reuse YaProcessData object on the plugin side
Well, kind of. This doesn't do anything yet since the default assignment
operator will just destroy and recreate objects as normal.
2021-05-06 16:34:23 +02:00
Robbert van der Helm 000fa04b7b Update documentation on VST3 function call caches
Since REAPER has now fixed the issues that lead us to implementing these
things.
2021-05-05 19:38:46 +02:00
Robbert van der Helm 62efc1c273 Also handle mutual recursion in *::getState()
VST3 plugins could freeze in REAPER when the plugin sends
`IComponentHandler::performEdit()` followed by
`IPlugFrame::resizeView()` when REAPER simultaneously tries to call
`*::getState()`. Here `*::getState()` gets called from the GUI thread,
while `IPlugFrame::resizeView()` has to be handled on REAPER's GUI
thread, resulting in a deadlock unless we use the plugin-side mutual
recursion mechanism.

I've seen this cause issues with PSPaudioware InfiniStrip.
2021-05-02 16:38:37 +02:00
Robbert van der Helm 949ddaf673 Use mutual recursion for IEditController::setState
With this we should be able to handle `setState()`s that try to resize
the currently open editor. This could pop up when using the preset
browser in REAPER with plugins that recall their old size when loading a
preset.
2021-04-30 01:15:18 +02:00
Robbert van der Helm 0f506f75e4 Bypass connection point proxies when possible
This greatly improves compatibility with VST3 plugins in Ardour and
Mixbus. Most notably the FabFilter plugins would previously freeze when
having the GUI open while duplicating or inserting new instances.
2021-04-29 15:36:28 +02:00
Robbert van der Helm 10b01b5140 Update comments on the VST3 info caches 2021-02-09 23:19:17 +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 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 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 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 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 3d8ee1ddf1 Add stubs for IParameterFunctionName 2021-01-17 13:23:17 +01:00
Robbert van der Helm aa1a7a1588 Fully implement IProgress
`IParameterFunctionName` will be the last interface before we _in
theory_ support all VST3 features.
2021-01-17 00:19:48 +01:00
Robbert van der Helm a2203cfef7 Add stubs for IProcessContextRequirements 2021-01-16 16:09:31 +01:00
Robbert van der Helm 73fda0b568 Fully implement IPlugInterfaceSupport
With this we support all VST 3.6.12 interfaces.
2021-01-16 15:19:10 +01:00
Robbert van der Helm 85c1972c1f Add stubs for IMidiLearn 2021-01-15 22:36:25 +01:00
Robbert van der Helm c485677987 Add stubs for INoteExpressionPhysicalUIMapping 2021-01-15 19:08:06 +01:00
Robbert van der Helm 1d9b60b481 Fully implement IComponentHandlerBusActivation
We now support all VST 3.6.8 features. (or technically, also all VST
3.6.10 features)
2021-01-14 16:42:19 +01:00
Robbert van der Helm ccdb121f96 Add stubs for IInfoListener 2021-01-12 16:54:13 +01:00
Robbert van der Helm 7c081b458a Add stubs for IPrefetchableSupport 2021-01-12 15:24:37 +01:00
Robbert van der Helm 5855ffbe85 Fully implement IUnitHandler2 2021-01-10 23:54:43 +01:00
Robbert van der Helm cfa1aff1bf Add stubs for IAutomationState 2021-01-10 23:32:55 +01:00
Robbert van der Helm 2072310b2b Add stubs for IXmlRepresentationController 2021-01-08 17:43:43 +01:00
Robbert van der Helm 7969ec20fd Add stubs for IKeyswitchController 2021-01-08 16:53:43 +01:00
Robbert van der Helm eed068b9f7 Add stubs for IEditControllerHostEditing 2021-01-08 16:18:45 +01:00
Robbert van der Helm 83d45eef27 Implement the plugin side of IContextMenu 2021-01-07 16:19:41 +01:00
Robbert van der Helm 9e3c57476c Implement the plugin side if IComponentHandler3 2021-01-06 22:25:23 +01:00
Robbert van der Helm dcfbc34ba1 Add stubs for IAudioPresentationLatency 2021-01-04 22:17:19 +01:00
Robbert van der Helm 9983f81875 Fully implement IComponentHandler2 2021-01-04 21:56:14 +01:00
Robbert van der Helm e980afddb4 Add stubs for IMidiMapping 2021-01-02 23:49:47 +01:00
Robbert van der Helm 8a4de7da53 Add stubs for INoteExpressionController 2021-01-02 15:27:55 +01:00
Robbert van der Helm 34f8d3b1d2 Update the copyright notices for 2021 2021-01-01 18:54:02 +01:00
Robbert van der Helm 3553b080fe Implement IUnitData
With this all VST 3.0.0 interfaces are finally supported.
2020-12-29 22:00:22 +01:00
Robbert van der Helm 22269570d0 Add stubs for IProgramListData 2020-12-29 15:53:01 +01:00
Robbert van der Helm aed369c4be Add stubs for IUnitInfo
This is a big boy.
2020-12-26 21:18:11 +01:00
Robbert van der Helm bf40e10780 Implement IUnitHandler::notifyUnitSelection 2020-12-26 14:26:29 +01:00
Robbert van der Helm fbad4a65ab Add an IConnectionPoint proxy implementation
We still have to pass this proxy to the plugin. That's next.
2020-12-25 13:46:03 +01:00
Robbert van der Helm 656f6d3f6c Implement IPlugFrame::resizeView()
The base IPlugFrame only contains this single function.
2020-12-22 15:09:33 +01:00
Robbert van der Helm 3bc3409929 Keep track of the last created plugin view
For implementing `IPlugView::resizeView()`. This approach is safe
because there's only a single defined view type.
2020-12-22 14:27:56 +01:00
Robbert van der Helm b422f6fd42 Don't cache IComponent::getControllerClassId()
For the same reasons as the last commit. Now we don't have any of these
cached methods anymore.
2020-12-19 18:56:47 +01:00