Is it worth using nice or renice command with Jack aware applications ?

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

Post Reply
eleandar
Established Member
Posts: 8
Joined: Fri Apr 26, 2013 11:08 pm

Is it worth using nice or renice command with Jack aware applications ?

Post by eleandar »

Hello,

I know that Jack has realtime priorities but is it worth to increase the process priority of a Jack aware application ? Does it have an effect on audio processing stability (e.g reducing XRuns) ?

Kind Regards,
Laurent
varpa
Established Member
Posts: 482
Joined: Fri Feb 25, 2011 6:40 pm

Re: Is it worth using nice or renice command with Jack aware applications ?

Post by varpa »

I think it is mainly important that Jack itself runs at high priority which can be set, for example, in QJackCtl, in Setup->Advanced tab. In general you can check your config with this script: https://github.com/raboof/realtimeconfigquickscan
sunrat
Established Member
Posts: 221
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 6 times
Been thanked: 8 times

Re: Is it worth using nice or renice command with Jack aware applications ?

Post by sunrat »

nice was suggested years ago but is now considered irrelevant. Obligatory link to LinuxAudio system config wiki page - https://wiki.linuxaudio.org/wiki/system_configuration
I also found that, for Intel processors, disabling C-states can be beneficial. I mentioned it in my Debian Bullseye setup guide -viewtopic.php?f=19&t=22793
merlyn
Established Member
Posts: 832
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 18 times
Been thanked: 23 times

Re: Is it worth using nice or renice command with Jack aware applications ?

Post by merlyn »

The short answer is no.

If you look at htop there are two relevant columns PRI and NI -- the priority and the nice. At first glance it seems to work backwards. The lower the PRI value the higher the priority. nice makes PRI higher which makes the priority lower. To give a process a higher priority negative nice values are used.

Realtime threads have the highest priority and so have a negative PRI value. nice doesn't work on realtime threads.

Image

Looking at Guitarix -- there is a process in orange with a PRI of 20. That is the GUI, the app, non-JACK stuff. Then there is a Guitarix thread in green with
a PRI of -81. That is the JACK realtime thread doing the audio processing. I set the priority of JACK in QjackCtl at 85, which results in a PRI of -86 for jackdbus as I'm using jackdbus, and a priority of -81 for JACK apps.
The ultimate hidden truth of the world is that we make it, and could just as easily make it differently.
Post Reply