diff options
author | Robin Gareus <robin@gareus.org> | 2014-06-16 20:22:31 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-06-16 20:22:31 +0200 |
commit | 43db6fd97e5e8dd83b205749516aad4c12b30524 (patch) | |
tree | 6ccd2c57d6e85e6b9afaade898fe041f4e8c662c /libs/ardour/mididm.cc | |
parent | fbe359e8c7e827b4f8b7e26f70ba0ec85ae4f01e (diff) |
more midi latency detection debugging
Diffstat (limited to 'libs/ardour/mididm.cc')
-rw-r--r-- | libs/ardour/mididm.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/mididm.cc b/libs/ardour/mididm.cc index b6734bb733..6babba2311 100644 --- a/libs/ardour/mididm.cc +++ b/libs/ardour/mididm.cc @@ -50,6 +50,9 @@ int MIDIDM::process (pframes_t nframes, PortEngine &pe, void *midi_in, void *mid /* process incoming */ const pframes_t nevents = pe.get_midi_event_count (midi_in); +#if 1 //DEBUG + printf("MIDI SEND: @%8"PRId64", recv: %d \n", _monotonic_cnt, nevents); +#endif for (pframes_t n = 0; n < nevents; ++n) { pframes_t timestamp; size_t size; @@ -64,10 +67,11 @@ int MIDIDM::process (pframes_t nframes, PortEngine &pe, void *midi_in, void *mid #define MODX (16384) // 1<<(2*7) #define MASK (0x3fff) // MODX - 1 const int64_t tc = (_monotonic_cnt + timestamp) & MASK; - const int64_t ti = (buf[2] << 7) | buf[1]; + const int64_t ti = ((buf[2] & 0x7f) << 7) | (buf[1] & 0x7f); const int64_t tdiff = (MODX + tc - ti) % MODX; #if 1 //DEBUG - printf("MIDI DELAY: # %4"PRId64" %4"PRId64" [samples]\n", _cnt_total, tdiff); + printf("MIDI DELAY: # %5"PRId64" %5"PRId64" [samples] (%5"PRId64" - %8"PRId64") @(%5"PRId64" + %d)\n", + _cnt_total, tdiff, tc, ti, _monotonic_cnt, timestamp); #endif /* running variance */ |