pulseaudio 0.9.11 ppa Luke real-time/high-priority scheduling not working

Bug #265010 reported by Achim on 2008-09-05
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: pulseaudio

Real-time/high-priority scheduling is not working, I thought this is what we want to test with the new pulseaudio 0.9.11.

$ pulseaudio --start -vvv
D: main.c: Started as real root: no, suid root: yes
I: main.c: Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary priviliges:
I: main.c: We are not in group 'pulse-rt' and PolicyKit refuse to grant us priviliges. Dropping SUID again.
I: main.c: For enabling real-time scheduling please acquire the appropriate PolicyKit priviliges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.
I: main.c: Note that real-time/high-priority scheduling is NOT normally required. If you experience crackling or other sound anomalies, consider one or more of the above solutions.
I: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
W: main.c: High-priority scheduling enabled in configuration but not allowed by policy.
W: core-util.c: setpriority(): Permission denied
D: main.c: Can realtime: no, can high-priority: no
W: ltdl-bind-now.c: Failed to find original dlopen loader.
I: main.c: Daemon startup successful.

Maybe I am wrong but I think, that the "glitch-free" feature only works if at least the realt-time scheduling is enabled.

Chris Coulson (chrisccoulson) wrote :

You need to add your user to the 'pulse-rt' group in order to use real time scheduling. Could you please try that and have another go.

Thanks

Changed in pulseaudio:
status: New → Incomplete
Achim (ach1m) wrote :

Okay, I have done what you have suggested and it looks better now.

$ pulseaudio --start -vvv
D: main.c: Started as real root: no, suid root: yes
I: main.c: We're in the group 'pulse-rt', allowing high-priority scheduling.
I: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
I: core-util.c: Successfully gained nice level -11.
I: main.c: Giving up CAP_NICE
D: main.c: Can realtime: no, can high-priority: no
W: ltdl-bind-now.c: Failed to find original dlopen loader.
I: main.c: Daemon startup successful.

I am nut sure if it is actually running with realtime scheduling because of this message (D: main.c: Can realtime: no, can high-priority: no)

Regards
Achim

Amit Soni (amitsoni) wrote :

I added the user to the pulse-rt group by the following--
sudo useradd -G pulse-rt amit

I got the following output--
useradd: user amit exists

Then I restarted pulseaudio by--
pulseaudio --start -vvv

But hen I got the following, stating that real time scheduling is not possible--
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
I: caps.c: Dropping root priviliges.
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
D: main.c: Started as real root: no, suid root: yes
I: main.c: PolicyKit refuses acquire-high-priority privilege.
I: main.c: Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary priviliges:
I: main.c: We are not in group 'pulse-rt' and PolicyKit refuse to grant us priviliges. Dropping SUID again.
I: main.c: For enabling real-time scheduling please acquire the appropriate PolicyKit priviliges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.
I: main.c: Note that real-time/high-priority scheduling is NOT normally required. If you experience crackling or other sound anomalies, consider one or more of the above solutions.
I: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
W: main.c: High-priority scheduling enabled in configuration but not allowed by policy.
W: core-util.c: setpriority(): Permission denied
D: main.c: Can realtime: no, can high-priority: no
W: ltdl-bind-now.c: Failed to find original dlopen loader.
I: main.c: Daemon startup successful.

Whenever I play any video in Intrepid my player hangs in between the play and even after many restarts it doesn't play smoothly. I think it is a problem of scheduling.

Please tell me where I am going wrong.

BR, Amit

Chris Coulson (chrisccoulson) wrote :

You didn't add your user to pulse-rt. You should do:

sudo usermod -G pulse-rt amit

This type of question really should go in the forums or support tracker though

Andreas Schultz (aschultz) wrote :

Instead of using a special group, shouldn't this use a policykit config?

see also:
https://wiki.ubuntu.com/DesktopTeam/Specs/Intrepid/DevicePermissions

Daniel T Chen (crimsun) wrote :

User error

Changed in pulseaudio:
status: Incomplete → Invalid
Andreas Schultz (aschultz) wrote :

dismissing this as "User error" is hardly a valid solution. A upgrade from an old ubuntu version (can't remember which one) left me with exactly the same situation as the original reporter. pulseaudio was installed and my main user had not been added to the -rt group.
At the very minimum, should the upgrade/install take care of that.

Chris Coulson (chrisccoulson) wrote :

Andreas - the upgrade should not add your user to the pulse-rt group anyway, as users are not added to this group on a default install either. In response to your earlier question about using Policykit - I think this is already the case in Jaunty.

So Daniel is correct to close this bug report, as there is no bug. In hindsight, I should have moved it to the support tracker initially.

Alchera (barrysuridge) wrote :

In response to the above post by Chris Coulson on 2008-10-30:

The command syntax is: usermod -a -G group1,group2,group3 username

Where username is the user you want to modify and group1 and group2 are the new groups you want that user to join. Running the command without the -a argument will remove that user from all groups except group1 and group2.

The aforementioned post will cause nothing but dramas for anyone using 'usermod -G'

Dan Quade (danquade) wrote :

The solution with pulse-rt group does not work in Karmic anymore as there is no such group. Reopening.

Changed in pulseaudio (Ubuntu):
status: Invalid → Confirmed
Achim (ach1m) wrote :

As far as I know this bug isn't valid any more.
Pulseaudio 0.9.18 now depends on RealtimeKit, for more information please following this link.

http://0pointer.de/blog/projects/rtkit.html

Regards
Achim

Changed in pulseaudio (Ubuntu):
status: Confirmed → Invalid
Oliver Joos (oliver-joos) wrote :

AFAIK rtkit is planned for 10.04 (Lucid). In 9.10 (Karmic) your pulseaudio daemon can gain high-priority and realtime scheduling by editing "/etc/security/limits.conf". For each desktop user add the following 2 lines:

<$USER> - nice -11 # values from -20 upto 19 allowed
<$USER> - rtprio 9 # values from 1 upto 99 allowed

Each user who wants high-priority and/or realtime scheduling then may copy /etc/pulse/daemon.conf into his ~/.pulse and change the following lines (with leading ";" removed!):
high-priority = yes # default no
rlimit-nice = 31 # default 31, values higher than 31 are interpreted as 31!
nice-level = -11 # default -11, lowest value allowed: (20 - rlimit-nice), lower means more CPU-%

realtime-scheduling = yes # default no
rlimit-rtprio = 9 # default 9, values from -20 upto 19 allowed
realtime-priority = 9 # default 5, highest value allowed: rlimit-rtprio, higher means more priority

These instructions are valid for pulseaudio running in user mode (which is the default).

Oliver Joos (oliver-joos) wrote :

...and here ~/.pulse/daemon.conf as attachment (without the ugly line breaks).

Jean Vincent (jvincent) wrote :

This is not a user error, I had the same problem after distribution upgrade from Intrepid to jaunty. I have the following errors in /var/log/messages right after booting without starting any other application:
Jan 10 08:19:27 Thermalgy-Ubuntu pulseaudio[3553]: main.c: Called SUID root and real-time and/or high-priority scheduling was requested in the configuration. However, we lack the necessary privileges:
Jan 10 08:19:27 Thermalgy-Ubuntu pulseaudio[3553]: main.c: We are not in group 'pulse-rt', PolicyKit refuse to grant us the requested privileges and we have no increase RLIMIT_NICE/RLIMIT_RTPRIO resource limits.
Jan 10 08:19:27 Thermalgy-Ubuntu pulseaudio[3553]: main.c: For enabling real-time/high-priority scheduling please acquire the appropriate PolicyKit privileges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.
Jan 10 08:19:27 Thermalgy-Ubuntu pulseaudio[3565]: main.c: Called SUID root and real-time and/or high-priority scheduling was requested in the configuration. However, we lack the necessary privileges:
Jan 10 08:19:27 Thermalgy-Ubuntu pulseaudio[3565]: main.c: We are not in group 'pulse-rt', PolicyKit refuse to grant us the requested privileges and we have no increase RLIMIT_NICE/RLIMIT_RTPRIO resource limits.
Jan 10 08:19:27 Thermalgy-Ubuntu pulseaudio[3565]: main.c: For enabling real-time/high-priority scheduling please acquire the appropriate PolicyKit privileges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.

Jean Vincent (jvincent) wrote :

Now this is great, after adding me to the pulse-rt group:
$ sudo usermod -G pulse-rt jean

and verifying that I was in the group:
jean@Thermalgy-Ubuntu:~$ groups
jean pulse-rt

I rebooted the computer to see if my sound would work again as it did before the upgrade to Jaunty.

It still does not work but now I can't even sudo:
jean@Thermalgy-Ubuntu:~$ sudo less /var/log/messages
[sudo] password for jean:
jean is not in the sudoers file. This incident will be reported.

Jean Vincent (jvincent) wrote :

I have been able to get audio playback working but not recording by installing the latest ALSA drivers using this script:
http://ubuntuforums.org/showthread.php?p=6589810

And adding at the end of /etc/modules the line:
snd-hda-intel

And rebooting.

$ lspci | grep Audio
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers