Set realtime priorities if available

This significantly reduces the latency with no real drawbacks from what
I've noticed. Wineserver is still run using the normal scheduling
policies because from my testing running that with realtime priority
that can actually increase latencies, although doing so will greatly
reduce the variance in processing time.
This commit is contained in:
Robbert van der Helm
2020-07-23 19:55:22 +02:00
parent 9d33b9989e
commit 6f5dae90a6
9 changed files with 83 additions and 4 deletions
+4 -1
View File
@@ -17,10 +17,11 @@
#include <iostream>
#include <thread>
// Generated inside of build directory
// Generated inside of the build directory
#include <src/common/config/config.h>
#include <src/common/config/version.h>
#include "../common/utils.h"
#include "bridges/vst2.h"
using namespace std::literals::chrono_literals;
@@ -45,6 +46,8 @@ void async_handle_events(boost::asio::steady_timer& timer, Vst2Bridge& bridge);
* Wine 5.7: https://bugs.winehq.org/show_bug.cgi?id=49138
*/
int __cdecl main(int argc, char* argv[]) {
set_realtime_priority();
// We pass the name of the VST plugin .dll file to load and the Unix domain
// socket to connect to in plugin/bridge.cpp as the first two arguments of
// this process.