]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ALSA: firewire-lib: add throttle for MIDI data rate
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 8 Oct 2015 23:10:28 +0000 (08:10 +0900)
committerTakashi Iwai <tiwai@suse.de>
Fri, 9 Oct 2015 07:57:06 +0000 (09:57 +0200)
commitea848b7b62ab6d3078955b87833c3b336b71bc9f
tree1295ae58de9a3db05cc46082b595ac7250dd4922
parente8a40d9bcb2392ea502dc629d5d6c0556fdd3b0c
ALSA: firewire-lib: add throttle for MIDI data rate

Typically, the target devices have internal buffer to adjust output of
received MIDI messages for MIDI serial bus, while the capacity of the
buffer is limited. IEEE 1394 transactions can transfer more MIDI messages
than MIDI serial bus can. This can cause buffer over flow in device side.

This commit adds throttle to limit MIDI data rate by counting intervals
between two MIDI messages. Usual MIDI messages consists of two or three
bytes. This requires 1.302 to 1.953 mili-seconds interval between these
messages. This commit uses kernel monotonic time service to calculate the
time of next transaction.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/lib.c
sound/firewire/lib.h