From 58c687f9d7c70945912360d08e04ea219f350e74 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 22 Jan 2021 00:38:44 +0100 Subject: [PATCH] Revert "Don't override existing host thread priorities" This reverts commit 9b0324f4a7bf020257704ad1909dfda97eca6847. Since the plugin is initialized from the GUI thread, this doesn't make any sense. --- CHANGELOG.md | 2 -- src/common/utils.cpp | 12 +----------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9afb8fc5..aa8eeedd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,8 +75,6 @@ TODO: Add an updated screenshot with some fancy VST3-only plugins to the readme priority. This should get rid of any latency spikes during those operations, as this could otherwise steal resources away from the threads that are processing audio. -- Yabridge no longer overrides the host's scheduling priorities if the thread - yabridge is being hosted from is already using realtime scheduling. - When `YABRIDGE_DEBUG_LEVEL` is set to 2 or higher and a plugin asks the host for the current position in the song, yabridge will now also print the current tempo to help debugging host bugs. diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 3e1d073b..79c35178 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -32,17 +32,7 @@ fs::path get_temporary_directory() { } bool set_realtime_priority(bool sched_fifo) { - // If we're already using SCHED_FIFO then this is likely set by the host, - // and we should not make any additional changes - if (sched_fifo) { - sched_param current_params{}; - if (sched_getparam(0, ¤t_params) == 0 && - current_params.sched_priority > 0) { - return true; - } - } - - sched_param params{.sched_priority = (sched_fifo ? 5 : 0)}; + sched_param params{.sched_priority = 5}; return sched_setscheduler(0, sched_fifo ? SCHED_FIFO : SCHED_OTHER, ¶ms) == 0; }