Hi Clemens,
On 19/09/16 13:27, Clemens Ladisch wrote:
Felipe Ferreri Tonello wrote:
* We want to deliver these events *ASAP* to the
application -
scheduling adds latency, a lot;
* Timestamps are in the past relative to the central.
But I still need the timestamp information. Why? The spec doesn't
explain, but it makes sense to believe it is used to have a predictable
latency, so if the central device wants to layout these MIDI message,
they little or no jitter in between.
MIDI is a real-time protocol, and the sequencer assumes that events are
delivered in real time.
If you want to minimize jitter, you have to impose a certain fixed
latency, and schedule all events that arrived too early.
If you want to minimize latency, you have to deliver the events
immediately.
Thus, to be MIDI compliant
Compliant with what? The MIDI specification does not say anything about
timestamps associated with events.
MIDI-BLE[1] (MIDI over Bluetooth Low Energy) _does_ specify timestamp
associated with a MIDI message, like I already mentioned.
we need to set this timestamp some how on the
event. And I think the
simplest way, is to use snd_seq_real_time_t on ev.time.time.
But nobody will read it.
Applications which cares about the event timestamp already reads it.
But even then, we can patch and add this functionality that is needed by
MIDI-BLE. Unless we find a better way of doing so.
And without a queue, the timestamp does not
make sense.
Applications who cares about timestamp have their own queue implementation.
And applications that care about the time of received
events
tell the sequencer to overwrite the timestamp with the actual delivery
time anyway.
Applications only need to care about the timestamp field for that event,
it doesn't matter who set it (the ALSA Seq scheduler or other client, in
this case the BLE driver).
[1]
https://www.midi.org/specifications/item/bluetooth-le-midi
--
Felipe