rtkit: actually wake up the thread to set rt priority

Wake up the eventfd in the data thread to actually request the
realtime priority.
This commit is contained in:
Wim Taymans 2020-02-08 22:47:18 +01:00
parent 087448ff0f
commit 40db445f3d

View file

@ -457,8 +457,10 @@ static void idle_func(struct spa_source *source)
#endif #endif
system_bus = pw_rtkit_bus_get_system(); 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; return;
}
rl.rlim_cur = rl.rlim_max = rttime; rl.rlim_cur = rl.rlim_max = rttime;
if ((r = setrlimit(RLIMIT_RTTIME, &rl)) < 0) 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) { 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 { } else {
pw_log_debug("thread made realtime"); pw_log_info("processing thread made realtime");
} }
pw_rtkit_bus_free(system_bus); 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_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); pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);