Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Linux

Reply
 
Thread Tools Display Modes
Old 01-28-2019, 11:48 AM   #1
LieMfB
Human being with feelings
 
Join Date: Jan 2019
Posts: 17
Default How difficult could it be to get low enough latency on Linux?

This is not directly related to Reaper, but I don't know where else to ask right now.

I've just migrated to Reaper in Debian Linux, after using Adobe Audition 1.5 (!) on Windows 7 for years.

It's taking shape, but what drives me crazy is that I can't seem to get good latency. To quote a user at Reddit, "I do the research, buy the recommended gear, follow the wikis and the how-tos, and scour the internet for just about every "no more XRUNs" tips I can find. And still, there I am grooving in the midst of an awesome take and SPLARBPTTTTTTTTT along comes and XRUN and ruins it."

I'm using an M-Audio Delta 66 PCI soundcard which have always worked flawlessly in both Linux and Windows. But now when using jack, I can't set the buffer (frames/period) to smaller than 1024 (42 ms lacency) without getting xruns. Never had a problem with it in Windows (ASIO).

Currently testing without Reaper, just using jackd/qjackctl and qsynth/fluidsynth with my midi keyboard playing a simple piano soundfont.

I've gone through various checklists, such as this one:
https://wiki.linuxaudio.org/wiki/system_configuration

... but to no avail.

Is it really worth it trying a different kernel?
Currently running a newly installed Debian 9 with regular kernel 4.9.130.

Any help greatly appreciated!
LieMfB is offline   Reply With Quote
Old 01-28-2019, 01:11 PM   #2
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
Default

Are you running the latest kernel? They're better now for low latency. I'm not using a "low latency kernel" or "realtime kernel" (see my sig for my system info) and I'm getting latency as good as or better than in Windows. No xruns. It's stable and it's noticeably more CPU efficient in apples-to-apples tests of the DAW.

Did you set your CPU power governor so that your CPU won't throttle down? That's a common step people overlook. It's like choosing the "high performance" power profile in Windows (one very important part of it anyway), a very common thing people need to do for DAW use. I used cpufrequtils to do this and set a startup command to make it persist (it's set to "performance").
JamesPeters is offline   Reply With Quote
Old 01-28-2019, 01:51 PM   #3
LieMfB
Human being with feelings
 
Join Date: Jan 2019
Posts: 17
Default

Thanks for the suggestions.
At first I was thinking that getting a new kernel probably wouldn't help, but right before you replied, I looked more into the "low latency kernel" thing and tried installing the Liquorix low latency kernel (https://liquirix.net) - and voilà - the xruns are gone!

I did test the CPU performance setting briefly yesterday but didn't see any improvement. But I'm not completely sure if I did it properly.

Anyway, I'm very happy now with the low lacency kernel, currently running jack at 128 frames/period which gives a nice 5 ms latency. (Actually, qjackctl does report the odd xrun now and then at this latency, but it doesn't produce any noise; and if it does I can always raise it to 256 at least temporarily.)
LieMfB is offline   Reply With Quote
Old 01-28-2019, 02:46 PM   #4
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
Default

Liquorix cost me more CPU but didn't lower my latency (or allow me to set lower buffer blocksize/periods), so I went back to the stock kernel that MX Linux uses (4.19, Debian Stretch). Then again my blocksize is 128 samples, and I run 4 blocks (at 44.1KHz), a total of 512 samples. I can reduce that by one block (384 samples total) and it's fine too, but for stability right up to 100% CPU use, 4 blocks of 128 samples works best for me. This audio card never could get extremely low latency in Windows (it's no RME card), so the fact it does this well in Linux is good for me. It's 11ms round-trip (measured too, so it's confirmed).
JamesPeters is offline   Reply With Quote
Old 01-28-2019, 11:23 PM   #5
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

Quote:
Originally Posted by LieMfB View Post
This is not directly related to Reaper, but I don't know where else to ask right now.

I've just migrated to Reaper in Debian Linux, after using Adobe Audition 1.5 (!) on Windows 7 for years.

It's taking shape, but what drives me crazy is that I can't seem to get good latency. To quote a user at Reddit, "I do the research, buy the recommended gear, follow the wikis and the how-tos, and scour the internet for just about every "no more XRUNs" tips I can find. And still, there I am grooving in the midst of an awesome take and SPLARBPTTTTTTTTT along comes and XRUN and ruins it."

I'm using an M-Audio Delta 66 PCI soundcard which have always worked flawlessly in both Linux and Windows. But now when using jack, I can't set the buffer (frames/period) to smaller than 1024 (42 ms lacency) without getting xruns. Never had a problem with it in Windows (ASIO).

Currently testing without Reaper, just using jackd/qjackctl and qsynth/fluidsynth with my midi keyboard playing a simple piano soundfont.

I've gone through various checklists, such as this one:
https://wiki.linuxaudio.org/wiki/system_configuration

... but to no avail.

Is it really worth it trying a different kernel?
Currently running a newly installed Debian 9 with regular kernel 4.9.130.

Any help greatly appreciated!
I think the M-Audio PCI cards can get pretty good latency with Linux.

I have a M-Audio Audiophile 2496 and a M-Audio Revolution 7.1 and the latency is way below 1024.

That's with native vst's, windows vst's are another thing.

It also assumes there are no hardware issues.

I just install the Debian rt kernel and install rtirq-init.

The Debian rt kernel can be installed using something like

uname -a (to get the current kernel version)

then search for kernels using

aptitude search linux-image

and

aptitude search linux-headers

and install a similar kernel version that has rt in it's name (linux-image-rt-amd64 and linux-headers-rt-amd64 )

Last edited by osxmidi; 02-22-2019 at 12:28 AM.
osxmidi is offline   Reply With Quote
Old 01-29-2019, 02:50 AM   #6
calimerox
Human being with feelings
 
Join Date: Nov 2018
Posts: 63
Default

additionally you can try running the kxstudio startup config file.. it does a lot of things already suggested above, but worth a try.

https://kxstudio.linuxaudio.org/Repositories
calimerox is offline   Reply With Quote
Old 01-30-2019, 11:03 AM   #7
LieMfB
Human being with feelings
 
Join Date: Jan 2019
Posts: 17
Default

Thanks for the suggestions everybody.

Seems like people's experiences with latency in Linux vary quite a lot. For some, the "low latency" kernel really makes a difference, and for others not. The real time kernels, I've heard, have a lower guaranteed maximum latency but worse average latency than the low latency type, and supposedly more suited for industrial applications, but obviously work for some musicians.
LieMfB is offline   Reply With Quote
Old 01-30-2019, 04:01 PM   #8
4duhwinnn
Human being with feelings
 
Join Date: Mar 2017
Posts: 861
Default

Two numeric settings values to insure,
the first in /etc/security/limits.config

maximum priority is 99, choose slightly lower
to 95 or so if you get any repeatable issues during normal use

In qjackctl, the maximum priority is 89, IF you
chose 99 in limits.config, lower that proportionately,
if you lower the value in limits.config.

I use 95 in limits.config and 70 in qjackctl
and use a stock Mint 18 kernel with a pci mAudio card.
Good luck!
the limits.config entry will look something like this,
but with spaces between the values

@audio rtprio 99

Last edited by 4duhwinnn; 01-30-2019 at 04:08 PM.
4duhwinnn is offline   Reply With Quote
Old 01-31-2019, 04:40 AM   #9
LieMfB
Human being with feelings
 
Join Date: Jan 2019
Posts: 17
Default

Thanks for the tip. I recall seeing those settings, but I'll experiment with them if I run into more xruns.

I also realize that before migrating to Reaper, I was using recording techniques that were more plain with no midi tracks, only wav tracks, no instrument plugins, just a few effects, in the DAW. This meant that CPU and soundcard performance requirements weren't quite as high as they are now when I'm doing more processing in the DAW.
LieMfB is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.