Bug 753527

Summary: Pulseaudio does not obtain realtime scheduling from (updated) rtkit, causing audio dropouts
Product: [openSUSE] openSUSE 12.1 Reporter: Holger Arnold <holgerar>
Component: SoundAssignee: Takashi Iwai <tiwai>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 12.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Holger Arnold 2012-03-22 09:54:08 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

When playing audio, I get dropouts or small delays every few seconds.  This becomes even more noticeable when there are other tasks running on the system that schedule activity in regular intervals (video player, text editor).

This problem is caused by pulseaudio's failing to obtain SCHED_RR scheduling from rtkit.

Since the version of rtkit in 12.1 already fails to obtain SCHED_RR policy for itself (see bnc 732906 and bnc 551777), I have updated rtkit to version 0.10.  This version correctly obtains the SCHED_RR|SCHED_RESET_ON_FORK scheduling policy with priority 99.  All pulseaudio threads, however, still use SCHED_OTHER policy with priority 0.

I verified that pulseaudio's scheduling policy is actually the cause of my audio problems by setting an rtprio limit for the audio group in /etc/security/limits.conf and adding my user to this group.  This enables pulseaudio to get RR scheduling without rtkit.

Reproducible: Always

Steps to Reproduce:
1. On openSUSE 12.1, update rtkit to version 0.10 (for example, using the version in factory); reboot.
2. Check pulseaudio's scheduling policy and priority (chrt -p -a $(pgrep pulse)).
Actual Results:  
All pulseaudio threads have SCHED_OTHER policy and priority 0.

Expected Results:  
Some pulseaudio threads have SCHED_RR policy (and priority 5 or so).

Before I get the "but audio works fine on most systems, why do we need realtime?" comments: yes, this is a rather old machine; moreover, it's a Pentium M, which means that I cannot use the desktop kernel since this kernel requires PAE.
Comment 1 Holger Arnold 2012-03-23 20:56:39 UTC
This problem is caused by the too restrictive PolicyKit settings for rtkit and pulseaudio.  See bnc 753849.
Comment 2 Takashi Iwai 2012-03-26 09:55:15 UTC
Right.  Apart from rtkit being brokgn 12.1, we can fix it better for 12.2...

*** This bug has been marked as a duplicate of bug 753849 ***