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

Reply
 
Thread Tools Display Modes
Old 08-04-2020, 10:02 AM   #1
xzi_vzs
Human being with feelings
 
Join Date: Mar 2018
Posts: 2
Default Best audio device settings for low latency

Hey guys,

System: Ubuntu 20.04
Reaper version: 6.13
Audio interface: focusrite scarlett solo usb ( gen2 )

Long time REAPER user on Windows, I recently switched to Ubuntu 20.04 and so I did install REAPER on it. I'm currently using ALSA audio system :

Samplerate 48k
Blocksize 512
Bit Depth 32
Periods 3
RT priority 50
Auto suspend PulseAudio : ticked.

Everything seems to be working fine except that I'm concerned about the latency. I can see from the upper right corner this info :

"10/21ms ALSA usb" which seems to be way higher than when it was on windows 10 (~2ms)

I'm using REAPER mainly for mixing / mastering tracks made from a MPC.


Do you guys have any recommendation about what are the best settings for the audio interface on REAPER linux ?

Cheers!
xzi.
xzi_vzs is offline   Reply With Quote
Old 08-04-2020, 10:57 AM   #2
Tobbe
Human being with feelings
 
Tobbe's Avatar
 
Join Date: Sep 2009
Location: Northern Lights
Posts: 749
Default

Hi, and welcome

You can start with installing this little beauty via terminal:
Code:
sudo apt install git
git clone git://github.com/raboof/realtimeconfigquickscan.git
cd realtimeconfigquickscan
perl ./realTimeConfigQuickScan.pl
and see what you need to change/configure. There's links for everything that says: Not Good

Mine look like this. I have one Not Good as you see:
Code:
== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.4.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'powersave' CPU 1: 'powersave' CPU 2: 'powersave' CPU 3: 'powersave'  - not good
Set CPU Governors to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -c <cpunr> -g performance' (Debian/Ubuntu)
See also: http://linuxmusicians.com/viewtopic.php?f=27&t=844
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... 'threadirqs' kernel parameter - good
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
I have my own "Checklist", I've been saving it for a long time and it's working OK for me:

(My setup is at the bottom)

I almost always install lowlatency kernel. To search open terminal and type:
Code:
apt search lowlatency
then I add myself to audio group (sudo usermod -a -G audio USERNAME)

I then to this stuff:

(xed is texteditor for Linux Mint, you might have another)

**sudo xed /etc/security/limits.conf**
@audio - rtprio 95 # maximum realtime priority
@audio - memlock unlimited # maximum locked-in-memory address space (KB)

**sudo xed /etc/sysctl.conf**
vm.swappiness = 10
fs.inotify.max_user_watches = 600000

**Create file: sudo xed /etc/udev/rules.d/40-timer-permissions.rules**
KERNEL=="rtc0", GROUP="audio"
KERNEL=="hpet", GROUP="audio"


**RTIRQ**
sudo apt install rtirq-init

**RTIRQ Status**
----------------
sudo /etc/init.d/rtirq status

http://subversion.ffado.org/wiki/IrqPriorities (for the above rtirq)


**Change settings in sudo xed /etc/default/grub**
------------------------------------------------
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs"
sudo update-grub (reboot)

To get started
__________________
OS: Manjaro KDE Plasma, Reaper For Linux (64Bit) native linux-vst plugins, LSP-Plugins, TpL-Plugins, Harrison's AVA & VST Plugins. Behringer U-PHORIA UMC22.
Tobbe is offline   Reply With Quote
Old 08-04-2020, 11:56 AM   #3
Glennbo
Human being with feelings
 
Glennbo's Avatar
 
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,097
Default

Thanks for posting in this thread Tobbe!

I got to thinking I just built this new machine so I did a, sudo /etc/init.d/rtirq status

and found that the new machine wasn't raising the priority because the device names were different than the old machine, so I changed

RTIRQ_NAME_LIST="ehci_hcd" to RTIRQ_NAME_LIST="xhci_hcd", and suddenly I can run REAPER at 32 samples latency with a project that last week needed 512 to play without issues.

REAPER wasn't even breaking a sweat at 32 samples playing 12 Windows instrument plugins with web browser, email, stock ticker, and other stuff all open at the same time.
__________________
Glennbo
Hear My Music - Click Me!!!
--

Last edited by Glennbo; 08-20-2020 at 07:16 AM.
Glennbo is offline   Reply With Quote
Old 08-04-2020, 05:24 PM   #4
s wave
Human being with feelings
 
Join Date: Sep 2018
Location: Colorado
Posts: 429
Default

Quote:
Originally Posted by Tobbe View Post
Hi, and welcome

You can start with installing this little beauty via terminal:
Code:
sudo apt install git
git clone git://github.com/raboof/realtimeconfigquickscan.git
cd realtimeconfigquickscan
perl ./realTimeConfigQuickScan.pl
and see what you need to change/configure. There's links for everything that says: Not Good

Mine look like this. I have one Not Good as you see:
Code:
== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.4.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'powersave' CPU 1: 'powersave' CPU 2: 'powersave' CPU 3: 'powersave'  - not good
Set CPU Governors to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -c <cpunr> -g performance' (Debian/Ubuntu)
See also: http://linuxmusicians.com/viewtopic.php?f=27&t=844
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... 'threadirqs' kernel parameter - good
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
I have my own "Checklist", I've been saving it for a long time and it's working OK for me:

(My setup is at the bottom)

I almost always install lowlatency kernel. To search open terminal and type:
Code:
apt search lowlatency
then I add myself to audio group (sudo usermod -a -G audio USERNAME)

I then to this stuff:

(xed is texteditor for Linux Mint, you might have another)

**sudo xed /etc/security/limits.conf**
@audio - rtprio 95 # maximum realtime priority
@audio - memlock unlimited # maximum locked-in-memory address space (KB)

**sudo xed /etc/sysctl.conf**
vm.swappiness = 10
fs.inotify.max_user_watches = 600000

**Create file: sudo xed /etc/udev/rules.d/40-timer-permissions.rules**
KERNEL=="rtc0", GROUP="audio"
KERNEL=="hpet", GROUP="audio"


**RTIRQ**
sudo apt install rtirq-init

**RTIRQ Status**
----------------
sudo /etc/init.d/rtirq status

http://subversion.ffado.org/wiki/IrqPriorities (for the above rtirq)


**Change settings in sudo xed /etc/default/grub**
------------------------------------------------
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs"
sudo update-grub (reboot)

To get started
Thanks Tobbe much for posting... this is among the lines of my thought. Great performance check program. It will help many people I think... also thanks to James and Glennbo... There is not too much too it... I do the same, back off on single live tracking - and if you want low latency - just streamline the round trip chain...
s wave is offline   Reply With Quote
Old 08-04-2020, 08:14 PM   #5
xzi_vzs
Human being with feelings
 
Join Date: Mar 2018
Posts: 2
Default

Thanks guys for those very useful information !

Xzi.
xzi_vzs is offline   Reply With Quote
Old 08-05-2020, 04:49 AM   #6
cyrano
Human being with feelings
 
cyrano's Avatar
 
Join Date: Jun 2011
Location: Belgium
Posts: 5,246
Default

Another "Thank you!" for Tobbe. Very interesting.
__________________
In a time of deceit telling the truth is a revolutionary act.
George Orwell
cyrano is offline   Reply With Quote
Old 08-11-2020, 12:20 PM   #7
Jack Winter
Human being with feelings
 
Jack Winter's Avatar
 
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
Default

Quote:
Originally Posted by JamesPeters View Post
Unfortunately it seems the 2i2 has additional latency beyond what it's reporting in Reaper. I figured this out by doing loopback testing. The Realtek device is within 15 samples (1/3 of a millisecond, possibly due to the length of cable I used for testing lol) but the 2i2 is off by a lot more for some reason, and the number of samples keeps changing when I test it repeatedly. I don't know if that's something to do with my system, ALSA, or just the 2i2 itself. It's still ok, but perhaps out by a few milliseconds.
The extra latency from the Realtek device is probably from a hardware buffer, most likely 8 samples in and 7 Samples out. In the case of USB it kind of sucks on Linux, because you will always get a variable extra latency. Different every time you start it up. I think this is because we use the generic USB Class 2.0 Audio instead of a device specific driver, I also suspect that it's because of very conservative setting in the USB driver. It's quite annoying and the amount of hidden latency gets higher the bigger the buffer used.

USB will always give a higher real life latency than a PCI card just due to the design. Some devices like for instance RME on Windows replace the normal USB stack with a proprietary protocol.
__________________
Reaper for Linux Documentation (WIP). Software: Archlinux/KDE, Fabfilter FX, Komplete 8, Nebula, Schwa/Stillwell, T-racks Max/Amplitube/SVX, etc. Gear: i7-2600k/4700HQ/16GB, RME Multiface/Babyface, Behringer X32, Genelec 8040, etc. :)
Jack Winter is offline   Reply With Quote
Old 08-11-2020, 02:46 PM   #8
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
Default

Thanks for the info, Jack. It's good to know it's not a problem with the device. I'll probably stick to using the Realtek device and a small mixer since it's more convenient for me anyway.
JamesPeters 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 02:41 AM.


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