The utility is called jack_iodelay and despite being CLI, it is very easy to use. The output is detailed but succinct.
Note that, in order to do the trick, jack_iodelay produces an unpleasant, loud sound. If you get things right the noise shouldn't get to the speakers but, just in case, turn down the speakers volume before you start.
Needless to say, I will assume that jack is up and running.
1) Physical connections
Firstly, you need to connect a physical cable between the output and the input of your soundcard. Normally, you will connect the first mono output (represented as system: playback1 in jack's terms) to the first mono input (what jack calls "system: capture1" in the software side).
2) Run jack_iodelay
Open a terminal and type: jack_iodelay . You will see something like:
Code: Select all
$ jack_iodelay
new capture latency: [0, 0]
new playback latency: [0, 0]
Signal below threshold...
Signal below threshold...
Signal below threshold...
3) Connect jack_iodelay
Use you favourite jack connections manager and connect jack_delay: out to system: playback1. The signal is going through the cable to the first input, so now we have to close the loop: Connect system: capture1 to jack_delay: in
4) Understanding the numbers
You will see some numbers. In my test:
Code: Select all
3106.619 frames 64.721 ms total roundtrip latency
extra loopback latency: 34 frames
use 17 for the backend arguments -I and -O

The "extra loopback latency" is latency not produced by jack itself. It is mainly down to the AD and DA converters in your soundcard. Here, the jack developers are recommening to put half the extra latency as "Input Latency" and the other half as "Output Latency". In qjackctl's setup, you can find these settings at the bottom of the right column. This way, jack-aware programs have the option to take it into account.
The rest of the latency depends, of course, on jack settings. In this test, I am running jack2 in the default, asynchronous mode, with 1024 frames per period and 2 periods per buffer. So, 1024*2 + 1024 = 3072 frames