Proper system configuration

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
User avatar
Aksjodgoi
Established Member
Posts: 17
Joined: Wed Aug 28, 2013 1:12 pm

Proper system configuration

Post by Aksjodgoi »

Hi, guys!

So, I wonder if my system is set properly for audio production...

I've done these things (I do it always after fresh system install):

1. Adding user to audio group
$ sudo adduser USER audio
2. Setting memory limit to unlimited (/etc/security/limits.conf):
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19
(I'm not really sure if I should remove # from last line..)

3. Reducing swap usage (/etc/sysctl.conf):
vm.swappiness=10
4. Installing low-latency kernel

5. Instaling cpufrequtils (if it's not installed) and indicator-cpufreq

That is all. Is anything more?

P.S. It's not offtopic if it is related with performance. :lol: -> Which is better: Cadence or Qjackctl? And why?
User avatar
sysrqer
Established Member
Posts: 2523
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 320 times
Been thanked: 152 times
Contact:

Re: Proper system configuration

Post by sysrqer »

If you are using plasma 5 watch out for indicator-cpufreq, for me it caused plasmashell to use more cpu than it should to.
I can't imagine that cadence or qjackctl would have much effect on performance as they both just start JACK but it's an interesting question.
gimmeapill
Established Member
Posts: 564
Joined: Thu Mar 12, 2015 8:41 am
Has thanked: 44 times
Been thanked: 8 times

Re: Proper system configuration

Post by gimmeapill »

@Aksjodgoi: Just run the realtimeconfigquickscan to find out: https://github.com/raboof/realtimeconfigquickscan
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Proper system configuration

Post by CrocoDuck »

gimmeapill wrote:@Aksjodgoi: Just run the realtimeconfigquickscan to find out: https://github.com/raboof/realtimeconfigquickscan
That's the best way. In addition, there might be some info for you here.
User avatar
forestandgarden
Established Member
Posts: 257
Joined: Wed May 24, 2017 9:18 pm
Has thanked: 17 times
Been thanked: 22 times
Contact:

Re: Proper system configuration

Post by forestandgarden »

P.S. It's not offtopic if it is related with performance. :lol: -> Which is better: Cadence or Qjackctl? And why?
Cadence comes with a suite of tools that can be very useful, whereas qjackctl does just what is needed, so it's a smaller program. Features I like in Cadence are the possibility to change the period size (in Catia) of a running jack server from the GUI, which usually makes a crash when reducing it, but is handy if if you notice in mid-project that you're using too many plugins for your latency and want to increase the period, an interface to setting the CPU governor, jack render if you do not have a DAW running but still want to quickly record what you're doing, to name a few. So if you want a better interface to more features, Cadence, if all you need is to start&stop jack with specific settings and maybe use jack transport and do the occasional connection, then qjackctl is less heavy. But to avoid confusion, both programs are just GUIs to low level functionality, so they don't eat CPU unless you are doing something in their windows.
some of my stuff is ending up here https://alooshu.byethost17.com and here https://clyp.it/user/i4p5dng1 , and you can love me at https://liberapay.com/aloo_shu
Luc
Established Member
Posts: 741
Joined: Fri Mar 27, 2015 1:04 pm
Been thanked: 1 time

Re: Proper system configuration

Post by Luc »

Hmm... My /etc/security/limits.conf is all commented out. I wasn't even aware it existed.
But since you bring it up, wouldn't it be safer to limit it to how much RAM you have?

Speaking of which, I have been running without any kind of swap for years, longer than I can remember, and it's been smooth always. I have 8 GB of RAM on a reasonably strong desktop. Even when I had 2 GB on a netbook (a netbook!), I had no swap and it held its own quite nicely.

And even before Debian did it (or I started using Debian, I don't remember which), I already had /tmp mapped to a so-called "RAM disk," among other directories. I reserve 1 GB to /tmp.

I don't know if any of this is relevant, I'm just sharing. At the very least, I'm exercising my bragging rights cause those other OSes won't let you do any of that. :-)

I don't have a low-latency kernel, but I never do any analogue. It's VST/VSTi plugins all the way for me. I have a friend who plays the guitar. I should invite him over one of these days...

I absolutely prefer Cadence. I remember I tried Qjackctl for a couple of days and never made heads and tails of it. Its patch bay is particularly hideously messy. I hated it with a passion and I hated the whole of JACK by proxy until I got Cadence + Catia, which makes a lot more sense to me. I fell in love with JACK after I saw those cute little wires connecting stuff, a lot like shell/command line pipes do but with sound.

At any rate, you can ignore everything I just said and choose whatever poison you like, because this is Linux. :-)
asbak
Established Member
Posts: 897
Joined: Thu Sep 11, 2014 3:04 pm
Has thanked: 71 times
Been thanked: 64 times

Re: Proper system configuration

Post by asbak »

Aksjodgoi wrote: 1. Adding user to audio group
Yes
2. Setting memory limit to unlimited (/etc/security/limits.conf):
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19
(I'm not really sure if I should remove # from last line..)
# End of file
@audio - rtprio 90
@audio - memlock unlimited
<user> soft nofile 100000
<user> hard nofile 100000

3. Reducing swap usage (/etc/sysctl.conf):
vm.swappiness=10
May help but the better solution is to just add sufficient RAM
4. Installing low-latency kernel
Some people install RT kernels.
I don't because they can be troublesome and didn't seem to offer audio performance gains over preempt kernels.
Preempt kernels (low-latency) work great.
5. Instaling cpufrequtils (if it's not installed) and indicator-cpufreq
Any utility such as this uses extra CPU cycles although it shouldn't hurt the system performance significantly.
When doing audio work it may help reduce xruns if system is set to performance instead of powersave mode.
That is all. Is anything more?
Graphics drivers can have a significant impact. On my systems Nouveau drivers led to loads of xruns so I switched to the nVidia proprietary drivers.
There are loads more settings which can be tweaked but the most effective changes imo are the kernel and the limits.conf file.

Certain types of wifi chipsets can lead to more xruns, so if applicable experiment with enabling and disabling wifi.

My personal preference is to use qjackctl or to just run jack straight from the terminal. I used to have endless bs and problems with dopey dbus. (Cadence requires dbus). On my system qjackctl calls custom startup and shutdown scripts which handle ALSA to jack, shutdown & startup of pulseaudio etc. Works great for me but everybody has different requirements & preferences.
Some Focal / 20.04 audio packages and resources https://midistudio.groups.io/g/linuxaudio
Post Reply