Strange latency increasing over time


(nezo) #1

Hello there !

I was using ardour some years ago and wanted to start it again. Unfortunately, I struggle from 2 days in order to be able to record with a proper latency compensation.

If I start a new project, I’m asked to calibrate the latency with the integrated tool in ardour, plugging a patch cable between external mic and line out of my zoom H2. Ardour measure like 102 ms of latency. Ok.

After that I’m able to record ardour’s metronome sound from my headphone to the mic of H2 and when played both original and recorded metronome, it sounds synchronous. But after time of recording things (some minutes is enough), I notice that my records are more and more late according to metronome. And if I record again Ardour’s metronome from headphone to mic, the sound played from that is delayed from original metronome sound. then I chek it with Ardour’s calibration tool : now latency is like 120 ms !!!

I’ve no ideas where this comes from… Maybe some of you could help. I thought it was a nasty zoom but seems to work fine with audacity.

thanks a lot,


(Robin Gareus) #2

Are there any dropouts perhaps? Every x-run during recording will introduce drift for example.

Also for USB devices, the systemic latency can change every time you open the device and every time there’s a x-run. Ardour/ALSA does allow to calibrate latency without restarting the device to work around this.

BTW 102ms of systemic latency is a lot! It’s usually on the order of a few msec only. What buffersize are you using?


(nezo) #3

Hey Robin !

Thank you for such a reactivity !

Drop outs = X-runs right ? there are not.

I don’t get it when you say :

I don’t see what can be opening the device.

The tool say 32ms of systemic latency, 102ms is the way-and-back latency. I’m using 1024 for buffersize.

What is strange to me is really that latency increase over time, I mean I can just start the calibration tool, check the latency once, then go away for minutes and check it back. And the value increased !


(nezo) #4

Hello there,

Some update : This increasing latency occurs also on other computer, with same zoom H2. but I don’t have this problem using another interface (zoom U22) on the two computers. Strange to me that I don’t have this problem with H2 using Audacity instead of Ardour.

My conclusion is that Ardour interacts in a different way than Audacity does with zoom H2 which cause the latency to increase slowly.


(Robin Gareus) #5

Very strange. I don’t have any explanation for the drift then, maybe someone else has.

Regarding Audacity: Last I used it re-opened the device on every play/stop. Can it even monitor live and compensate for latency?


(nezo) #6

Yes.

From what you said about audacity, maybe this is the reason why latency seems to be always the same with it :
If the device is opened on every play/stop, then latency starts again to increase from 102ms (for ex) on every play/stop… and then doesn’t increase that much. I would try to record audacity metronome on a long track to see if the synchro is lost after a while without re-opening the device.

Anyway thanks for your help until now !


(nezo) #7

Ok so I made a test recording 8 minutes of metronome from the headphone to H2 mic with audacity. Then, listening around 7 min both recorded and original metronome : There is now echoe in the sound = latency appears !!

So you were right Robin. As Audacity reconnect to the device on each play/stop, the increasing latency is not noticeable until you record a long track. So there should be something broken inside of my H2 or some compatibility bug with H2 and my computer.


(Robin Gareus) #8

Perhaps the device uses different sample-clocks for input and output and they drift over time.
It’s odd though. There should be buffer-under/overruns when this drift accumulates and eventually x-runs.

Does the zoom show up as two separate devices?

If so, one hack might be to use jack and configure it to use input only. That provides a reliable clock source. Then add the output with a tool that re-samples to match the clock-difference e.g. alsa_out or zita-j2a (from zita-ajbridge).


(nezo) #9

I have the option show x-runs tipped on preference, and I didn’t see any while testing…

The zoom appears only once in the list when I’m asked to choose a device in the audio configuration window. With QJackCtl, I have H2(hw:1) and USB Audio (hw:1,0). I don’t know if this answer to you.

And just an hour ago I found something that seems to work, and it is the last stuff I didn’t try. I was to change frequency from 44.1 kHz to 48 kHz. And now I did few test and it seems that latency is not increasing anymore !!!

So what was wrong with the 44.1 kHz frequency ? it was selected on both zoom and Ardour config… When I’ll have opportunity I’ll try with another H2 to be sure mine doesn’t have a particular problem.

So yep ! it is kind of solved for me.