ALSA: rawmidi: Add framing mode
authorDavid Henningsson <coding@diwic.se>
Sat, 15 May 2021 07:15:33 +0000 (09:15 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 17 May 2021 14:02:44 +0000 (16:02 +0200)
commit08fdced60ca08e34e316a3ab945636fcdfcbc973
tree2ebf36f380c9bafbb78b43bb32de7118c8f4d529
parentbac59054544ebdb89f05c5b9598ca9cb2dea72ce
ALSA: rawmidi: Add framing mode

This commit adds a new framing mode that frames all MIDI data into
32-byte frames with a timestamp.

The main benefit is that we can get accurate timestamps even if
userspace wakeup and processing is not immediate.

Testing on a Celeron N3150 with this mode has a max jitter of 2.8 ms,
compared to the in-kernel seq implementation which has a max jitter
of 5 ms during idle and much worse when running scheduler stress tests
in parallel.

Signed-off-by: David Henningsson <coding@diwic.se>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210515071533.55332-1-coding@diwic.se
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/rawmidi.h
include/uapi/sound/asound.h
sound/core/rawmidi.c
sound/core/rawmidi_compat.c