help me reduce latency

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

Post Reply
User avatar
lyth
Established Member
Posts: 11
Joined: Wed Dec 05, 2018 2:58 pm
Location: Italy

help me reduce latency

Post by lyth »

Hi. I'm on a laptop with i5-4200U, 8GB of ram and the steinberg ur22mkii audio interface. If I set jack to sample rate 48000, frames/period 512 and periods/buffer 2 I have no xruns and I can play whatever I want. But with this settings the latency is unacceptable while playing with software instruments.

I also compiled linux-4.18.16-rt9 but I have noticed no difference at all. What can I change to reduce the latency?

User avatar
khz
Established Member
Posts: 1443
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: help me reduce latency

Post by khz »

Do you have the entry in the limits.conf https://wiki.linuxaudio.org/wiki/system ... faudioconf?
The realTimeConfigQuickScan could also be helpful https://wiki.linuxaudio.org/wiki/system ... #quickscan (

Code: Select all

Yours@LAW ~/git/realtimeconfigquickscan $ perl -I ./ ./realTimeConfigQuickScan.pl
).
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
  • I don't care about the freedom of speech because I have nothing to say.

User avatar
bluebell
Established Member
Posts: 1463
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: help me reduce latency

Post by bluebell »

lyth wrote:Hi. I'm on a laptop with i5-4200U, 8GB of ram and the steinberg ur22mkii audio interface. If I set jack to sample rate 48000, frames/period 512 and periods/buffer 2 I have no xruns and I can play whatever I want. But with this settings the latency is unacceptable while playing with software instruments.

I also compiled linux-4.18.16-rt9 but I have noticed no difference at all. What can I change to reduce the latency?
- Try a lowlatency kernel. It performs better on my machine than a realtime kernel.
- Try different USB-ports. I have machines where it matters.
Linux – MOTU UltraLite AVB – Qtractor – https://soundcloud.com/suedwestlicht

User avatar
lyth
Established Member
Posts: 11
Joined: Wed Dec 05, 2018 2:58 pm
Location: Italy

Re: help me reduce latency

Post by lyth »

Thank you all for replying. I tried your suggestions with no luck. I've noticed that I experience xrun only when the cpu hits the 35% load. I reach that cpu load only if I'm using windows vst or plugins like TyrrelN6.

I think it may be a cpu limitation, does it make sense?

User avatar
khz
Established Member
Posts: 1443
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: help me reduce latency

Post by khz »

lyth wrote:cpu hits the 35% load
Did you set the CPU to "performance"?

Code: Select all

cpufreq-set -c 0 -g performance
and -c 1, 2, 3, 4, 5, ... viewtopic.php?f=27&t=844

You have the entries in limits.conf? And do the realTimeConfigQuickScan. viewtopic.php?p=100147#p100147
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
  • I don't care about the freedom of speech because I have nothing to say.

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

Re: help me reduce latency

Post by Death »

You do have Jack setup, right? I have a more powerful computer and I normally use 44.1khz and 512 sample buffer with the low latency kernel. My latency is reported to be 11.6ms, although I might find it's a little higher if I did a loopback test, not sure. Anyway, if I want lower latency then I can lower the sample size but it will quite easily result in xruns if there's already a little bit of stuff going on in the project. In that situation I'd have to just disable some sounds while I play in my part.

Remember that plugins can cause extra latency. Try loading a blank project and see what you get. Then it might just be a case of disabling some plugins while you play. I have some really bad offenders that I always have to disable when recording.

I'm guessing you already know the next two things but I'll put them here anyway. To install the low latency kernel the command should be

Code: Select all

sudo apt-get install linux-lowlatency
Make sure to select it as your active kernel afterwards then reboot the computer. You can then type this in a terminal to see which kernel you're using

Code: Select all

uname -a
Btw, what is your reported latency via the Jack server or Cadence?

User avatar
lyth
Established Member
Posts: 11
Joined: Wed Dec 05, 2018 2:58 pm
Location: Italy

Re: help me reduce latency

Post by lyth »

Hi every one and thank you for your answers. I kinda of solve it, I had to change some parameter in the advanced section of qjackctl. this page https://help.ubuntu.com/community/HowTo ... figuration was indeed very helpful, but I had to adapt it to my situation.
Btw, what is your reported latency via the Jack server or Cadence?
When I started the thread was 21 ms, after doing what khz suggested i was able to go to 16ms, now i can play with 8ms, wich it is perfect for my use.
Now I can play really anything and I ear crackling sound only when DSP reaches 100%, and if I check soft mode even at 100% doesn't give any xrun but only the sounds cracks.

Now the questions is, DSP is some specific part of the cpu or it depends on the audio interface? Or maybe it reaches some other limits?

User avatar
bluebell
Established Member
Posts: 1463
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: help me reduce latency

Post by bluebell »

lyth wrote: Now the questions is, DSP is some specific part of the cpu or it depends on the audio interface? Or maybe it reaches some other limits?
It's a part of the CPU time. That part that's needed for DSP calculations. Plugins eat it.

If you user bigger buffer sizes there are less contect switches and less overhead, so you can manage to run more CPU at tha price of more latency.

If you want a perfect audio PC then go for the fastest CPU you can get. Most important for many jack applications is the single thread performance. Although jack2 can distribute the load of different clients some DAWs are a single clients (e.g. Qtractor). Most profit from many cores get modular setups. I prefer everything in one box so I choose CPUs by their single tread performance, not be their number of cores.
Linux – MOTU UltraLite AVB – Qtractor – https://soundcloud.com/suedwestlicht

Post Reply