MIDI Latency Tests

Comparison of round-trip midi latency/jitter measurements using a Presonus 1818VSL USB2 audio interface.

JACK-MIDI @64fpp w/a2jmidid

jackd2 using a2jmidid – nominal latency: 64 * 3 / 48000 Hz = 4.0ms

# ./jack_midi_latency \
   -i "a2j:AudioBox 1818 VSL [24] (capture): AudioBox 1818 VSL MIDI 1" \
   -o "a2j:AudioBox 1818 VSL [24] (playback): AudioBox 1818 VSL MIDI 1"

[..]

TOTAL: 13766 events counted
 min=   180 max=   280 range=   100 avg= 200.1 dev=  6.32 [samples]
 min=  3.75 max=  5.83 range=  2.08 avg=   4.2 dev=  0.13 [ms]

 0.00 ..  3.75 [ms]:     57 #
 3.75 ..  3.81 [ms]:     83 #
 3.81 ..  3.87 [ms]:    310 ####
 3.87 ..  3.93 [ms]:    106 #
 3.93 ..  4.00 [ms]:   1202 #################
 4.00 ..  4.06 [ms]:   2583 #####################################
 4.06 ..  4.12 [ms]:   2977 ###########################################
 4.12 ..  4.18 [ms]:   3413 ##################################################
 4.18 ..  4.24 [ms]:   1976 ############################
 4.24 ..  4.30 [ms]:    486 #######
 4.30 ..  4.36 [ms]:    223 ###
 4.36 ..  4.42 [ms]:     90 #
 4.42 ..  4.48 [ms]:     61 #
 4.48 ..  4.54 [ms]:     45 #
 4.54 ..  4.60 [ms]:     27 #
 4.60 ..  4.67 [ms]:     33 #
 4.67 ..  4.73 [ms]:     30 #
 4.73 ..  4.79 [ms]:     19 #
 4.79 ..  4.85 [ms]:      7 #
 4.85 ..  4.91 [ms]:     10 #
 4.91 ..  4.97 [ms]:      4 #
 4.97 ..  5.03 [ms]:      4 #
 5.03 ..  5.09 [ms]:      5 #
 5.09 ..  5.15 [ms]:      4 #
 5.15 ..   inf [ms]:     10 #

JACK-MIDI @64fpp -Xseq

# ./jack_midi_latency -i "system:midi_capture_1" -o "system:midi_playback_1"

[..]

JACK settings: samplerate: 48000, samples/period: 64
               probable nominal jack latency: 128 [samples] = 2.67 [ms]
TOTAL: 10000 MIDI events sent+received.
 min=   192 max=   241 range=    49 avg= 216.6 dev= 13.39 [samples]
 min=  4.00 max=  5.02 range=  1.02 avg=   4.5 dev=  0.28 [ms]

 0.00 ..  3.82 [ms]:      0
 3.82 ..  3.94 [ms]:     86 ##
 3.94 ..  4.06 [ms]:   1566 ################################################
 4.06 ..  4.18 [ms]:   1010 ###############################
 4.18 ..  4.30 [ms]:   1373 ##########################################
 4.30 ..  4.42 [ms]:    976 ##############################
 4.42 ..  4.54 [ms]:   1607 ##################################################
 4.54 ..  4.66 [ms]:   1577 #################################################
 4.66 ..  4.78 [ms]:    619 ###################
 4.78 ..  4.90 [ms]:   1172 ####################################
 4.90 ..   inf [ms]:     13 #

ALSA Sequencer

# ./alsa-midi-latency-test -R -o 24 -i 24

[..]
> set_realtime_priority(SCHED_FIFO, 99).. done.
> clock resolution: 0.000000001 s
[..]

sample; latency_ms; latency_ms_worst
     0;       1.36;       1.36
     5;       1.45;       1.45
     9;       2.90;       2.90
   103;       8.14;       8.14
  9999;       1.25;       8.14
> done.

> latency distribution:
...
  1.2 -  1.3 ms:     2439 ########################
  1.3 -  1.4 ms:     4988 ##################################################
  1.4 -  1.5 ms:     2253 #######################
  1.5 -  1.6 ms:      140 #
  1.6 -  1.7 ms:       65 #
  1.7 -  1.8 ms:       39 #
  1.8 -  1.9 ms:       17 #
  1.9 -  2.0 ms:       19 #
  2.0 -  2.1 ms:        8 #
  2.1 -  2.2 ms:        9 #
  2.2 -  2.3 ms:        7 #
  2.3 -  2.4 ms:        3 #
  2.4 -  2.5 ms:        2 #
  2.5 -  2.6 ms:        1 #
...
  2.9 -  3.0 ms:        1 #
...
  3.2 -  3.3 ms:        1 #
...
  3.4 -  3.5 ms:        1 #
...
  3.6 -  3.7 ms:        1 #
...
  4.1 -  4.2 ms:        1 #
...
  4.5 -  4.6 ms:        2 #
...
  5.9 -  6.0 ms:        1 #
...
  7.9 -  8.0 ms:        1 #
...
  8.1 -  8.2 ms:        1 #

> FAIL

 best latency was 1.16 ms
 worst latency was 8.14 ms, which is too much.
 
wiki/midilatency.txt · Last modified: 26.07.2013 16:57 by rgareus