Pulseaudio: Can't get realtime or high-priority permissions

I’m really confused, because polkit tells me I can be granted permission, and I’m in the proper groups, but pulseaudio tells me I can’t get permission…hmm. I wanted to see if anybody else had this problem / knew of a solution / isolate whether it is a pulseaudio, policykit, whatever problem, before I post a bug upstream.


[Sun 07:25 AM] ~ $ rpm -qi pulseaudio | awk '/Version|Release/ {print $1$2$3}'
Version:0.9.13
Release:3.4
[Sun 07:25 AM] ~ $ groups
users wheel dialout audio video pulse pulse-rt pulse-access
[Sun 07:26 AM] ~ $ polkit-auth --grant org.pulseaudio.acquire-real-time
[Sun 07:26 AM] ~ $ echo $?
0
[Sun 07:26 AM] ~ $ polkit-auth --grant org.pulseaudio.acquire-high-priority
[Sun 07:26 AM] ~ $ echo $?
0
[Sun 07:26 AM] ~ $ pulseaudio -vvv
D: main.c: Started as real root: no, suid root: no
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**
W: main.c: **Real-time scheduling enabled in configuration but not allowed by policy.**
D: main.c: Can realtime: no, can high-priority: no
...
W: core-util.c: **pthread_setschedparam(): Operation not permitted**
...

NB: I’m using pulseaudio from Build Service (home:/rodrigomoya:/pulseaudio/openSUSE_Factory), but get the exact same behavior if I use pulseaudio from openSUSE-11.1-Oss (or openSUSE-11.0-Oss).

OK, looking into this a bit more, it seems that the warnings about policy not allowing permission, actually have nothing to do with policykit, and are just related to system resource limits. In core-util.c, both pa_can_realtime and pa_can_high_priority (which are called by main.c and generate the warnings about policy in the above output) are preceded by the comment:


/* This is merely used for giving the user a hint. This is not correct
 * for anything security related */

So evidently the problem is something to do with permissions. Since I’m in the correct groups, I’m not sure what the problem is.

Just a guess here, but does it help if you put yourself in the audio group?

Geoff

Thanks for the guess, but I’m in audio already:

But I just stuck the following in /etc/security/limits.conf (some site on jack recommended it for realtime priority for jackd–I just added the pulse-rt group):


@audio          -       rtprio          99
@audio          -       nice            -20
@audio          -       memlock         4000000

@pulse-rt       -       rtprio          99
@pulse-rt       -       nice            -20

After a reboot, it now works. :slight_smile:


D: main.c: Started as real root: no, suid root: no
I: core-util.c: Successfully gained nice level -11.
D: main.c: Can realtime: yes, can high-priority: yes

Worked for me too. Thanks for this suggestion. Been looking for a way to have pulseaudio working. Now I have my equalizer working fine without crashing pulse.

Yay!! You’re a genius. Somebody ought to make this a sticky. It would haved saved me a lot of time reading and troubleshooting.

Thank you very much

please_try_again

I am having similar issue…

i am running a program using “sudo” but still getting EPREM i.e. pthread_setschedparam( ) returns 1.

tried the above solution but its not working for me on openSUSE 11.4, same program works fine on 11.3 without any mods…

any idea ?
are these values tab separated or just spaces ?

oh one more thing it not compiling error, it runtime error… also it not any driver, its just my simple thread program using pthreads…

also this program always does this even running as root ,… no joy at all…