Re: [LAU] Estimating JACK latency

From: Robin Gareus <robin@email-addr-hidden>
Date: Thu May 03 2012 - 11:21:16 EEST

On 05/03/2012 04:26 AM, Joel Roth wrote:
> On Tue, Apr 17, 2012 at 05:09:52PM +0000, Fons Adriaensen wrote:
>> On Mon, Apr 16, 2012 at 05:21:47PM -0400, S. Massy wrote:
>>
>>> Okay, so for a standard 2 periods of 128 frames each, my nominal dddelay
>>> is 256 frames or 5.3ms at a sr of 48k, twice that for a round-trip.
>>
>> No. The nominal roundtrip-delay (physical input to physical output
>> if you connect the corresponding ports directly) is period * nperiods.
>>
>> 1 * period occurs at the input, (nperiods - 1) * period at the output.
>
> Thanks for clarifying this.
>
> I understand that the round trip delay for the soundcard is the sum
> of capture port latency and playback port latency, plus whatever
> additional delay is associated with the AD/DA converters.
>
> However I see what appears to be a discrepency for
> the latencies reported by jackd (2 + 2 periods roundtrip)
> and by jack_lsp -l (1 + 2 periods round trip).
> This is for jackd2.
>
> jackd says:
>
> configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 2 periods
> ALSA: final selected sample format for capture: 32bit integer little-endian
> ALSA: use 2 periods for capture
> ALSA: final selected sample format for playback: 32bit integer little-endian
> ALSA: use 2 periods for playback

Capture latency in above message is a wrong. It was reported a while
back: check jack-devel archive Dec 2010:
http://old.nabble.com/jack-%281-and-2%29-latency-reporting-td30420262.html

> However, jack_lsp -l says:
>
> system:capture_1
> port latency = 1024 frames
> port playback latency = [ 0 0 ] frames
> port capture latency = [ 1024 1024 ] frames
> system:capture_2
> port latency = 1024 frames
> port playback latency = [ 0 0 ] frames
> port capture latency = [ 1024 1024 ] frames
> system:playback_1
> port latency = 2048 frames
> port playback latency = [ 2048 2048 ] frames
> port capture latency = [ 0 0 ] frames
> system:playback_2
> port latency = 2048 frames
> port playback latency = [ 2048 2048 ] frames
> port capture latency = [ 0 0 ] frames
>
> Is this inconistent, or is there some other explanation?

with jack2, there's also the difference of sync (jackd --sync .. -d alsa
...) vs. async mode. The latter adds 1 period of output latency.

see also:
  http://wiki.linuxaudio.org/wiki/jack_latency_tests

>> If you masure it using jack_delay you will in most cases find a value
>> that is a bit higher, this is due to delay in AD/DA converters etc. For
>> some types of soundcard (e.g. USB) the real latency can be significantly
>> higher than the nominal value. You can tell Jack about this using the
>> -I and -O options.
>>
>>
>> The extra delay when making a loop such as Ardour -> jconvolver -> Ardour
>> is one period.
>
> Great to have these details available for unschooled
> developers as myself!
>
> Regards,
>
> Joel
>
>> Ciao,
>>
>> --
>> FA
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Thu May 3 12:15:02 2012

This archive was generated by hypermail 2.1.8 : Thu May 03 2012 - 12:15:02 EEST