Our investigation has identified two problems:
 
## 1. PipeWire reports success without checking RTKit’s reply.
 
The logs say “acquired realtime priority 20”, but our D-Bus capture shows RTKit 
returning org.freedesktop.DBus.Error.AccessDenied (“Operation not permitted”).
 
In Ubuntu’s PipeWire source (1.6.2-1ubuntu1.2), pw_rtkit_make_realtime() and 
pw_rtkit_make_high_priority() use dbus_connection_send() without waiting for or 
checking the reply. The caller  then logs success. This explains why the logs 
claim realtime scheduling while the audio threads remain SCHED_OTHER.
 
##  2. The initial request happens before a local graphical session exists, and 
the services do not recover automatically.
 
With Polkit debug enabled, we observed this sequence:
 
  • At 10:23:34, PipeWire, PipeWire-Pulse and WirePlumber request realtime 
scheduling.
  • Polkit cannot associate their processes with a session (nil) and denies 
authorization.
  • At 10:23:39, logind creates the user’s local graphical session.
  • After login, pkcheck authorizes both RTKit actions for the same original 
PIDs, without restarting them.
  • Nevertheless, their audio threads remain SCHED_OTHER; no automatic retry 
was observed. Restarting the services after login usually makes the threads 
SCHED_RR, priority 20.
 
The installed RTKit policy has allow_any=no, allow_inactive=yes, and 
allow_active=yes. Polkit’s initial denial therefore appears consistent with the 
policy, rather than an internal Polkit  bug.
 
We also tested explicitly starting RTKit before [email protected] using Wants= 
and After=. RTKit was ready several seconds before PipeWire, but the problem 
persisted.
 
If the user later restarts the audio services from within the graphical 
session, their audio threads almost always obtain SCHED_RR scheduling. However, 
we observed one restart where PipeWire’s audio thread remained SCHED_OTHER 
while the other two became SCHED_RR.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174841

Title:
  PipeWire audio threads do not remain in realtime scheduling after
  login

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pipewire/+bug/2174841/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to