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

Reply
 
Thread Tools Display Modes
Old 02-02-2022, 01:08 AM   #1
chlowden
Human being with feelings
 
Join Date: Oct 2021
Posts: 14
Default Managing latency - Ubuntu 20.4

Hello
I am really trying to understand how to trouble shoot record / return latency issues. The set up I have is as follows:

HP Elitebook 1040 16Gigs RAM, 512GB SSD
Behringer UMC204HD

Ubuntu 20.4

When I open Reaper, I get at least a 1 second delay from the time I microphone record time to the moment i hear return. This means that the recorded elements are late in the timeline etc. (It also blocks the audio from other apps that are open like firefox)
I have tried the latency pref in automatic and that does not correct it (probably because the sound card is using the core audio and therefore is not recognised). I have pushed and pulled the manual latency prefs and don't get any changes at all. I have tried Pulse Audio, that makes things worse and am currently using Alsa.
There is a great mystery to me as the management of sample rates in Linux. It seems rather complicated to me and I don't know if this has an impact.
Yet when I use Audacity with Alsa in with the same config. I have no latency at all and I just use the Audacity default prefs.
I don't pretend to understand Linux audio, so any Reaper troubleshooting advice would be most welcome.
Thank you
chlowden is offline   Reply With Quote
Old 02-02-2022, 02:44 AM   #2
norbury brook
Human being with feelings
 
norbury brook's Avatar
 
Join Date: Mar 2007
Location: London UK
Posts: 3,378
Default

Have you set up a real time Kernel, done the obvious set up things with power management?


probably best to use ALSA as the audio driver and set your buffer to 64 samples.


You should have no issues then.


M
__________________
https://www.marcuscliffe.com/
norbury brook is offline   Reply With Quote
Old 02-02-2022, 09:58 AM   #3
chlowden
Human being with feelings
 
Join Date: Oct 2021
Posts: 14
Default

Thanks for replying. What do you mean for a "real time kernel"?
Thanks
chlowden is offline   Reply With Quote
Old 02-02-2022, 10:17 AM   #4
Glennbo
Human being with feelings
 
Glennbo's Avatar
 
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
Default

Quote:
Originally Posted by chlowden View Post
Hello
I am really trying to understand how to trouble shoot record / return latency issues. The set up I have is as follows:

HP Elitebook 1040 16Gigs RAM, 512GB SSD
Behringer UMC204HD

Ubuntu 20.4

When I open Reaper, I get at least a 1 second delay from the time I microphone record time to the moment i hear return.
First of all, do what norbury brook suggested by setting the audio panel in REAPER to use ALSA and 64 samples. I use the UMC1820 and have REAPER set like this on the audio panel.



Another thing that can make a BIG difference is to edit the file,

/etc/security/limits.conf

and add these two lines, replacing USER with your user name.

@USER - rtprio 98
@USER - memlock unlimited

After adding those two lines you will need to either log out and back in or reboot for the changes to take effect. What those lines do is give you permissions to run apps at 98% real time priority, and unlimited access to memory.
__________________
Glennbo
Hear My Music - Click Me!!!
--
Glennbo is offline   Reply With Quote
Old 02-02-2022, 09:06 PM   #5
audiojunkie
Human being with feelings
 
audiojunkie's Avatar
 
Join Date: Nov 2011
Posts: 971
Default

In addition to what has been mentioned above, The latest kernel has usb latency improvements that you won’t get from Ubuntu 20.04. You may have better results with Manjaro.
audiojunkie is offline   Reply With Quote
Old 02-03-2022, 12:25 AM   #6
chlowden
Human being with feelings
 
Join Date: Oct 2021
Posts: 14
Default

Thank you all for your suggestions.

I presume that is the kernel low latency install:

sudo apt install linux-lowlatency-hwe-20.04 -y
chlowden is offline   Reply With Quote
Old 02-03-2022, 12:28 AM   #7
chlowden
Human being with feelings
 
Join Date: Oct 2021
Posts: 14
Default

Quote:
Originally Posted by Glennbo View Post
First of all, do what norbury brook suggested by setting the audio panel in REAPER to use ALSA and 64 samples. I use the UMC1820 and have REAPER set like this on the audio panel.



Another thing that can make a BIG difference is to edit the file,

/etc/security/limits.conf

and add these two lines, replacing USER with your user name.

@USER - rtprio 98
@USER - memlock unlimited

After adding those two lines you will need to either log out and back in or reboot for the changes to take effect. What those lines do is give you permissions to run apps at 98% real time priority, and unlimited access to memory.
I have done the above and isntalled the low latency apt. First tests show that latency has been radically reduced. This is very promising.
Many, many thanks for all your suggestions.
chlowden is offline   Reply With Quote
Old 02-03-2022, 07:58 AM   #8
Glennbo
Human being with feelings
 
Glennbo's Avatar
 
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
Default

Quote:
Originally Posted by chlowden View Post
I have done the above and isntalled the low latency apt. First tests show that latency has been radically reduced. This is very promising.
Many, many thanks for all your suggestions.
Veddy cool! If you edited the file limits.conf, to be sure it is taking effect, issue the command ulimit -a which will come back with a bunch of stuff, but the important lines are these two.

max locked memory (kbytes, -l) unlimited
real-time priority (-r) 98
__________________
Glennbo
Hear My Music - Click Me!!!
--
Glennbo is offline   Reply With Quote
Old 02-03-2022, 02:29 PM   #9
chlowden
Human being with feelings
 
Join Date: Oct 2021
Posts: 14
Default

unlimit - a
confirms what you wrote. This info should be shared. It has definitely helped my performance. Many thanks
chlowden is offline   Reply With Quote
Old 02-03-2022, 03:14 PM   #10
Glennbo
Human being with feelings
 
Glennbo's Avatar
 
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
Default

Quote:
Originally Posted by chlowden View Post
unlimit - a
confirms what you wrote. This info should be shared. It has definitely helped my performance. Many thanks
Glad your system is starting to perform. That info has been posted in multiple threads, but finding it might take a minute.
__________________
Glennbo
Hear My Music - Click Me!!!
--
Glennbo is offline   Reply With Quote
Old 02-07-2022, 11:08 AM   #11
FransK
Human being with feelings
 
Join Date: Feb 2022
Location: Netherlands
Posts: 2
Default

Tried the Ubuntu Studio distribution already?
It is geared towards multimedia production and has a low-latency kernel by default.
FransK is offline   Reply With Quote
Old 02-07-2022, 03:22 PM   #12
chlowden
Human being with feelings
 
Join Date: Oct 2021
Posts: 14
Default

Quote:
Originally Posted by FransK View Post
Tried the Ubuntu Studio distribution already?
It is geared towards multimedia production and has a low-latency kernel by default.
I will take another look at this distro. It certainly has some advantages. Many thanks
chlowden is offline   Reply With Quote
Old 02-07-2022, 05:03 PM   #13
mcoyle
Human being with feelings
 
mcoyle's Avatar
 
Join Date: Jan 2022
Location: Kalamazoo, MI
Posts: 285
Default UbuntuStudio....

Quote:
Originally Posted by chlowden View Post
I will take another look at this distro. It certainly has some advantages. Many thanks
I run Ubuntu 21.10. I wanted to see if Ubuntu Studio's lowlatency kernal would make a differece, but I was afraid I'd bork my system, so....

Just last night, I installed Ubuntu 21.10 on a spare partition, used the Ubuntu Studio Installer to install the lowlatency kernel, and ran some tests. I got my input latency down to 1.3 ms from 5. Very nice.

Then I rebooted into my primary partition and installed the faster kernel with the same results.

https://ubuntustudio.org/ubuntu-studio-installer/
__________________
Audio Post Engineer: JennAudio.com
Adjunct Faculty: Columbia College Chicago - Retired!
mcoyle is offline   Reply With Quote
Old 02-08-2022, 02:44 AM   #14
norbury brook
Human being with feelings
 
norbury brook's Avatar
 
Join Date: Mar 2007
Location: London UK
Posts: 3,378
Default

what would people say are the pro's and cons of Ubuntu Studio over Manjaro?


From my brief foray into Linux on manjarao(arch) most of the plugins/programs that have a native linix version seem to be debian packages so that would give a newcomer like me an easier tine installing things.



M
__________________
https://www.marcuscliffe.com/
norbury brook is offline   Reply With Quote
Old 02-08-2022, 06:37 AM   #15
The Kid
Human being with feelings
 
Join Date: Jun 2021
Posts: 1,093
Default

Quote:
Originally Posted by norbury brook View Post
what would people say are the pro's and cons of Ubuntu Studio over Manjaro?


From my brief foray into Linux on manjarao(arch) most of the plugins/programs that have a native linix version seem to be debian packages so that would give a newcomer like me an easier tine installing things.



M
Ubuntu Studio is bloated, tuning Ubuntu or Mint is better IMHO
The Kid is offline   Reply With Quote
Old 02-08-2022, 07:58 AM   #16
Glennbo
Human being with feelings
 
Glennbo's Avatar
 
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
Default

Quote:
Originally Posted by The Kid View Post
Ubuntu Studio is bloated, tuning Ubuntu or Mint is better IMHO
IMHO Xubuntu is the 'Buntu flavor for audio if you aren't doing Manjaro. Xubuntu is Ubuntu without the flashy CPU consuming desktop. It uses the very light but still configurable XFCE desktop.

I used Xubuntu for almost three years and switched to Manjaro because I built a new Ryzen 3700X with PCIe 4.0 sockets for NVMe M.2 drives, and Manjaro is more updated than any of the 'Buntu flavors.

I was concerned that the kernel in Xubuntu might not know how to deal with my new hardware properly, so I switched. With Xubuntu I only needed to install the low latency kernel, and set the two lines in limits.conf for realtime priority and unlimited memory. The only difference with Manjaro is it installs stock with the low latency kernel, but limits.conf still needs a tweak.
__________________
Glennbo
Hear My Music - Click Me!!!
--
Glennbo is offline   Reply With Quote
Old 02-08-2022, 09:14 AM   #17
domzy
Human being with feelings
 
Join Date: Feb 2017
Posts: 4,823
Default

Sorry for butting in.
I too have been experimenting with Linux recently, with the aim of ditching windows for audio production.
i've been using ubuntu studio (20.0.4?) and finding it very confusing to get audio configured & working properly.
Do you think manjaro will be any easier for me?
I don't really understand ALSA / Jack etc. and i use a variety of PCI & firewire interfaces which i have difficulties trying to select / enable in Reaper.
domzy is offline   Reply With Quote
Old 02-08-2022, 09:30 AM   #18
Glennbo
Human being with feelings
 
Glennbo's Avatar
 
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
Default

Quote:
Originally Posted by domzy View Post
Sorry for butting in.
I too have been experimenting with Linux recently, with the aim of ditching windows for audio production.
i've been using ubuntu studio (20.0.4?) and finding it very confusing to get audio configured & working properly.
Do you think manjaro will be any easier for me?
They are not that different. Manjaro is just more current. IOW, when a fix gets implemented into the kernel, Manjaro users will see it long before 'Buntu users ever get it. What I did when considering moving to Manjaro was to create a live disk and install REAPER while booted up on the live disk, and then try it with my UMC1820/ADA8200 audio interfaces. They worked fine so in the next couple days I installed Manjaro for real and haven't looked back.

Quote:
I don't really understand ALSA / Jack etc. and i use a variety of PCI & firewire interfaces which i have difficulties trying to select / enable in Reaper.
ALSA is the native sound system in Linux and the one to use in REAPER. JACK is a layer that runs on top of ALSA, that lets multiple programs send and receive audio from each other, similar to how REAPER's ReaRoute ASIO driver works.

When you select ALSA in REAPER, you also need to select input and output devices, by clicking the down arrows on the selection lists of the audio configuration panel.
__________________
Glennbo
Hear My Music - Click Me!!!
--
Glennbo is offline   Reply With Quote
Old 02-08-2022, 09:53 AM   #19
domzy
Human being with feelings
 
Join Date: Feb 2017
Posts: 4,823
Default

Quote:
Originally Posted by Glennbo View Post

ALSA is the native sound system in Linux and the one to use in REAPER. JACK is a layer that runs on top of ALSA, that lets multiple programs send and receive audio from each other, similar to how REAPER's ReaRoute ASIO driver works.

When you select ALSA in REAPER, you also need to select input and output devices, by clicking the down arrows on the selection lists of the audio configuration panel.
Yeah, thanks. I kind of figured out that i needed to stop Jack from running if wanted to use ALSA in reaper = is that right?
I was having trouble distinguishing what's what in the input / output lists -just lots of non-descriptive names etc. but nothing i shouldn't be able to iron out.

i am just fumbling around at the moment - i will make a decision soon about which distro / machine / interface combo to work with more seriously.

Despite me getting very confused by the routing & mixing apps, initial tests seem to show that Echo & RME interfaces work OK. I'm sure i can optimise them & lower the latency when i work out what i'm doing.
domzy is offline   Reply With Quote
Old 02-08-2022, 10:09 AM   #20
Glennbo
Human being with feelings
 
Glennbo's Avatar
 
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
Default

Quote:
Originally Posted by domzy View Post
Yeah, thanks. I kind of figured out that i needed to stop Jack from running if wanted to use ALSA in reaper = is that right?
I was having trouble distinguishing what's what in the input / output lists -just lots of non-descriptive names etc. but nothing i shouldn't be able to iron out.

i am just fumbling around at the moment - i will make a decision soon about which distro / machine / interface combo to work with more seriously.

Despite me getting very confused by the routing & mixing apps, initial tests seem to show that Echo & RME interfaces work OK. I'm sure i can optimise them & lower the latency when i work out what i'm doing.
Yeah, if JACK is running, ASLA won't be available to REAPER. Here's a diagram of how the various audio systems are layered between the physical hardware and the app trying to access it. Linux is difficult only because you aren't used to it. If you had zero experience in Windows, it would be about the same learning curve.

__________________
Glennbo
Hear My Music - Click Me!!!
--
Glennbo is offline   Reply With Quote
Old 02-08-2022, 10:30 AM   #21
domzy
Human being with feelings
 
Join Date: Feb 2017
Posts: 4,823
Default

Thanks, yeah i know that. I know my way around Windows & audio stuff pretty well through many years of hands-on experience but my general computer skills aren't very good.
I know i'll have some serious learning to do to get where i want to be on Linux, it's just that i'm very lazy and if there is a distro that is much "easier" than others i'd be interested.
domzy is offline   Reply With Quote
Old 02-08-2022, 03:41 PM   #22
audiojunkie
Human being with feelings
 
audiojunkie's Avatar
 
Join Date: Nov 2011
Posts: 971
Default

Quote:
Originally Posted by domzy View Post
Thanks, yeah i know that. I know my way around Windows & audio stuff pretty well through many years of hands-on experience but my general computer skills aren't very good.
I know i'll have some serious learning to do to get where i want to be on Linux, it's just that i'm very lazy and if there is a distro that is much "easier" than others i'd be interested.
The three "easy" distros/distro families I would recommend, like most others here would, are (in this order):

AV Linux -- http://www.bandshed.net/avlinux/ AV Linux is more of an "appliance" installation. You use what it includes and don't worry about configurations or modifications. It's a great way to start learning what's available on Linux

Ubuntu/Ubuntu Studio --Ubuntu Studio or Ubuntu with Ubuntu studio components--all components for Ubuntu Studio, including the low latency kernel can all be installed through your favorit regular Ubuntu flavor, so you can choose the Desktop Environment you prefer, and won't need the added software bloat of Ubuntu Studio if you don't want it.

Arch Based Distro -- You can use what you want here, but Manjaro is probably the easiest. You do have to do some configuring, but you benefit from access to the Arch User Repository, which contains just about everything the Linux world has to offer.

Last edited by audiojunkie; 02-08-2022 at 03:51 PM.
audiojunkie is offline   Reply With Quote
Old 02-08-2022, 06:26 PM   #23
domzy
Human being with feelings
 
Join Date: Feb 2017
Posts: 4,823
Default

cheers. i'm downloading manjaro and i'll give that a spin at some stage to see how it compares to ubuntu.
To be honest i probably don't need much more than Reaper and a few plugins at the moment, it's all just about dipping my toe in rather than making a full-blown switch of OS.
domzy is offline   Reply With Quote
Old 02-08-2022, 06:26 PM   #24
4duhwinnn
Human being with feelings
 
Join Date: Mar 2017
Posts: 859
Default

Quote:
Originally Posted by domzy View Post
Thanks, yeah i know that. I know my way around Windows & audio stuff pretty well through many years of hands-on experience but my general computer skills aren't very good.
I know i'll have some serious learning to do to get where i want to be on Linux, it's just that i'm very lazy and if there is a distro that is much "easier" than others i'd be interested.
The freedom to customize linux will really damage your laziness.
Tread lightly! The previous suggestion is a straight arrow.
In the long run, having all three of those at once,
by way of external drives, will let you set up systems
based on specific needs/desires that you might uncover.
Take your time, it passes fast enough without our help!

Make sure your toe can reach the record button!
Cheers
__________________
Songs I've made with linux and Reaper, a qwerty forehead danger zone:
https://www.youtube.com/watch?v=NtlO...RvGI8-_TqqZ7ij
https://franklincheney.bandcamp.com/
4duhwinnn is offline   Reply With Quote
Old 11-07-2022, 03:32 PM   #25
Okturion
Human being with feelings
 
Join Date: Feb 2018
Posts: 1
Default

I also have a latency issue in reaper.
When I play Synth, I can hear the sound around 0,2 seconds after the key hit.
I changed the driver in Reaper from Pulse to ALSA.
But after that I could not hear anything.
As a MIDI Input I chose my connected M-Audio Keyboard.
Strange. Do you know what could create this problem?
Okturion is offline   Reply With Quote
Old 11-07-2022, 10:59 PM   #26
gauderbock
Human being with feelings
 
Join Date: Nov 2020
Location: Alps
Posts: 28
Default

Try installing the midisport-firmware package if not already installed. It's not needed for all M-Audio models but it's worth a punt.
gauderbock is offline   Reply With Quote
Old 11-08-2022, 03:00 AM   #27
/AND/
Human being with feelings
 
Join Date: Aug 2022
Posts: 717
Default

I see many recommending Ubuntu Studio or Manjaro here, but I'd share my own experience. I've tried them all, and stuck with Fedora (Silverblue but regular Workstation works great, probably even better for audio).

The thing is, Fedora includes PipeWire by default which MASSIVELY improves low-latency audio and stability. Never had any real issues with it (except when putting my computer to sleep and waking it up, it sometimes requires a restart of PipeWire's service to avoid cracks, but that's it).

I don't even use an RT (real-time) kernel, yet I get 3 to 6 ms latencies with no issues.

Overall, for my use case, Fedora has been the best distro.

If you are unwilling to try Fedora what I recommend is you install PipeWire for your system, and attest to the awesomeness.
/AND/ 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 05:21 AM.


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