One month and counting without RT kernel on Arch Linux

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

gimmeapill
Established Member
Posts: 528
Joined: Thu Mar 12, 2015 8:41 am

One month and counting without RT kernel on Arch Linux

Postby gimmeapill » Wed Jan 02, 2019 12:13 pm

Hi Guys,

Every once in a while I try the stock Arch Linux kernel with my reference low latency audio setup - just to see how it goes against the RT Kernel from the Arch User Repository.

The experiment usually doesn't last for long, but this time it is going a lot better:
I was quite surprised to find out that as of Linux 4.19, the stock Arch kernel handles latencies as low as 2ms just fine - this was clearly not the case one year ago with 4.16.

I didn't run any precise measurement with rt tests, just my empirical benchmark with Guitarix & Jack1 running at 64 samples with 3 periods @ 96KHz with a Focusrite Scarlett 2i2 first gen (on an old Ivy Bridge notebook).
This gives ~2ms in + 2ms out + 2-3 ms AD/DA conversion = 6-7ms round trip latency.
With this config I could run for an hour or so with zero xruns - same as with the RT kernel - sweet!
Adding Ardour and/or Renoise to the mix and I get a few xruns, but this was anyway not better with RT.

I wouldn't be able to tell if those results are due to the Arch kernel patches or just the performance improvements upstream, but if you're cringing at the build times of the RT kernel, and your distro provides a recent kernel like Linux 4.19 or 4.20 this may be worth another shot ;-)
Last edited by gimmeapill on Wed Jan 02, 2019 2:51 pm, edited 1 time in total.

User avatar
raboof
Established Member
Posts: 1558
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Contact:

Re: One month and counting without the RT kernel on Arch Linux

Postby raboof » Wed Jan 02, 2019 12:53 pm

That sounds like great progress!

Jack Winter
Established Member
Posts: 323
Joined: Sun May 28, 2017 3:52 pm

Re: One month and counting without the RT kernel on Arch Linux

Postby Jack Winter » Wed Jan 02, 2019 2:08 pm

I was also surprised the other day testing it.

FWIW, the main distro kernel is lowlat and doesn't really patch anything that could impact this in anyway. Still there have been some changes in the kernel config that I suspect could have had a positive effect.
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux

Death
Established Member
Posts: 32
Joined: Sun Oct 11, 2015 1:43 pm

Re: One month and counting without RT kernel on Arch Linux

Postby Death » Thu Jan 03, 2019 4:27 am

Interesting! I'll try this out when my distro provides 4.19 (not far off now). I think the low latency kernel may cause some occasional instabilities on my system so I've been thinking of trying out the regular kernel again anyway. Thanks for reporting :)

User avatar
nikgnomicradio
Established Member
Posts: 52
Joined: Wed Feb 07, 2018 9:31 pm
Contact:

Re: One month and counting without RT kernel on Arch Linux

Postby nikgnomicradio » Fri Jan 04, 2019 6:10 am

Manjaro developers pushed v4.20 kernel to all users just before Christmas
can't see any difference from v4.19 yet - both are excellent

Not had need to use RT kernel for about a year, removed it to reduce clutter last spring and not missed it
stock kernel is well capable of managing a lot more than i need from it
qjackctl is set to about 10-12ms and don't see an x-run for days

Musicteacher
Established Member
Posts: 47
Joined: Mon Nov 13, 2017 5:54 am

Re: One month and counting without RT kernel on Arch Linux

Postby Musicteacher » Fri Jan 04, 2019 3:24 pm

I use an arch based distro, too (Antergos). I have switched just recently, but so far had no problems with the vanilla kernel.
I use a Delta 1010LT with 128 byte buffer, 2 periods (5,xx ms latency).

User avatar
CrocoDuck
Established Member
Posts: 968
Joined: Sat May 05, 2012 6:12 pm
Contact:

Re: One month and counting without RT kernel on Arch Linux

Postby CrocoDuck » Mon Jan 07, 2019 9:57 pm

I went for a quick test too and I found very good performance with 4.19.13-1-lts. It is pretty much as with RT, as far as I can tell.
Check my Linux audio experiments on my SoundCloud.
Browse my AUR packages.
Fancying a swim in the pond?

gimmeapill
Established Member
Posts: 528
Joined: Thu Mar 12, 2015 8:41 am

Re: One month and counting without RT kernel on Arch Linux

Postby gimmeapill » Mon Jan 07, 2019 10:10 pm

Ha!
I just had to reboot on 4.18 RT to open an old Renoise project. It is not night and day by any mean, but I have slightly less xruns (possibly also because of jack1).
So 4.18 RT still has a tiny edge over stock 4.19/4.20 I would say, but it's a very close call.

This makes me wonder how 4.19 RT will look like (the RT patch is published, but the pkgbuild is not there yet)...

User avatar
sysrqer
Established Member
Posts: 1569
Joined: Thu Nov 14, 2013 11:47 pm
Contact:

Re: One month and counting without RT kernel on Arch Linux

Postby sysrqer » Mon Jan 07, 2019 10:17 pm

This is interesting, I would be curious to see how it compared to a 'vanilla' kernel build or perhaps a config from another distro. I know the arch config is pretty simple though so that would lead to the kernel itself. Very impressive if it is that close to RT.

User avatar
wakoo
Established Member
Posts: 18
Joined: Tue Dec 25, 2018 11:31 pm

Re: One month and counting without RT kernel on Arch Linux

Postby wakoo » Tue Jan 08, 2019 8:19 am

But, What are the minimun settings for audio work with stock kernel? Maybe add user to audio group and config the /etc/security/limits.conf file?

Jack Winter
Established Member
Posts: 323
Joined: Sun May 28, 2017 3:52 pm

Re: One month and counting without RT kernel on Arch Linux

Postby Jack Winter » Tue Jan 08, 2019 8:54 am

On Archlinux we don't use the audio group at all, we use the realtime group for giving the needed PAM permissions. You need to add the realtime-privileges package and add your user to the realtime group.

For those that don't know, the plan is for the realtime patch set to be completely merged into the kernel source this year, or at the very latest next year. Possibly the improvements in the main kernel are due to realtime patches being added to the main kernel source.
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux

gimmeapill
Established Member
Posts: 528
Joined: Thu Mar 12, 2015 8:41 am

Re: One month and counting without RT kernel on Arch Linux

Postby gimmeapill » Tue Jan 08, 2019 9:46 am

wakoo wrote:But, What are the minimun settings for audio work with stock kernel? Maybe add user to audio group and config the /etc/security/limits.conf file?


This thread assumes a system already tuned for low latency audio work.
(distro specific, but https://github.com/raboof/realtimeconfigquickscan is your friend to get started).

There is no universal minimum setting or latency figure, it depends on what your specific audio needs are.
Ex: if you're doing everything you need to do happily with 20ms latency, you should probably not even be reading this ;-)

So as we've seen, the performance of the stock kernel for audio work tends to improve over time, which means that the use case for a custom kernel is getting narrower and narrower. It looks like many users here have already moved on.
Which is good, because compiling an RT patched kernel (and maintaining it) is a a pain, unless your distro provides one.
The reason is what Jack Winter said: the RT patch set features are gradually getting incorporated into the stock kernel, so this discussion should finally become irrelevant very soon.

Back to the timeline: until about 5-6 years ago, the stock kernel was reputed to be good enough to get down to about ~10ms, then around 2-3 years ago you could get down to 5ms - which made it good enough for playing soft synths from a midi controller in most possible scenarios.
(I might be wrong about the exact dates, my memory is getting blurry).

Now we're talking about 1-2 ms - which is my use case for live guitar effects in software + DAW (my config runs with roughly 6-7 ms total round trip latency).
I didn't run any benchmark, since I got empirically the answer needed: 0 xrun is possible, but when thing get really hairy I can still push it a bit further with RT - which is probably irrelevant to 95% of Linux audio users ;-)

merlyn
Established Member
Posts: 80
Joined: Thu Oct 11, 2018 4:13 pm

Re: One month and counting without RT kernel on Arch Linux

Postby merlyn » Tue Jan 08, 2019 1:14 pm

I've been using the Arch stock kernel for a few months now. I've run some tests that I posted here which show that, in terms of kernel latency, 4.19.12 has been the best so far. Its plot looks like what you would expect from an RT kernel.

On Arch 'partial upgrades are not supported', so there isn't a sensible way to stick with kernel 4.19.12, even though it preforms better. I'm not concerned about this because 4.20 will get better, back to where 4.19.12 was.

The 'stock' Arch kernel isn't stock though :) . It's a low latency kernel, which you can tell from uname -a. It says 'PREEMPT' in the name, which means it's a low latency kernel.

gimmeapill
Established Member
Posts: 528
Joined: Thu Mar 12, 2015 8:41 am

Re: One month and counting without RT kernel on Arch Linux

Postby gimmeapill » Tue Jan 08, 2019 2:35 pm

@merlyn: thanks the precisions, I never looked too far into the stock Arch kernel.
I should have made more clear that stock Arch <> vanilla, but anyway this is true for more or less any distro.
...and in the meantime, look what just made it to the AUR: linux-rt 4.19.10 https://aur.archlinux.org/packages/linux-rt/

merlyn
Established Member
Posts: 80
Joined: Thu Oct 11, 2018 4:13 pm

Re: One month and counting without RT kernel on Arch Linux

Postby merlyn » Tue Jan 08, 2019 8:37 pm

gmmeapill wrote:...and in the meantime, look what just made it to the AUR: linux-rt 4.19.10


You can install a pre-built RT kernel by adding this unofficial user repository.


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: No registered users and 1 guest