Set rtprio for Reaper

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
profquad
Established Member
Posts: 8
Joined: Wed Oct 18, 2023 9:39 pm

Set rtprio for Reaper

Post by profquad »

Hi, I've noticed my many many xruns are all "REAPER was not finished" and checked with ps, and it says /opt/REAPER/reaper is running with rtprio 5
I've done basically everything in the holy handbook rtcqs, besides the dangerous one and swappiness and dma latency rules bc it was running way too hot with no performance gain.
One thing I could never get tho is CONFIG_PREEMPT_RT=y

grub already has
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs"
GRUB_CMDLINE_LINUX=""

I'm wondering if maybe the second line undoes the prior?

I also don't know if this is relevant to rtprio. Tried chrt but it turned my mouse off somehow... could be related to me using TrackPoint in Mint, which seems to have some priority issues anyways.

In any case, I'm looking for a good way to change rtprio of specific programs or paths (for some yabridged VSTs) but everything I find online is just people saying "I changed it" without saying how?
Sorry, still pretty green, and appreciate any advice!

Using liquorix 6.6.2-1 Mint Cinnamon 21.1

User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Set rtprio for Reaper

Post by Impostor »

You don't need to set rt priority for applications afaik. Set it for Jack only, so only audio processing gets priority. Otherwise you may end up giving GUIs rt priority, which may not be that great an idea.

User avatar
sunrat
Established Member
Posts: 926
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 152 times
Been thanked: 247 times

Re: Set rtprio for Reaper

Post by sunrat »

Liquorix is not an RT kernel so won't have CONFIG_PREEMPT_RT=y

I'm wondering if maybe the second line undoes the prior?

No it doesn't.

I never set rtprio for applications, only for audio group which is set up automatically by install of jackd. /etc/security/limits.d/audio.conf:

Code: Select all

@audio   -  rtprio     95
@audio   -  memlock    unlimited

It could possibly be a storage i/o problem if your disk access is too slow. Are you recording on the same disk as system?

I just set up a new Debian Bookworm with Liquorix 6.6.6 on my old i5-6500 system and got over 97% in xruncounter, an amazing result. Pretty much only set it with rtcqs showing OK for everything except swappiness. Haven't tried audio applications yet so jury is still out.

profquad
Established Member
Posts: 8
Joined: Wed Oct 18, 2023 9:39 pm

Re: Set rtprio for Reaper

Post by profquad »

Impostor wrote: Wed Dec 13, 2023 9:55 pm

You don't need to set rt priority for applications afaik. Set it for Jack only, so only audio processing gets priority. Otherwise you may end up giving GUIs rt priority, which may not be that great an idea.

Well, I'd like to! haha. I just don't know how. running:

Code: Select all

chrt -f 90 /opt/REAPER/reaper

but still get a priority of 5.

Been asking ChatGPT, it suggested a /etc/systemd/system/reaper.service idea that, after some prodding, still didn't work. Ended up with variations on:

Code: Select all

[Unit]
Description=Reaper Digital Audio Workstation

[Service]
ExecStartPre=/usr/bin/chrt -f 90 $(pgrep -o reaper)
ExecStart=/full/path/to/reaper

[Install]
WantedBy=default.target

but chrt would fail every time:

Code: Select all

× reaper.service - Reaper Digital Audio Workstation
     Loaded: loaded (/etc/systemd/system/reaper.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2023-12-13 14:22:01 EST; 10s ago
    Process: 15706 ExecStartPre=/usr/bin/chrt -f 90 $(pgrep -o reaper) (code=exited, status=127)
        CPU: 1ms

Dec 13 14:22:01 Madlad systemd[1]: Starting Reaper Digital Audio Workstation...
Dec 13 14:22:01 Madlad chrt[15706]: chrt: failed to execute -o: No such file or directory
Dec 13 14:22:01 Madlad systemd[1]: reaper.service: Control process exited, code=exited, status=127/n/a
Dec 13 14:22:01 Madlad systemd[1]: reaper.service: Failed with result 'exit-code'.
Dec 13 14:22:01 Madlad systemd[1]: Failed to start Reaper Digital Audio Workstation.

ChatGPT couldn't figure out why, so now I'm asking ChatIRL :)

sunrat wrote: Thu Dec 14, 2023 12:05 am

Liquorix is not an RT kernel so won't have CONFIG_PREEMPT_RT=y

does that mean rtprio has no meaning?

Code: Select all

I never set rtprio for applications, only for audio group which is set up automatically by install of jackd. /etc/security/limits.d/audio.conf:
[code]@audio   -  rtprio     95
@audio   -  memlock    unlimited

@audio group is already set up and high priority.

It could possibly be a storage i/o problem if your disk access is too slow. Are you recording on the same disk as system?

2.8Gb/sec benchmark just now, ext4 noatime

I just set up a new Debian Bookworm with Liquorix 6.6.6 on my old i5-6500 system and got over 97% in xruncounter, an amazing result. Pretty much only set it with rtcqs showing OK for everything except swappiness. Haven't tried audio applications yet so jury is still out.

ahh xruncounter sounds like exactly what I was looking for earlier.
yeah, swappiness seems irrelevant, have 24 gigs of ram, 8th gen i5-8250U, Lenovo T480s. I do wonder if the U series CPU is why the DMA latency step immediately brought my core temp into the 90s.

and the third one I don't do is mitigations.. this is my daily driver.

This is why I'm so interested in changing the rtprio of reaper directly, so it asks more, but not too much. I've seen people say 50 is a good number for it, and I can tell by all the

JackEngine::XRun: client = REAPER was not finished, state = Running
JackAudioDriver::ProcessGraphAsyncMaster: Process error

xruns I get that 5 is not high enough, and from I just don't know how to set it. Anyone know?

User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Set rtprio for Reaper

Post by Impostor »

profquad wrote: Thu Dec 14, 2023 5:32 am

Code: Select all

chrt -f 90 /opt/REAPER/reaper

but still get a priority of 5.

All threads? If I chrt -f 78 muse4 then one thread has rtprio 5, one has rtprio 39, the rest has rtprio 78.
Chrt apparently sets the maximum rtpriority for a process.

profquad wrote: Thu Dec 14, 2023 5:32 am

Code: Select all

[Unit]
Description=Reaper Digital Audio Workstation
[Service]
ExecStartPre=/usr/bin/chrt -f 90 $(pgrep -o reaper)
ExecStart=/full/path/to/reaper

but chrt would fail every time:

You're running chrt on a process-id which doesn't exist yet?

Last edited by Impostor on Thu Dec 14, 2023 8:46 am, edited 2 times in total.
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Set rtprio for Reaper

Post by autostatic »

profquad wrote: Thu Dec 14, 2023 5:32 am

Well, I'd like to!

Setting a real-time priority for a DAW itself won't make any difference. You want to set the priority of IRQ threads and JACK, if in use.

profquad wrote: Thu Dec 14, 2023 5:32 am

Been asking ChatGPT, it suggested a /etc/systemd/system/reaper.service idea that, after some prodding, still didn't work

ChatGPT is recommending nonsense. A systemd service that runs Reaper as root is just plain silly.

profquad wrote: Thu Dec 14, 2023 5:32 am

does that mean rtprio has no meaning?

Liquorix is a low-latency kernel (CONFIG_PREEMPT=y) so it accepts the threadirqs kernel option which allows you to set priotity of IRQ threads.

profquad wrote: Thu Dec 14, 2023 5:32 am

2.8Gb/sec benchmark just now, ext4 noatime

ChatGPT is parroting https://wiki.linuxaudio.org/wiki/system ... ilesystems here. But with modern SSD's there's very little difference between noatime and relatime (the default).

profquad wrote: Thu Dec 14, 2023 5:32 am

yeah, swappiness seems irrelevant, have 24 gigs of ram, 8th gen i5-8250U, Lenovo T480s. I do wonder if the U series CPU is why the DMA latency step immediately brought my core temp into the 90s.

I've come across reports that give me the impression these kind of processors are probably not the best choice for doing audio production. The U means they're designed for power efficiency and that can cause issues when used for audio (overheating because of poor cooling from laptop vendors, aggressive throttling).

profquad
Established Member
Posts: 8
Joined: Wed Oct 18, 2023 9:39 pm

Re: Set rtprio for Reaper

Post by profquad »

ah yeah... I'm coming to the conclusion the the U in my CPU is the problem.
But today, for no special reason, I can't even to up to 1024 without massive xruns.. Surely something else is going on?
I'm getting really frustrated, it works worse this week than last week. :(

User avatar
sunrat
Established Member
Posts: 926
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 152 times
Been thanked: 247 times

Re: Set rtprio for Reaper

Post by sunrat »

You can set minimal idle states, and disabling mitigations (it's a minuscule security risk) can give a serious performance boost for some processors. I set extra kernel options:

Code: Select all

intel_idle.max_cstate=0 processor.max_cstate=1 threadirqs mitigations=off

Liquorix disables P-states and runs performance cpu governor as default.

But why it is worse than last week is a mystery that would be difficult to solve. Check if logs or journalctl show any clues. :?

User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Set rtprio for Reaper

Post by autostatic »

When setting CPU DMA latency option in Reaper (Options - Preferences - Audio - Disable power management if supported) I don't think setting C states as a kernel option is necessary anymore. From what I understood is that if the CPU DMA latency is set to 0 the CPU never idles as it's being put in C0 state.

User avatar
bluebell
Established Member
Posts: 1927
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 113 times
Been thanked: 122 times

Re: Set rtprio for Reaper

Post by bluebell »

sunrat wrote: Fri Dec 22, 2023 6:06 am

You can set minimal idle states, and disabling mitigations (it's a minuscule security risk) can give a serious performance boost for some processors. I set extra kernel options:

Code: Select all

intel_idle.max_cstate=0 processor.max_cstate=1 threadirqs mitigations=off

Liquorix disables P-states and runs performance cpu governor as default.

But why it is worse than last week is a mystery that would be difficult to solve. Check if logs or journalctl show any clues. :?

Kernel options are a strange thing. On my computers (Core i5 and i7, Kernel 5.15) threadirqs leads to chopped audio.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
sunrat
Established Member
Posts: 926
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 152 times
Been thanked: 247 times

Re: Set rtprio for Reaper

Post by sunrat »

bluebell wrote: Fri Dec 22, 2023 3:48 pm

Kernel options are a strange thing.

As are all config and tweak options. I think, to get a perfectly running system, one must invoke either magic or voodoo, and perhaps sacrifice a puppy. :lol:

On my computers (Core i5 and i7, Kernel 5.15) threadirqs leads to chopped audio.

First report I've heard of that. On my system (i5 6500) it led to a measurable improvement.

User avatar
bluebell
Established Member
Posts: 1927
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 113 times
Been thanked: 122 times

Re: Set rtprio for Reaper

Post by bluebell »

sunrat wrote: Fri Dec 22, 2023 9:17 pm
bluebell wrote: Fri Dec 22, 2023 3:48 pm

Kernel options are a strange thing.

As are all config and tweak options. I think, to get a perfectly running system, one must invoke either magic or voodoo, and perhaps sacrifice a puppy. :lol:

On my computers (Core i5 and i7, Kernel 5.15) threadirqs leads to chopped audio.

First report I've heard of that. On my system (i5 6500) it led to a measurable improvement.

I tried again. It is important to configure /etc/default/rtirq for each computer correctly. So I reached a state where threadirqs doesn't make it worse at least.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

Post Reply