One month and counting without RT kernel on Arch Linux
Moderators: MattKingUSA, khz
-
- Established Member
- Posts: 564
- Joined: Thu Mar 12, 2015 8:41 am
- Has thanked: 44 times
- Been thanked: 8 times
One month and counting without RT kernel on Arch Linux
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
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.
-
- Established Member
- Posts: 381
- Joined: Sun May 28, 2017 3:52 pm
Re: One month and counting without the RT kernel on Arch Linux
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.
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 For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux
Re: One month and counting without RT kernel on Arch Linux
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
- nikgnomicradio
- Established Member
- Posts: 109
- Joined: Wed Feb 07, 2018 9:31 pm
- Has thanked: 1 time
- Been thanked: 7 times
- Contact:
Re: One month and counting without RT kernel on Arch Linux
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
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
-
- Established Member
- Posts: 194
- Joined: Mon Nov 13, 2017 5:54 am
- Has thanked: 8 times
- Been thanked: 4 times
Re: One month and counting without RT kernel on Arch Linux
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).
I use a Delta 1010LT with 128 byte buffer, 2 periods (5,xx ms latency).
Re: One month and counting without RT kernel on Arch Linux
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.
-
- Established Member
- Posts: 564
- Joined: Thu Mar 12, 2015 8:41 am
- Has thanked: 44 times
- Been thanked: 8 times
Re: One month and counting without RT kernel on Arch Linux
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)...
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)...
- sysrqer
- Established Member
- Posts: 2527
- Joined: Thu Nov 14, 2013 11:47 pm
- Has thanked: 320 times
- Been thanked: 153 times
- Contact:
Re: One month and counting without RT kernel on Arch Linux
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.
Re: One month and counting without RT kernel on Arch Linux
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?
-
- Established Member
- Posts: 381
- Joined: Sun May 28, 2017 3:52 pm
Re: One month and counting without RT kernel on Arch Linux
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.
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 For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux
-
- Established Member
- Posts: 564
- Joined: Thu Mar 12, 2015 8:41 am
- Has thanked: 44 times
- Been thanked: 8 times
Re: One month and counting without RT kernel on Arch Linux
This thread assumes a system already tuned for low latency audio work.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?
(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
-
- Established Member
- Posts: 1392
- Joined: Thu Oct 11, 2018 4:13 pm
- Has thanked: 168 times
- Been thanked: 247 times
Re: One month and counting without RT kernel on Arch Linux
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.
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.
-
- Established Member
- Posts: 564
- Joined: Thu Mar 12, 2015 8:41 am
- Has thanked: 44 times
- Been thanked: 8 times
Re: One month and counting without RT kernel on Arch Linux
@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/
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/
-
- Established Member
- Posts: 1392
- Joined: Thu Oct 11, 2018 4:13 pm
- Has thanked: 168 times
- Been thanked: 247 times
Re: One month and counting without RT kernel on Arch Linux
You can install a pre-built RT kernel by adding this unofficial user repository.gmmeapill wrote:...and in the meantime, look what just made it to the AUR: linux-rt 4.19.10