mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 20:40:11 +02:00
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:
@@ -555,6 +555,15 @@ struct AudioBuffers {
|
||||
*/
|
||||
int sample_frames;
|
||||
|
||||
/**
|
||||
* We'll periodically synchronize the realtime priority setting of the
|
||||
* host's audio thread with the Wine plugin host. We'll do this
|
||||
* approximately every ten seconds, as doing this getting and setting
|
||||
* scheduler information has a non trivial amount of overhead (even if it's
|
||||
* only a single microsoecond).
|
||||
*/
|
||||
std::optional<int> new_realtime_priority;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.ext(
|
||||
@@ -572,5 +581,8 @@ struct AudioBuffers {
|
||||
},
|
||||
});
|
||||
s.value4b(sample_frames);
|
||||
|
||||
s.ext(new_realtime_priority, bitsery::ext::StdOptional{},
|
||||
[](S& s, int& priority) { s.value4b(priority); });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user