Latency decreasing after each measurement?
Moderators: MattKingUSA, khz
Latency decreasing after each measurement?
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)
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)
Re: Latency decreasing after each measurement?
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?
"Detected roundtrip latency" decreases every time I measure it.
2344
2339
2334
2329
2324
2319
etc.
Has anyone noticed this bug before?
Re: Latency decreasing after each measurement?
I tried on two Debian 10 systems with both ardour and reaper, with both alsa and jack.
Same issue in all 8 test cases.
Same issue in all 8 test cases.
Re: Latency decreasing after each measurement?
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.
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.
Re: Latency decreasing after each measurement?
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§ion=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).
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§ion=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).
-
- Established Member
- Posts: 188
- Joined: Fri Jun 29, 2018 6:35 pm
- Has thanked: 8 times
- Been thanked: 15 times
-
- 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?
The latency variation (i.e. jitter) went to zero.CrocoDuck wrote: ↑Tue Oct 27, 2020 10:00 am The latency cannot be zero, see here: viewtopic.php?p=82607#p82607
Re: Latency decreasing after each measurement?
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?
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?
-
- 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?
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.
Re: Latency decreasing after each measurement?
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.
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.