mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
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.
This commit is contained in:
@@ -78,6 +78,9 @@ TODO: Add an updated screenshot with some fancy VST3-only plugins to the readme
|
|||||||
to realtime priority. This prevents changing the scheduling policy of your
|
to realtime priority. This prevents changing the scheduling policy of your
|
||||||
host's GUI thread if your host instantiates plugins from its GUI thread like
|
host's GUI thread if your host instantiates plugins from its GUI thread like
|
||||||
REAPER does.
|
REAPER does.
|
||||||
|
- Relaying messages printed by the plugin and Wine is now done without
|
||||||
|
realtime priority, as this could in theory cause issues with plugins that
|
||||||
|
produce a lot of fixmes.
|
||||||
- The realtime scheduling priorities of all audio threads on the Wine plugin
|
- The realtime scheduling priorities of all audio threads on the Wine plugin
|
||||||
host are now periodically synchronized with those of the host's audio
|
host are now periodically synchronized with those of the host's audio
|
||||||
threads.
|
threads.
|
||||||
|
|||||||
@@ -91,8 +91,14 @@ class PluginBridge {
|
|||||||
sockets.base_dir.string()}))),
|
sockets.base_dir.string()}))),
|
||||||
has_realtime_priority(has_realtime_priority_promise.get_future()),
|
has_realtime_priority(has_realtime_priority_promise.get_future()),
|
||||||
wine_io_handler([&]() {
|
wine_io_handler([&]() {
|
||||||
|
// We no longer run this thread with realtime scheduling because
|
||||||
|
// plugins that produce a lot of FIXMEs could in theory cause
|
||||||
|
// dropouts that way, but we still need to run this from a thread
|
||||||
|
// to check whether we support it
|
||||||
has_realtime_priority_promise.set_value(
|
has_realtime_priority_promise.set_value(
|
||||||
set_realtime_priority(true));
|
set_realtime_priority(true));
|
||||||
|
set_realtime_priority(false);
|
||||||
|
|
||||||
io_context.run();
|
io_context.run();
|
||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,13 @@ GroupBridge::GroupBridge(boost::filesystem::path group_socket_path)
|
|||||||
async_log_pipe_lines(stdout_redirect.pipe, stdout_buffer, "[STDOUT] ");
|
async_log_pipe_lines(stdout_redirect.pipe, stdout_buffer, "[STDOUT] ");
|
||||||
async_log_pipe_lines(stderr_redirect.pipe, stderr_buffer, "[STDERR] ");
|
async_log_pipe_lines(stderr_redirect.pipe, stderr_buffer, "[STDERR] ");
|
||||||
|
|
||||||
stdio_handler = Win32Thread([&]() { stdio_context.run(); });
|
stdio_handler = Win32Thread([&]() {
|
||||||
|
// In case a plugin generates a lot of FIXMEs relaying this IO with
|
||||||
|
// realtime scheduling could in theory cause latency issues
|
||||||
|
set_realtime_priority(false);
|
||||||
|
|
||||||
|
stdio_context.run();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupBridge::~GroupBridge() {
|
GroupBridge::~GroupBridge() {
|
||||||
|
|||||||
Reference in New Issue
Block a user