Unable to set RTPRIO due to permission error in kernel 6.0.5-rt14

/etc/security/limits.d/99-realtime-priviliges.conf

@realtime - rtprio 98
@realtime - memlock unlimited
@realtime - nice -11

/etc/security/limits.d/98-audio.conf

@audio - rtprio 98
@audio - memlock unlimited
anirban - rtprio 98
anirban - memlock unlimited

groups anirban

wheel audio lp sys network power realtime anirban

rtcqs

rtcqs - version 0.5.3

Root User
=========
[ OK ] Not running as root.

Audio Group
===========
[ OK ] User anirban is in the audio group.

CPU Frequency Scaling
=====================
[ OK ] The scaling governor of all CPU's is set at performance.

Kernel Configuration
====================
[ OK ] Valid kernel configuration found.

High Resolution Timers
======================
[ OK ] High resolution timers are enabled.

Tickless Kernel
===============
[ OK ] System is using a tickless kernel.

Preempt RT
==========
[ OK ] Kernel 6.0.5-3-rt14-MANJARO is using threaded IRQ's.

Spectre/Meltdown Mitigations
============================
[ OK ] Spectre/Meltdown mitigations are disabled. Be warned that this makes your system more vulnerable to Spectre/Meltdown attacks.

RT Priorities
=============
[ WARNING ] Could not assign a 80 rtprio SCHED_FIFO value due to the following error: [Errno 1] Operation not permitted. Set up limits.conf. 

Swappiness
==========
[ OK ] Your system is configured without swap, setting swappiness does not apply.

Filesystems
===========
[ OK ] The following mounts can be used for audio purposes: /, /mnt/sda1
[ WARNING ] The following mounts should be avoided for audio purposes: /run/user/1000/doc. 
IRQs
=====
[ OK ] Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.
Soundcard snd_hda_intel:card2 with IRQ  does not share its IRQ.

Power Management
================
[ OK ] Power management can be controlled from user space. This enables DAW's like Ardour and Reaper to set CPU DMA latency which could help prevent xruns.

Edit – show terminal responses as preformatted text – nikgnomic

Hello,

I am having exactly the same :

rtcqs - version 0.5.3

Root User
=========
[ OK ] Not running as root.

Audio Group
===========
[ OK ] User martors is in the audio group.

CPU Frequency Scaling
=====================
[ OK ] The scaling governor of all CPU's is set at performance.

Kernel Configuration
====================
[ OK ] Valid kernel configuration found.

High Resolution Timers
======================
[ OK ] High resolution timers are enabled.

Tickless Kernel
===============
[ OK ] System is using a tickless kernel.

Preempt RT
==========
[ OK ] Kernel 6.0.5-3-rt14-MANJARO is a real-time kernel.

Spectre/Meltdown Mitigations
============================
[ WARNING ] Kernel with Spectre/Meltdown mitigations found. This could have a negative impact on the performance of your system. 
RT Priorities
=============
[ WARNING ] Could not assign a 80 rtprio SCHED_FIFO value due to the following error: [Errno 1] Operation not permitted. Set up limits.conf.

I am using Cadence with Jack and this is the message I get when trying to run Ardour 7

---ERROR: JACK: Cannot create thread res = 1
ERROR: JACK: JackClient::AcquireSelfRealTime error
ERROR: JACK: Cannot use real-time scheduling (RR/94) (1: Operation not permitted)

I really don’t know what could cause this.

Edit – show terminal responses as preformatted text – nikgnomic

Did you (or the Op @anirban.metal ) notice that what you posted here looks very weird and is unreadable?
Totally unlike the terminal output you copy/pasted this from?

use proper formatting - preformatted text for terminal output
this button: </>
up in the top row of the edit window

I suspect that recent Manjaro RT kernels have a configuration option enabled in error ( CONFIG_RT_GROUP_SCHED=y) that requires user to configure cgroup settings for realtime-priority instead of rtprio

jackaudio.org has a wiki page about configuring cgroups (last updated 2013) but FAQ recommends against using it

How does using Linux with RT_GROUP_SCHED enabled affect JACK? | JACK Audio Connection Kit
we do not intend that individual users should need to grapple with CGroup configuration, but distributions should try to take care of this so as not to make using JACK with realtime scheduling effectively impossible for their users.

Lennart also requested option to require use of cgroups on Fedora be turned off in 2015:

1229700 – Please turn off CONFIG_RT_GROUP_SCHED in Fedora kernels
CONFIG_RT_GROUP_SCHED should be turned off in Fedora, as there’s no way to make use of it in a sane way right now.

I think CONFIG_RT_GROUP_SCHED makes a lot of sense in embedded devices that can map a strict, static RT budget structure to its cgroups, but it cannot work on a fully dynamic general purpose system, because of the limitations

IMO There are 2 simple solutions to have realtime-priority for pro-audio use:

  1. Install non RT kernel that permits rtprio setting for realtime-priority
    Manjaro Team make excellent low-latency kernels and most pro-audio users do not need a RT kernel
    Do I need a realtime kernel to use realtime scheduling? | JACK Audio Connection Kit

  2. Disable cgroup scheduling for RT kernel

    sudo tee /etc/sysctl.d/disable-cgroup.conf <<< 'kernel.sched_rt_runtime_us=-1'
    

    Reboot system to ensure configuration is loaded
    System should allow rtprio to increase realtime-priority – chrt -f 80 echo success

1 Like

Thank you very much for taking the time to explain this. This solved the issue and now also Ardour works fine.

I have edited first 2 posts to show terminal responses as preformatted text so other users can see the terminal responses

rtcqs responses are unreadable because the underlined sub-titles are displayed as Heading Level 1 text. ie:

Root User
=========

is rendered similar to

# Root User

or

<h1> Root User</h1>

and looks like this:

Root User

So if rtcqs drop the underlining, information would be shown at normal size and easier to read