Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:jack_latency_tests [2011/06/26 19:42] – Changed links to kokkinizita nolaizwiki:jack_latency_tests [2014/03/18 11:39] (current) – [Interpretation and Analysis] lgarrido
Line 79: Line 79:
   * Connecting the output of your audio interface to its input using a patch cable. This can be an analog or a digital loop, depending on the nature of the input/output you use. A digital loop won't factor in the converters latency.   * Connecting the output of your audio interface to its input using a patch cable. This can be an analog or a digital loop, depending on the nature of the input/output you use. A digital loop won't factor in the converters latency.
  
-If you want to measure the latency of a cheap, integrated sound card that only has line-output and mic-input you cannot close the loop with a simple patch cable: both connectors may be mechanically compatible, but electrically they are not designed to work together, so attempting to connect them may harm your audio interface. If you are curious, anyway, you can [[http://www.tkk.fi/Misc/Electronics/circuits/line_to_mic.html|build a pad]] with a couple of resistors to adapt their impedances. Here's how we did it, but we take no responsibility for any harm your equipment might suffer. DO IT AT YOUR OWN RISK!+If you want to measure the latency of a cheap, integrated sound card that only has line-output and mic-input you cannot close the loop with a simple patch cable: both connectors may be mechanically compatible, but electrically they are not designed to work together, so attempting to connect them may harm your audio interface. If you are curious, anyway, you can [[http://web.archive.org/web/20060410075235/http://www.tkk.fi/Misc/Electronics/circuits/line_to_mic.html|build a pad]] with a couple of resistors to adapt their impedances. Here's how we did it, but we take no responsibility for any harm your equipment might suffer. DO IT AT YOUR OWN RISK!
  
 {{:wiki:line2mic-unplugged.jpg|}} {{:wiki:line2mic-unplugged.jpg|}}
Line 115: Line 115:
 The [[http://jackaudio.org|JACK]] Audio Connection Kit has a few parameters to configure the latency. However the settings are constrained by hardware (audio-device, CPU and bus-speed). Lower latencies increase the load on the computer-system (it needs to process the audio in smaller chunks which arrive much more frequently). If the system can not keep up: an //x-run// (short for buffer over-run and buffer under-run) occurs which usually results in audible clicks or dropouts. The [[http://jackaudio.org|JACK]] Audio Connection Kit has a few parameters to configure the latency. However the settings are constrained by hardware (audio-device, CPU and bus-speed). Lower latencies increase the load on the computer-system (it needs to process the audio in smaller chunks which arrive much more frequently). If the system can not keep up: an //x-run// (short for buffer over-run and buffer under-run) occurs which usually results in audible clicks or dropouts.
  
-Low-latency is not always a feature you want to have. It comes with a couple of drawbacks: the most prominent is increased power-consumption because the CPS needs to process many small chunks of audio-data, it is constantly active and can not enter power-saving mode. Furthermore, if more than one application (sound-processor) is involved in processing the sound, the operating system performs a context-switch to run each of these for each audio-cycle which results in a much higher system-load and an increased chance of x-runs.+Low-latency is not always a feature you want to have. It comes with a couple of drawbacks: the most prominent is increased power-consumption because the CPU needs to process many small chunks of audio-data, it is constantly active and can not enter power-saving mode. Furthermore, if more than one application (sound-processor) is involved in processing the sound, the operating system performs a context-switch to run each of these for each audio-cycle which results in a much higher system-load and an increased chance of x-runs.
  
 Stable low-latency (≤10ms) on GNU/Linux can usually only be achieved by running [[https://rt.wiki.kernel.org/|realtime-kernel]] (insert links to ''rtirq'' and setup/config info here). Stable low-latency (≤10ms) on GNU/Linux can usually only be achieved by running [[https://rt.wiki.kernel.org/|realtime-kernel]] (insert links to ''rtirq'' and setup/config info here).
Line 155: Line 155:
   - It seems that for USB devices JACK //secretly// adds an additional period latency, but at most 1024 frames. This phenomena is not present with PCI devices.   - It seems that for USB devices JACK //secretly// adds an additional period latency, but at most 1024 frames. This phenomena is not present with PCI devices.
   - The latency reported by JACK is inconsistent.   - The latency reported by JACK is inconsistent.
 +
 +The first issue was explained by ALSA developer Clemens Ladisch in [[http://jack-audio.10948.n7.nabble.com/Differences-in-latency-between-USB-and-internal-audio-interfaces-td9071.html|this thread in jack-devel]]. The USB driver adds an extra period or a 24 ms buffer, whichever is smaller.
  
 Looking closer at these two issues: Looking closer at these two issues:
Line 182: Line 184:
  
 Alas, total latency measurement can not tell which it is. Alas, total latency measurement can not tell which it is.
- 
 ===== References ===== ===== References =====
  
wiki/jack_latency_tests.1309110132.txt.gz · Last modified: 2011/06/26 19:42 by nolaiz