Latency decreasing after each measurement?

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

Post Reply
foul_owl
Established Member
Posts: 18
Joined: Thu Jul 21, 2011 9:56 pm
Been thanked: 2 times

Latency decreasing after each measurement?

Post by foul_owl »

I feel like I'm going insane. I'm trying to set manual latency compensation in Reaper, as the automatic latency detection isn't working properly.

Using a loopback cable, I'm playing back a click and recording the result to a new track at the same time.

Starting with the following settings:
44100 kHz
24 bit
512 blocksize
4 periods
40 pri

I get the following measurements (in samples):

2405
2395
2350
2315
2275
2230
2195
2155
2110

Is there a bug here? What exactly is going on? Why is the latency continually decreasing?

I was curious if it would ever reach zero, so I recorded over and over and over. After about 50 more measurements, suddenly the latency jumped back up to around 2400.

OS is Debian 10. Audio driver is ALSA. (Using pulseaudio for my system's regular sound card, if that matters)
foul_owl
Established Member
Posts: 18
Joined: Thu Jul 21, 2011 9:56 pm
Been thanked: 2 times

Re: Latency decreasing after each measurement?

Post by foul_owl »

So...this looks like it's not a problem with Reaper. I'm having the same issue with Ardour.

"Detected roundtrip latency" decreases every time I measure it.

2344
2339
2334
2329
2324
2319

etc.

Has anyone noticed this bug before?
foul_owl
Established Member
Posts: 18
Joined: Thu Jul 21, 2011 9:56 pm
Been thanked: 2 times

Re: Latency decreasing after each measurement?

Post by foul_owl »

I tried on two Debian 10 systems with both ardour and reaper, with both alsa and jack.

Same issue in all 8 test cases.
foul_owl
Established Member
Posts: 18
Joined: Thu Jul 21, 2011 9:56 pm
Been thanked: 2 times

Re: Latency decreasing after each measurement?

Post by foul_owl »

I didn't realize there was a RT kernel (different from low latency kernel)

I installed the RT kernel and I get *zero* latency variation with ardour now, but I still get some small amount of latency variation in Reaper.

So there are multiple causes to this issue occurring simultaneously it seems.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Latency decreasing after each measurement?

Post by CrocoDuck »

The latency cannot be zero, see here: viewtopic.php?p=82607#p82607

As for the periodic variation of it: that's intriguing. The fact that it depends on software makes me think it is somehow related to DSP load. I did see latency not being constant in the past, but more often in a random way. Very often its value changes when dropouts (xruns) happen (not sure which one is the cause or the consequence). I think more than a bug is just the nature of computer audio: I did see the same kind of things happening on MacOS.

By the way, you can use also this to measure latency: https://lsp-plug.in/?page=manuals&section=latency_meter

It uses a different technique which will give you an averaged latency across all frequencies up to half the sample rate (the analogue stages of your soundcard have a frequency dependent group delay, so latency ends up depending also on frequency thanks to this. Good soundcards are phase linear though: same latency at all frequencies, at least in the operational bandwidth).
tseaver
Established Member
Posts: 398
Joined: Mon Mar 13, 2017 6:07 am
Has thanked: 11 times
Been thanked: 98 times

Re: Latency decreasing after each measurement?

Post by tseaver »

Perhaps CPU governor is kicking in here?
Ubuntu, Mixbus32C; acoustic blues / country / jazz
JamesPeters
Established Member
Posts: 188
Joined: Fri Jun 29, 2018 6:35 pm
Has thanked: 8 times
Been thanked: 15 times

Re: Latency decreasing after each measurement?

Post by JamesPeters »

Baggypants
Established Member
Posts: 188
Joined: Fri Jul 31, 2015 11:28 pm
Has thanked: 14 times
Been thanked: 8 times

Re: Latency decreasing after each measurement?

Post by Baggypants »

CrocoDuck wrote: Tue Oct 27, 2020 10:00 am The latency cannot be zero, see here: viewtopic.php?p=82607#p82607
The latency variation (i.e. jitter) went to zero.
foul_owl
Established Member
Posts: 18
Joined: Thu Jul 21, 2011 9:56 pm
Been thanked: 2 times

Re: Latency decreasing after each measurement?

Post by foul_owl »

Unfortunately I have discovered that the rt kernel cannot be used with nvidia video cards.

So I am now considering liquorix, but is liquorix for low latency or real time?

My issue is I need real time, not low latency.

Anyone using liquorix?
JamesPeters
Established Member
Posts: 188
Joined: Fri Jun 29, 2018 6:35 pm
Has thanked: 8 times
Been thanked: 15 times

Re: Latency decreasing after each measurement?

Post by JamesPeters »

foul_owl wrote: Thu Dec 10, 2020 11:48 pm Unfortunately I have discovered that the rt kernel cannot be used with nvidia video cards.
I have been able to use the low latency kernel in the Ubuntu repo as well as real-time kernels in the Manjaro repo (possibly also real-time kernel in MX Linux's repo, but I can't recall) while using the proprietary nvidia driver. Ubuntu and variants tend to add a rt module for the nvidia driver automatically when you install the low latency kernel, but the other distros didn't and so I had to figure that out.

You'll need to choose the nvidia rt module which is meant for the kernel version as well as the nvidia driver version. So be aware of the package name when you're looking through your software manager, since the package name refers to both those things.
foul_owl
Established Member
Posts: 18
Joined: Thu Jul 21, 2011 9:56 pm
Been thanked: 2 times

Re: Latency decreasing after each measurement?

Post by foul_owl »

Ah gotcha! Thank you for this.

I did end up going with Liquorix, and it seems to have solved this issue.

If I run into issues with Liquorix I'll remember about this nvidia rt package.
Post Reply