Passing hardware latency info to jackd

6 replies [Last post]
psst
User offline. Last seen 15 hours 44 min ago. Offline
Joined: 2011-04-23
Posts:

I've read that there's an option in jackd so it knows the hardware latency.
I can't find that option, does anybody know how to do it?
Thank you very much.

psst
User offline. Last seen 15 hours 44 min ago. Offline
Joined: 2011-04-23
Posts:

I mean passing the info to jackd, I know jackd can't find that value itself.

paul
paul's picture
User offline. Last seen 38 min 44 sec ago. Offline
Joined: 2006-03-16
Posts:

@psst: the argument is backend-specific, but the ALSA, CoreAudio and FFADO backends (and perhaps others) all accept -I and -O with arguments to specify this value (which should be measured by jack_iodelay, preferably).

psst
User offline. Last seen 15 hours 44 min ago. Offline
Joined: 2011-04-23
Posts:

Thank you very much, Paul

psst
User offline. Last seen 15 hours 44 min ago. Offline
Joined: 2011-04-23
Posts:

I have a little question about the jack_iodelay output.
When starting jackd with 1024frames and 2 periods (5.8ms) I get these values from jack_iodelay:
623.350 frames 14.135 ms
So the hardware latency would be 14.135 - 5.8 = 8.335ms. That sounds good.

But if I start jackd with different frames/period, for example 1024 and 2 periods (46.4ms), I should get the same hardware latency once subtracted the soft latency, right?
But what I'm getting is:
3325.522 frames 75.409 ms
75.409 - 46.4 = 29.009ms (different than 8.335)
Am I misunderstanding something?

I have a physical patch between input and output, and I connect, with the help of qjackctl, the input of the jack_iodelay to the input of the card, and the output to the output.

Thank you very much for your help.

Pablo Fernández
User offline. Last seen 49 weeks 5 days ago. Offline
Joined: 2007-02-20
Posts:

In jackd2, asynchronous mode, the calculated latency is p*(n+1) / r instead of p*n / r. The latter is valid for jackd1 and jackd2 synchronous mode and qjackctl always reports this. Async mode is the default mode in jackd2 [1]. I guess you are running jackd2 in async mode.

So, in the first case (you meant 128 frames/period, 2 periods, at 44100 Hz, didn't you?) the jack latency is 384 frames (8,7 ms). Real round trip latency is 623 frames ( 14,1 ms), as reported by jack_iodelay. As a result, HW latency is 239 frames (5, 4 ms).

In the second case, jack latency is 3072 frames, real latency is 3325. The difference is 253 (practically the same).

To run jackd in synchronous mode add --sync to the jackd command before the backend. In qjackctl, in the "server path" field.

[1] http://trac.jackaudio.org/wiki/Q_differenc_jack1_jack2 (note (1))

psst
User offline. Last seen 15 hours 44 min ago. Offline
Joined: 2011-04-23
Posts:

Now it's clear, thanks a lot, Pablo. I didn't know about the extra period in asynch mode.