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
This commit is contained in:
Robbert van der Helm
2021-01-23 15:05:03 +01:00
parent 96511ca8a3
commit f03b9b1497
7 changed files with 58 additions and 8 deletions
+7
View File
@@ -159,6 +159,13 @@ class Vst2PluginBridge : PluginBridge<Vst2Sockets<std::jthread>> {
*/
std::vector<uint8_t> process_buffer;
/**
* We'll periodically synchronize the Wine host's audio thread priority with
* that of the host. Since the overhead from doing so does add up, we'll
* only do this every once in a while.
*/
time_t last_audio_thread_priority_synchronization = 0;
/**
* The VST host can query a plugin for arbitrary binary data such as
* presets. It will expect the plugin to write back a pointer that points to