PulseEffects can't get realtime priority

Hi!
I’ve installed Manjaro 20.2 xfce about one or two weeks ago and I really like it, but one thing that I just can’t get working is the PulseEffects to get realtime priority. (got it using pacman, so it’s not a flatpak issue).
I’ve already tried adding my user to the audio group with rtprio 100 and memlock unlimited and setting these same rights for my user personally (in /etc/security/limits.conf), but PulseEffects still can’t get realtime priority. I’ve tried loading a liveUSB with Ubuntu Studio 20.04 xfce and got the same exact issue.
The specs are in my profile. If it matters, the soundcard I use is sb0220.
Here’s the terminal output:

(pulseeffects:7990): pulseeffects-WARNING **: 19:50:28.470: sie: rtkit: MakeThreadHighPriority:
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Operation not permitted

(pulseeffects:7990): pulseeffects-WARNING **: 19:50:28.473: sie: rtkit: MakeThreadHighPriority: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Operation not permitted

(pulseeffects:7990): pulseeffects-WARNING **: 19:50:28.477: sie: rtkit: MakeThreadHighPriority: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Operation not permitted
Each time the stream is created.
(the number after “pulseeffects:” is supposedly PID, but I’m not sure about that address-like string after “pulseeffects-WARNING **:”)
To me it looks like the user still hasn’t got the permission to make the thread realtime.

I’ve tried using this oh, I’m not allowed to post links… OK, makes sense. Anyway, here it is yonch(dot)com/tech/82-linux-thread-priority code snippet and got:
“Unsuccessful in setting thread realtime prio”, so I guess it’s really some problem with rtprio right management (probably caused by my lack of knowledge).

Any ideas on how to solve this?

Are you running a real time kernel ?

Yes, as stated in my profile, I’m running 5.9.1-1-rt19 real time kernel.

Could you provide the output of

getent passwd rtkit

And

 systemctl  status rtkit-daemon
getent passwd rtkit
rtkit:x:133:133:RealtimeKit:/proc:/usr/bin/nologin
 systemctl  status rtkit-daemon
● rtkit-daemon.service - RealtimeKit Scheduling Policy Service
     Loaded: loaded (/usr/lib/systemd/system/rtkit-daemon.service; disabled; vendor preset: disabled)
     Active: active (running) since Sun 2020-12-13 09:42:17 EET; 10h ago
   Main PID: 1065 (rtkit-daemon)
      Tasks: 3 (limit: 4692)
     Memory: 612.0K
     CGroup: /system.slice/rtkit-daemon.service
             └─1065 /usr/lib/rtkit-daemon

Dec 13 19:44:27 picknicko13manjaro rtkit-daemon[1065]: Supervising 2 threads of 2 processes of 1 users.
Dec 13 19:44:27 picknicko13manjaro rtkit-daemon[1065]: Supervising 2 threads of 2 processes of 1 users.
Dec 13 19:44:27 picknicko13manjaro rtkit-daemon[1065]: Supervising 2 threads of 2 processes of 1 users.
Dec 13 19:44:27 picknicko13manjaro rtkit-daemon[1065]: Supervising 2 threads of 2 processes of 1 users.
Dec 13 19:44:27 picknicko13manjaro rtkit-daemon[1065]: Successfully made thread 18587 of process 18417 owned by '1000' RT at priority 10.
Dec 13 19:44:27 picknicko13manjaro rtkit-daemon[1065]: Supervising 3 threads of 3 processes of 1 users.
Dec 13 19:56:01 picknicko13manjaro rtkit-daemon[1065]: Supervising 3 threads of 3 processes of 1 users.
Dec 13 19:56:01 picknicko13manjaro rtkit-daemon[1065]: Supervising 3 threads of 3 processes of 1 users.
Dec 13 19:56:04 picknicko13manjaro rtkit-daemon[1065]: Supervising 3 threads of 3 processes of 1 users.
Dec 13 19:56:04 picknicko13manjaro rtkit-daemon[1065]: Supervising 3 threads of 3 processes of 1 users.

sb0220 is - Sound Blaster Live! 5.1 Digital (Dell OEM)
with EMU10k1 audio codec

This card has built-in audio processing available in ALSA
I suggest you install qastools and check out the hardware effects available in qasmixer
(alsamixer is adequate for most users to adjust ALSA settings after install, but this card has hardware mixing capabilities and you may want more regular access to ALSA controls)

Onboard effects do not add latency so if you can replace some of the effects used in pulseeffects
that would reduce latency in PulseAudio

Thanks!
I was thinking about these effects, but since I use PulseEffects to eq for the earphones I use, there are a lot of filters to compensate the frequency response of the earphones, so doing this in the card’s own DSP is likely impossible due to it’s limitations, but you got me interested in trying anyway.
Back on windows I used to forward the virtual 2|3 and 4|5"outputs" that windows’s seen as line outs to the card’s mixer bus 6|7 and 8|9, then use some VST host to eq them and with about 16ms latency it was quite reliable, but then I started using EQ APO, as it has lower latency, doesn’t take over ASIO and uses a little less CPU and RAM (and the UI is really nice).
Now, looking at the qastools, qashctl looks quite similar so the DSP part of kxdriver, but not on a canvas. Gotta investigate it today.
Utilizing the soundcard’s DSP for this purpose seems possible with a bit of DSP coding (and it’s probably not that difficult, so I think a week or two should be enough to code it. If it’s even possible, of course).

A little offtop: maybe, there’s some external soundcard with a 20(or more) band parametric eq configurable on linux (for a reasonable price)?
I’m going to get a new PC in a few month, so this pci card will need a replacement (since pci is obsolete) and it will be great if it has a parametric EQ, especially since it would be usable with any other audio source.

I used to use the drivers from kxproject.com when I was using XP
(10mS latency on MIDI compared to 100mS from Creative official drivers)

The kX drivers have been ported to Linux and are available in JACK
Low latency, multichannel audio with JACK and the emu10k1/emu10k2 — The Linux Kernel documentation
JACK exposes the FxBus channels of inputs and outputs similar to the kX ‘prolog’ and ‘epilog’
connections
The rear/centre/sub channels can be used independently and channels 0/1 has ‘What U Hear’ mix for recording or streaming
For a canvas patchbay there is Patchage or Catia or Graph window in QjackCtl

the onboard DSP is limited and does not have onboard graphic (or parametric) equalizers

If you do not want to use JACK for DSP you could try other DSP packages in PulseAudio (or ALSA)
for lower latency:
dsp-git - bmc0/dsp: An audio processing program with an interactive mode - GitHub
viper4linux-gui - Audio4Linux/Viper4Linux-GUI: Official UI for Viper4Linux - GitHub

Wow, that’s a lot of options, thank you for suggesting them! Definitely gonna try all of them on the weekend.
P.S. Today I tried replacing ALSA with OSS, since it is said to have better support for old hardware, but no luck (and no will to try and investigate it since it seems to be almost completely abandoned).

Well, JACK looks like the thing I wanted, but the problem with realtime scheduling isn’t gone, so when trying to route PulseAudio to JACK, there are similar errors. The effect it has is not AS bad, but still it still breaks sometimes (xruns happen).

W: [pulseaudio] module-jack-sink.c: JACK error >Cannot use real-time scheduling (RR/85) (1: Operation not permitted)<
W: [pulseaudio] module-jack-sink.c: JACK error >JackClient::AcquireSelfRealTime error<
W: [pulseaudio] module-jack-source.c: JACK error >Cannot use real-time scheduling (RR/85) (1: Operation not permitted)<
W: [pulseaudio] module-jack-source.c: JACK error >JackClient::AcquireSelfRealTime error<
Now I’m pretty sure there’s something wrong with my right management configuration, but not sure what exactly.

" (RR/85) " indicates JACK is only set to use realtime priority (rtprio) 85. That value is probably set by ‘rtkit’ for PulseAudio, but JACK needs a higher value to use real-time scheduling

I suggest you install package realtime-privileges
and add your username to the realtime group created by this package

sudo gpasswd $USER -a realtime

and reboot to make sure new configuration and group is loaded

realtime-privileges will increase realtime priority for JACK to 98 so it can support realtime scheduling

Well, I guess the issue was actually entirely my own fault, since after a fresh installation of manjaro (it was a necessity, since my old hard drive died) it’s gone. (I only checked the one with JACK, but I suppose PulseEffects will probably work fine, too)
Anyway, thanks you a lot for your suggestions!

I’d mark the suggestion to install realtime-privileges package as the answer, since it seems like most likely it has been the issue with privileges.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.