[LAD] MIDI jitter - Today for 4 of 4 tests my USB device did pass all tests with success

Ralf Mardorf ralf.mardorf at alice-dsl.net
Mon Jul 5 08:14:19 UTC 2010


Today my swissonic USB MIDInterface didn't fail the ALSA MIDI latency
tests.

There are 3 differences.

1. I didn't use 64 Studio 3.0-beta3 and I didn't use 64 Studio 3.3
alpha, but Suse 11.2 were the rt stuff isn't from the repositories, but
self build.

2. Using another kernel version, the kernels for 64 Studio were older
and newer, but the Suse kernel.

3. My PATA HDD is disconnected, it was connected and break some days
ago, but anyway I had timing issues when the drive was new too.

An additional note. Around 4 ms is what I got when I used 64 Studio and
did record audio 'of the MIDI data' and then interpreted the waveforms
visually.

With this visually jitter around 4 ms, the audible result was unusable
to produce music.

Within the next days I'll get a SATA as replacement for the broken PATA
and an opto-coupler adapter for my PCI audio device, then I will run the
ALSA MIDI latency test again and much more important, I will do a test
making music.

I'm very sceptic regarding to the ALSA MIDI latency test, OTOH the PATA
might have caused 7 ms and IIRC 19 ms too and visually interpretation
might mistake because it's hard to find the start of waveforms in the
noise.

spinymouse11.2 at suse11-2:~> alsa-midi-latency-test -l
 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
 16:0    TerraTec EWX24/96                TerraTec EWX24/96 MIDI
 20:0    USB Device 0x170b:0x11           USB Device 0x170b:0x11 MIDI 1
spinymouse11.2 at suse11-2:~> alsa-midi-latency-test -Rrw20 -i20:0 -o20:0
> alsa-midi-latency-test 0.0.3
> set_realtime_priority(SCHED_FIFO, 99).. done.
> clock resolution: 0.000000001 s
> interval between measurements: 20.000 .. 40.000 ms

> sampling 10000 midi latency values - please wait ...
> press Ctrl+C to abort test

sample; latency_ms; latency_ms_worst
     0;       1.50;       1.50     
     1;       2.21;       2.21     
    58;       2.24;       2.24     
  1614;       2.27;       2.27     
  9999;       1.60;       2.27     
> done.

> latency distribution:
...
  1.2 -  1.3 ms:      186 #########
  1.3 -  1.4 ms:     1017
#################################################
  1.4 -  1.5 ms:     1034
##################################################
  1.5 -  1.6 ms:      968
###############################################
  1.6 -  1.7 ms:      966
###############################################
  1.7 -  1.8 ms:     1004
################################################
  1.8 -  1.9 ms:     1037
##################################################
  1.9 -  2.0 ms:      931 #############################################
  2.0 -  2.1 ms:     1034
##################################################
  2.1 -  2.2 ms:     1024
#################################################
  2.2 -  2.3 ms:      788 ######################################
  2.3 -  2.4 ms:       11 #

> SUCCESS

 best latency was 1.20 ms
 worst latency was 2.27 ms, which is great.

spinymouse11.2 at suse11-2:~> alsa-midi-latency-test -i20:0 -o20:0
> alsa-midi-latency-test 0.0.3
> clock resolution: 0.000000001 s

> sampling 10000 midi latency values - please wait ...
> press Ctrl+C to abort test

sample; latency_ms; latency_ms_worst
     0;       1.52;       1.52     
     1;       1.80;       1.80     
     2;       1.85;       1.85     
     3;       1.85;       1.85     
     4;       2.69;       2.69     
    11;       3.82;       3.82     
    26;       3.85;       3.85     
    40;       3.96;       3.96     
  9999;       1.99;       3.96     
> done.

> latency distribution:
...
  1.4 -  1.5 ms:        2 #
  1.5 -  1.6 ms:       18 #
  1.6 -  1.7 ms:       10 #
  1.7 -  1.8 ms:       15 #
  1.8 -  1.9 ms:       68 #
  1.9 -  2.0 ms:      475 ###
  2.0 -  2.1 ms:     9204
##################################################
  2.1 -  2.2 ms:      111 #
  2.2 -  2.3 ms:       45 #
  2.3 -  2.4 ms:       13 #
  2.4 -  2.5 ms:        6 #
  2.5 -  2.6 ms:       19 #
  2.6 -  2.7 ms:        1 #
  2.7 -  2.8 ms:        1 #
...
  3.1 -  3.2 ms:        2 #
  3.2 -  3.3 ms:        3 #
  3.3 -  3.4 ms:        2 #
  3.4 -  3.5 ms:        1 #
...
  3.8 -  3.9 ms:        2 #
  3.9 -  4.0 ms:        1 #
  4.0 -  4.1 ms:        1 #

> SUCCESS

 best latency was 1.42 ms
 worst latency was 3.96 ms, which is great.

Then I run glxgears with the window always on top and repeated the
tests.

spinymouse11.2 at suse11-2:~> alsa-midi-latency-test -Rrw20 -i20:0 -o20:0
> alsa-midi-latency-test 0.0.3
> set_realtime_priority(SCHED_FIFO, 99).. done.
> clock resolution: 0.000000001 s
> interval between measurements: 20.000 .. 40.000 ms

> sampling 10000 midi latency values - please wait ...
> press Ctrl+C to abort test

sample; latency_ms; latency_ms_worst
     0;       1.68;       1.68     
     2;       2.16;       2.16     
   138;       2.17;       2.17     
   174;       2.19;       2.19     
   348;       2.20;       2.20     
   350;       2.20;       2.20     
   552;       2.21;       2.21     
  1708;       2.22;       2.22     
  3381;       2.24;       2.24     
  9999;       1.62;       2.24     
> done.

> latency distribution:
...
  1.2 -  1.3 ms:      532 ##########################
  1.3 -  1.4 ms:     1017
#################################################
  1.4 -  1.5 ms:     1010
################################################
  1.5 -  1.6 ms:      980
###############################################
  1.6 -  1.7 ms:     1001
################################################
  1.7 -  1.8 ms:      990
################################################
  1.8 -  1.9 ms:     1010
################################################
  1.9 -  2.0 ms:      952 ##############################################
  2.0 -  2.1 ms:     1026
#################################################
  2.1 -  2.2 ms:     1042
##################################################
  2.2 -  2.3 ms:      440 #####################

> SUCCESS

 best latency was 1.16 ms
 worst latency was 2.24 ms, which is great.

While glxgears still was running I now moved windows by mouse too.

spinymouse11.2 at suse11-2:~> alsa-midi-latency-test -i20:0 -o20:0
> alsa-midi-latency-test 0.0.3
> clock resolution: 0.000000001 s

> sampling 10000 midi latency values - please wait ...
> press Ctrl+C to abort test

sample; latency_ms; latency_ms_worst
     0;       2.07;       2.07     
   263;       2.10;       2.10     
   441;       2.11;       2.11     
   446;       3.76;       3.76     
  9999;       1.99;       3.76     
> done.

> latency distribution:
...
  1.2 -  1.3 ms:        4 #
  1.3 -  1.4 ms:        3 #
  1.4 -  1.5 ms:        7 #
  1.5 -  1.6 ms:        5 #
  1.6 -  1.7 ms:        7 #
  1.7 -  1.8 ms:        3 #
  1.8 -  1.9 ms:       19 #
  1.9 -  2.0 ms:      204 #
  2.0 -  2.1 ms:     9612
##################################################
  2.1 -  2.2 ms:       94 #
  2.2 -  2.3 ms:       14 #
  2.3 -  2.4 ms:        2 #
  2.4 -  2.5 ms:        7 #
  2.5 -  2.6 ms:        7 #
  2.6 -  2.7 ms:        3 #
  2.7 -  2.8 ms:        5 #
  2.8 -  2.9 ms:        1 #
...
  3.6 -  3.7 ms:        2 #
...
  3.8 -  3.9 ms:        1 #

> SUCCESS

 best latency was 1.22 ms
 worst latency was 3.76 ms, which is great.

spinymouse11.2 at suse11-2:~> uname -a
Linux suse11-2 2.6.31.6-rt19 #1 SMP PREEMPT RT Wed Nov 18 16:59:26 CET
2009 x86_64 x86_64 x86_64 GNU/Linux




More information about the Linux-audio-dev mailing list