waf: configure option for enforcing autostart method
[jack2.git] / man / jack_iodelay.0
blobd6a9f753f1499c61547ff356a6399eb0b25beb39
1 .TH JACK_IODELAY "1" "!DATE!" "!VERSION!"
2 .SH NAME
3 jack_iodelay \- JACK toolkit client to measure roundtrip latency
4 .SH SYNOPSIS
5 .B jack_iodelay
6 .SH DESCRIPTION
7 .B jack_iodelay
8 will create one input and one output port, and then
9 measures the latency (signal delay) between them. For this to work,
10 the output port must be connected to its input port. The measurement
11 is accurate to a resolution of greater than 1 sample.
12 .PP
13 The expected use is to connect jack_iodelay's output port to a
14 hardware playback port, then use a physical loopback cable from the
15 corresponding hardware output connector to an input connector, and to
16 connect that corresponding hardware capture port to jack_iodelay's
17 input port. This creates a roundtrip that goes through any
18 analog-to-digital and digital-to-analog converters that are present in
19 the audio hardware.
20 .PP
21 Although the hardware loopback latency is the expected use, it is also
22 possible to use jack_iodelay to measure the latency along any fully
23 connected signal path, such as those involving other JACK clients.
24 .PP
25 Once jack_iodelay completes its measurement it will print the total
26 latency it has detected. This will include the JACK buffer length in
27 addition to any other latency in the signal path. It will continue to
28 print the value every 0.5 seconds so that if you wish you can
29 vary aspects of the signal path to see their effect on the measured
30 latency.
31 .PP
32 If no incoming signal is detected from the input port, jack_iodelay
33 will print 
34 .PP
35 \fT Signal below threshold... .\fR
36 .PP
37 every second until this changes (e.g. until you establish the correct
38 connections).
39 .PP
40 To use the value measured by jack_iodelay with the -I and -O arguments
41 of a JACK backend (also called Input Latency and Output Latency in the
42 setup dialog of qjackctl), you must subtract the JACK buffer size from
43 the result. The buffer size is determined by multiplying the number of
44 frames per period (given to the jackd backend by the -p or --period
45 option) by the number of periods per buffer (given to the jackd
46 backend by the -n or --nperiods option).  Note that JACK2 will add an
47 implicit additional period when using the default asynchronous mode,
48 so for JACK1 or JACK2 in synchronous mode, the buffer size is n*p, but
49 for JACK2 in asynchronous mode the buffer size is (n+1)*p.  Once the
50 JACK buffer size is subtracted from the measured latency, the result
51 is the "extra" latency due to the interface hardware. Then, if you
52 believe that the latency is equally distributed between the input and
53 output parts of your audio hardware (extremely likely), divide the
54 result by two and use that for input and output latency
55 values. Doing this measurement will enable JACK clients that use the
56 JACK latency API to accurately position/delay audio to keep signals
57 synchronized even when there are inherent delays in the end-to-end
58 signal pathways.
59 .SH AUTHOR
60 Originally written in C++ by Fons Adriaensen, ported to C by Torben Hohn.