From 40db445f3d9bae01e45be8ec1c69ddab6a7a5bb9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 8 Feb 2020 22:47:18 +0100 Subject: [PATCH] rtkit: actually wake up the thread to set rt priority Wake up the eventfd in the data thread to actually request the realtime priority. --- src/modules/module-rtkit.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/module-rtkit.c b/src/modules/module-rtkit.c index b4f21d13f..7aae642da 100644 --- a/src/modules/module-rtkit.c +++ b/src/modules/module-rtkit.c @@ -457,8 +457,10 @@ static void idle_func(struct spa_source *source) #endif system_bus = pw_rtkit_bus_get_system(); - if (system_bus == NULL) + if (system_bus == NULL) { + pw_log_warn("could not get system bus: %s", strerror(errno)); return; + } rl.rlim_cur = rl.rlim_max = rttime; if ((r = setrlimit(RLIMIT_RTTIME, &rl)) < 0) @@ -476,9 +478,9 @@ static void idle_func(struct spa_source *source) } if ((r = pw_rtkit_make_realtime(system_bus, 0, rtprio)) < 0) { - pw_log_debug("could not make thread realtime: %s", spa_strerror(r)); + pw_log_warn("could not make thread realtime: %s", spa_strerror(r)); } else { - pw_log_debug("thread made realtime"); + pw_log_info("processing thread made realtime"); } pw_rtkit_bus_free(system_bus); } @@ -525,6 +527,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) } spa_loop_add_source(impl->loop, &impl->source); + spa_system_eventfd_write(system, impl->source.fd, 1); pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);