Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
wiki:jack_latency_tests [2010/12/01 01:46] – rgareus | wiki:jack_latency_tests [2012/05/30 15:00] – ZKwnnrjfKpqQkAYjkTd 94.23.1.28 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== JACK Latency tests ====== | + | It' |
- | + | ||
- | Yet to be interpreted results on measuring [[http:// | + | |
- | + | ||
- | ~~DRAFT~~ | + | |
- | <note warning> | + | |
- | + | ||
- | ===== Introduction ===== | + | |
- | + | ||
- | There are only a few use-cases where latency - the delay between a signal arriving at the sound-card' | + | |
- | + | ||
- | In most other cases (such as playback, recording) latency can be compensated for, however any path that requires direct In->Out processing will need a low-latency system. In particular low-latency audio is required for | + | |
- | * live-effects | + | |
- | * live-mixing | + | |
- | * software monitoring | + | |
- | * playing virtual instruments | + | |
- | + | ||
- | Most humans will notice no difference if the audio latency is below 10ms (citation needed) - for comparison: in 10ms the sound travels ~ 3.4m (11 feet). | + | |
- | + | ||
- | The [[http:// | + | |
- | + | ||
- | Stable low-latency (<=10ms) on GNU/Linux can usually only be achieved by running [[https:// | + | |
- | + | ||
- | ===== JACK Latency enigma ===== | + | |
- | + | ||
- | JACK does report the port-latencies (run '' | + | |
- | The total latency depends on many variables: the bus (PCI, 1394, USB), layers in between (DMA, IRQ) and of course the audio-interface itself. | + | |
- | + | ||
- | ==== Latency measurements ==== | + | |
- | + | ||
- | Fons Adriaensen has written a small utility to measure the total round-trip latency called '' | + | |
- | + | ||
- | Even though the complete path of the digital audio-signal that causes latency is complicated due to data-packet-framing, | + | |
- | + | ||
- | The diagrams below show the difference of the // | + | |
- | + | ||
- | The tests were done on Debian/ | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | {{: | + | |
- | {{: | + | |
- | + | ||
- | ==== Interpretation and Analysis ==== | + | |
- | + | ||
- | The small //residue// of additional // | + | |
- | However the results for USB-device is unexpected. | + | |
- | + | ||
- | There' | + | |
- | - It seems that for USB devices JACK // | + | |
- | - latency reported by JACK is inconsistent: | + | |
- | + | ||
- | Looking closer at these two issues: | + | |
- | + | ||
- | **(1)** plotting the // | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | **(2)** understanding the inconsistencies of reported port-latency will require digging into the source-code of JACK, it may also help to try to reproduce this behaviour with jack-1. It may simply be a misinterpretation of the reported values. The information collected here is a first step: to make the issue clear to the authors. | + | |
- | + | ||
- | using '' | + | |
- | ALSA: use 2 periods for capture | + | |
- | ALSA: use 2 periods for playback | + | |
- | + | ||
- | and '' | + | |
- | ALSA: use 3 periods for capture | + | |
- | ALSA: use 3 periods for playback | + | |
- | + | ||
- | while jack_lsp -l (or [[http:// | + | |
- | | + | |
- | port latency = 1024 frames | + | |
- | | + | |
- | port latency = 2048 frames | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ===== References ===== | + | |
- | + | ||
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | + | ||
- | ===== Raw data ===== | + | |
- | + | ||
- | + | ||
- | < | + | |
- | #UA-25, Linux 2.6.33.7-rt29 i386, jackdmp 1.9.6 | + | |
- | #JACK-cfg, measured lat [frames], measured lat [ms], nominal latency for record [frames], nominal latency for playback [frames], periods per cycle | + | |
- | #JACK-cfg: frames per period * periods per cycle / sample-rate / S: --sync | + | |
- | # | + | |
- | # values of ' | + | |
- | # | + | |
- | 4096*2/ | + | |
- | 4096*2/ | + | |
- | 4096*3/ | + | |
- | 4096*3/ | + | |
- | 2048*2/ | + | |
- | 2048*2/ | + | |
- | 2048*3/ | + | |
- | 2048*3/ | + | |
- | 1024*2/ | + | |
- | 1024*2/ | + | |
- | 1024*3/ | + | |
- | 1024*3/ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 64*2/ | + | |
- | 64*2/ | + | |
- | 64*3/ | + | |
- | 64*3/ | + | |
- | 32*2/ | + | |
- | 32*2/ | + | |
- | 32*3/ | + | |
- | 32*3/ | + | |
- | 16*2/ | + | |
- | 16*2/ | + | |
- | 16*3/ | + | |
- | 16*3/ | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | #HDA 1458:a002, Linux 2.6.33.7-rt29 amd64, jackdmp 1.9.6 | + | |
- | #JACK-cfg, measured lat [frames], measured lat [ms], nominal latency for record [frames], nominal latency for playback [frames], periods per cycle | + | |
- | #JACK-cfg: frames per period * periods per cycle / sample-rate / S: --sync | + | |
- | # | + | |
- | # values of ' | + | |
- | # | + | |
- | #2048*2 -> ALSA: cannot configure playback channel | + | |
- | #1024*3 -> ALSA: cannot configure playback channel | + | |
- | # | + | |
- | 4096*2/ | + | |
- | 4096*2/ | + | |
- | 4096*3/ | + | |
- | 4096*3/ | + | |
- | 2048*2/ | + | |
- | 2048*2/ | + | |
- | 2048*3/ | + | |
- | 2048*3/ | + | |
- | 1024*2/ | + | |
- | 1024*2/ | + | |
- | 1024*3/ | + | |
- | 1024*3/ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 64*2/ | + | |
- | 64*2/ | + | |
- | 64*3/ | + | |
- | 64*3/ | + | |
- | 32*2/ | + | |
- | 32*2/ | + | |
- | 32*3/ | + | |
- | 32*3/ | + | |
- | 16*2/ | + | |
- | 16*2/ | + | |
- | 16*3/ | + | |
- | 16*3/ | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | ===== Acknowledgments ===== | + | |
- | + | ||
- | Many thanks to Paul Davis and Stephane Letz for JACK and Fons Adriaensen for jack_delay. | + | |
- | + | ||
- | This article was written by Robin Gareus and Luis Garrido and may be redistributed in terms of the GFDL. | + |