Failed to set scheduler settings: Operation not permitted
On Debian bookworm/sid with WirePlumber 0.4.9 from Debian package version 0.4.9-1, or with 0.4.10 built from source, when WirePlumber starts it prints:
Failed to set scheduler settings: Operation not permitted
As best I can tell, this occurs because g_system_thread_get_scheduler_settings
is called at nice -11 (presumably as a result of nice.level = -11
for libpipewire-module-rt
in wireplumber.conf
) saving it into shared_thread_scheduler_settings
.
Backtrace of `g_system_thread_get_scheduler_settings`
#0 g_system_thread_get_scheduler_settings
(scheduler_settings=scheduler_settings@entry=0x7ffff7ece028 <shared_thread_scheduler_settings>) at ../../../glib/gthread-posix.c:1190
#1 0x00007ffff7e16a7a in g_thread_get_scheduler_settings
(scheduler_settings=scheduler_settings@entry=0x7ffff7ece028 <shared_thread_scheduler_settings>) at ../../../glib/gthread.c:941
#2 0x00007ffff7e174cc in g_thread_pool_new_full
(func=func@entry=0x7ffff799da50 <g_task_thread_pool_thread>, user_data=user_data@entry=0x0, item_free_func=item_free_func@entry=0x0, max_threads=max_threads@entry=10, exclusive=exclusive@entry=0, error=error@entry=0x0)
at ../../../glib/gthreadpool.c:644
#3 0x00007ffff7e1752f in g_thread_pool_new
(func=func@entry=0x7ffff799da50 <g_task_thread_pool_thread>, user_data=user_data@entry=0x0, max_threads=max_threads@entry=10, exclusive=exclusive@entry=0, error=error@entry=0x0) at ../../../glib/gthreadpool.c:562
#4 0x00007ffff799cc2c in g_task_thread_pool_init ()
at ../../../gio/gtask.c:2184
#5 g_task_get_type_once () at ../../../gio/gtask.c:614
#6 0x00007ffff799cfcd in g_task_get_type () at ../../../gio/gtask.c:614
#7 0x00007ffff799d169 in g_task_new
(source_object=source_object@entry=0x555555572010, cancellable=cancellable@entry=0x0, callback=callback@entry=0x7ffff7f6dbb0 <invoke_closure>, callback_data=callback_data@entry=0x5555555a47f0) at ../../../gio/gtask.c:722
#8 0x00007ffff7f6f0ce in wp_core_sync_closure
(self=self@entry=0x555555572010 [WpCore], cancellable=cancellable@entry=0x0, closure=0x5555555a47f0) at ../lib/wp/core.c:941
#9 0x00007ffff7f6f2ef in wp_core_sync
(self=self@entry=0x555555572010 [WpCore], cancellable=cancellable@entry=0x0, callback=callback@entry=0x7ffff7f7e5e0 <expose_tmp_globals>, user_data=user_data@entry=0x5555555720b0) at ../lib/wp/core.c:887
#10 0x00007ffff7f7dbb7 in wp_registry_prepare_new_global
(self=self@entry=0x5555555720b0, id=id@entry=0, permissions=permissions@entry=456, flag=flag@entry=1, type=type@entry=0x55555556abd0 [WpGlobalProxy/WpProxy/WpObject], proxy=proxy@entry=0x0, props=0x7fffffffd910, new_global=0x0)
at ../lib/wp/object-manager.c:1159
#11 0x00007ffff7f7dd6a in registry_global
(data=0x5555555720b0, id=0, permissions=456, type=0x5555555f3ad0 "PipeWire:Interface:Core", version=3, props=0x7fffffffd910)
at ../lib/wp/object-manager.c:912
#12 0x00007ffff710ecaa in ()
at /usr/lib/x86_64-linux-gnu/pipewire-0.3/libpipewire-module-protocol-native.so
#13 0x00007ffff710740c in ()
at /usr/lib/x86_64-linux-gnu/pipewire-0.3/libpipewire-module-protocol-native.so
#14 0x00007ffff7107a08 in ()
at /usr/lib/x86_64-linux-gnu/pipewire-0.3/libpipewire-module-protocol-native.so
#15 0x00007ffff7521bfd in ()
at /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
#16 0x00007ffff7f6da8e in wp_loop_source_dispatch
(s=0x555555573030, callback=<optimized out>, user_data=<optimized out>)
at ../lib/wp/core.c:41
#17 0x00007ffff7debf8b in g_main_dispatch (context=0x55555556f980)
at ../../../glib/gmain.c:3417
#18 g_main_context_dispatch (context=0x55555556f980)
at ../../../glib/gmain.c:4135
#19 0x00007ffff7dec238 in g_main_context_iterate
(context=0x55555556f980, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4211
#20 0x00007ffff7dec523 in g_main_loop_run (loop=0x55555556faa0)
at ../../../glib/gmain.c:4411
#21 0x00005555555565bc in main (argc=<optimized out>, argv=<optimized out>)
at ../src/main.c:452
which it fails to restore when g_system_thread_new
is called to create a
thread pool thread for g_dbus_connection_new_for_address
.
Backtrace of `g_system_thread_new` which emits the error message
#0 g_system_thread_new
(proxy=0x7ffff7e16560 <g_thread_proxy>, stack_size=stack_size@entry=0, scheduler_settings=scheduler_settings@entry=0x7ffff7ece028 <shared_thread_scheduler_settings>, name=name@entry=0x7fffffffd9e0 "pool-wireplumbe", func=func@entry=0x7ffff7e16e20 <g_thread_pool_thread_proxy>, data=data@entry=0x5555555c79b0, error=0x7fffffffda30) at ../../../glib/gthread-posix.c:1281
#1 0x00007ffff7e16a3c in g_thread_new_internal
(name=name@entry=0x7fffffffd9e0 "pool-wireplumbe", proxy=<optimized out>, func=func@entry=0x7ffff7e16e20 <g_thread_pool_thread_proxy>, data=data@entry=0x5555555c79b0, stack_size=stack_size@entry=0, scheduler_settings=scheduler_settings@entry=0x7ffff7ece028 <shared_thread_scheduler_settings>, error=<optimized out>) at ../../../glib/gthread.c:932
#2 0x00007ffff7e1716c in g_thread_pool_start_thread
(pool=pool@entry=0x5555555c79b0, error=error@entry=0x7fffffffda30)
at ../../../glib/gthreadpool.c:477
#3 0x00007ffff7e175e3 in g_thread_pool_push
(pool=0x5555555c79b0, data=0x5555556181a0, error=error@entry=0x0)
at ../../../glib/gthreadpool.c:723
#4 0x00007ffff799cf41 in g_task_start_task_thread
(task=task@entry=0x5555556181a0 [GTask], task_func=task_func@entry=0x7ffff7935890 <async_init_thread>) at ../../../gio/gtask.c:1525
#5 0x00007ffff799de9b in g_task_run_in_thread
(task=0x5555556181a0 [GTask], task_func=0x7ffff7935890 <async_init_thread>) at ../../../gio/gtask.c:1555
#6 0x00007ffff793583d in g_async_initable_real_init_async
(initable=<optimized out>, io_priority=0, cancellable=0x55555556bd60 [GCancellable], callback=0x7ffff6004830 <on_enable_got_bus>, user_data=0x55555562afa0) at ../../../gio/gasyncinitable.c:281
#7 0x00007ffff7935cdd in g_async_initable_new_valist_async
(object_type=<optimized out>, first_property_name=0x7ffff7a48195 "address", var_args=0x7fffffffdb20, io_priority=0, cancellable=0x55555556bd60 [GCancellable], callback=0x7ffff6004830 <on_enable_got_bus>, user_data=0x55555562afa0)
at ../../../gio/gasyncinitable.c:435
#8 0x00007ffff7935d99 in g_async_initable_new_async
(object_type=<optimized out>, io_priority=io_priority@entry=0, cancellable=cancellable@entry=0x55555556bd60 [GCancellable], callback=callback@entry=0x7ffff6004830 <on_enable_got_bus>, user_data=user_data@entry=0x55555562afa0, first_property_name=first_property_name@entry=0x7ffff7a48195 "address")
at ../../../gio/gasyncinitable.c:344
#9 0x00007ffff79fb2a7 in g_dbus_connection_new_for_address
(address=address@entry=0x555555565090 "unix:path=/run/user/1000/bus", flags=flags@entry=(G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION), observer=observer@entry=0x0, cancellable=0x55555556bd60 [GCancellable], callback=callback@entry=0x7ffff6004830 <on_enable_got_bus>, user_data=user_data@entry=0x55555562afa0) at ../../../gio/gdbusconnection.c:2871
#10 0x00007ffff6004a52 in do_connect (self=0x5555555a22c0 [WpReserveDevicePlugin], callback=callback@entry=0x7ffff6004830 <on_enable_got_bus>, data=data@entry=0x55555562afa0, error=error@entry=0x7fffffffdca0) at ../modules/module-reserve-device/plugin.c:90
#11 0x00007ffff6004f45 in wp_reserve_device_plugin_enable (plugin=0x5555555a22c0 [WpReserveDevicePlugin], transition=0x55555562afa0 [WpFeatureActivationTransition]) at ../modules/module-reserve-device/plugin.c:186
#12 0x00007ffff7f96055 in wp_transition_advance (self=self@entry=0x55555562afa0 [WpFeatureActivationTransition]) at ../lib/wp/transition.h:23
#13 0x00007ffff7f794c4 in wp_object_advance_transitions (self=<optimized out>) at ../lib/wp/object.c:339
#14 0x00007ffff7debe94 in g_main_dispatch (context=0x55555556f980) at ../../../glib/gmain.c:3417
#15 g_main_context_dispatch (context=0x55555556f980) at ../../../glib/gmain.c:4135
#16 0x00007ffff7dec238 in g_main_context_iterate (context=0x55555556f980, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4211
#17 0x00007ffff7dec523 in g_main_loop_run (loop=0x55555556faa0) at ../../../glib/gmain.c:4411
#18 0x00005555555565bc in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.c:452
When the error message is printed, the newly created thread shows nice 0, rather than -11, which suggests to me that the request for nice -11 is the cause of EPERM
, resulting in the error message.
This issue is not causing any problems that I am aware of, other than the concerning error message. However, if the DBus thread pool is supposed to be at nice -11, perhaps RTKit could be used to boost its priority as well? If not, perhaps there is a way to initialize shared_thread_scheduler_settings
at nice 0?
Thanks for considering, and for maintaining WirePlumber,
Kevin