alsamidisrc: Improve buffer timestamping
authorAntonio Ospite <ao2@ao2.it>
Thu, 5 Oct 2017 10:10:50 +0000 (12:10 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 30 Nov 2017 02:13:38 +0000 (21:13 -0500)
commitfeacb875a47e311be1aaf66f022ad59272914506
treec572b13721d794530a74b1a94e29b25be6252773
parent3a64ed723a5eb4503732ed8feab0f9ba50988bff
alsamidisrc: Improve buffer timestamping

Make buffer timestamps more accurate and, more importantly, actually
representative of the MIDI events timing.

Previously, buffers were only sent with timetamps aligned at a 10ms
boundary which was just wrong, now the buffer timestamp represents the
real time of the MIDI event.

Conveniently, the ALSA sequencer API supports scheduling events in the
future so the sequencer infrastructure can be used to have the tick
delivered at the right time, avoiding any custom scheduling mechanism.

The ticks scheduling starts on the first transition to PLAYING, and the
delay is also calculated when the pipeline goes into PLAYING.

https://bugzilla.gnome.org/show_bug.cgi?id=787683
ext/alsa/gstalsamidisrc.c
ext/alsa/gstalsamidisrc.h