13
0

Debug async MIDI port (M1 builds)

This commit is contained in:
Robin Gareus 2022-04-23 22:59:20 +02:00
parent 9ce91e2952
commit f8a0de5928
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -105,6 +105,11 @@ AsyncMIDIPort::flush_output_fifo (MIDI::pframes_t nframes)
/* do this "atomically" after we're done pushing events into the
* MidiBuffer
*/
#ifndef NDEBUG
if (written > 0) {
cout << "AsyncMIDIPort::flush_output_fifo '" << MIDI::Port::name () << "' written " << written << " events\n";
}
#endif
output_fifo.increment_read_idx (written);
}
@ -156,7 +161,10 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
when = AudioEngine::instance()->sample_time_at_cycle_start() + timestamp;
}
input_fifo.write (when, Evoral::NO_EVENT, size, buf);
uint32_t rv = input_fifo.write (when, Evoral::NO_EVENT, size, buf);
#ifndef NDEBUG
cout << "AsyncMIDIPort::cycle_start '" << MIDI::Port::name () << "' add event, written " << rv << " / " << size << " bytes\n";
#endif
}
if (event_count) {
@ -332,6 +340,9 @@ AsyncMIDIPort::read (MIDI::byte *, size_t)
while (input_fifo.read (&time, &type, &size, &buffer[0])) {
_parser->set_timestamp (time);
#ifndef NDEBUG
cout << "AsyncMIDIPort::read '" << MIDI::Port::name () << "' bytes = " << size << "\n";
#endif
for (uint32_t i = 0; i < size; ++i) {
_parser->scanner (buffer[i]);
}