[LAD] ALSA Sequencer timestamp on event without scheduling

Felipe Ferreri Tonello eu at felipetonello.com
Fri Sep 30 20:32:53 UTC 2016

Hi Clemens,

On 30/09/16 19:46, Clemens Ladisch wrote:
> Felipe Ferreri Tonello wrote:
>> This event we are discussing is time based.
>> The only difference is that the event time is not its delivered time,
>> but some time in the past.
>> I just want to make ALSA Sequencer support this idea, which is new and a
>> requirement for MIDI over BLE to work properly.
> I see no such requirement in the BLE-MIDI specification, which says:
> | To maintain precise inter-event timing, this protocol uses 13-bit
> | millisecond-resolution timestamps to express the render time and event
> | spacing of MIDI messages.
> and:
> | Correlation between the receiver’s clock and the received timestamps
> | must be performed to ensure accurate rendering of MIDI messages, and
> | is not addressed in this document.
> In the context of the ALSA sequencer, "rendering" means delivery.

Yes, the correlation exists on the current implementation I am working

The problem is the latency on receiving BLE packets. The timestamp the
device sends and the "receiver's clock" (ALSA Seq) will very quickly get
out-of-sync, causing this timestamp to be invalid. Thus we need somehow
to set the event timestamp to any arbitrary value, in practice it will
be the BLE-MIDI timestamps (normalized to the central timestamp, of course).

[1] https://github.com/ftonello/bluez/blob/midi/profiles/midi/midi.c#L138

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x92698E6A.asc
Type: application/pgp-keys
Size: 7177 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20160930/cb460d3a/attachment.key>

More information about the Linux-audio-dev mailing list