summaryrefslogtreecommitdiffstats
path: root/sound/firewire/lib.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2015-10-09 08:10:28 +0900
committerTakashi Iwai <tiwai@suse.de>2015-10-09 09:57:06 +0200
commitea848b7b62ab6d3078955b87833c3b336b71bc9f (patch)
tree1295ae58de9a3db05cc46082b595ac7250dd4922 /sound/firewire/lib.h
parente8a40d9bcb2392ea502dc629d5d6c0556fdd3b0c (diff)
downloadlinux-stable-ea848b7b62ab6d3078955b87833c3b336b71bc9f.tar.gz
linux-stable-ea848b7b62ab6d3078955b87833c3b336b71bc9f.tar.bz2
linux-stable-ea848b7b62ab6d3078955b87833c3b336b71bc9f.zip
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>
Diffstat (limited to 'sound/firewire/lib.h')
-rw-r--r--sound/firewire/lib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/firewire/lib.h b/sound/firewire/lib.h
index 0af06f44e8c2..59e086587212 100644
--- a/sound/firewire/lib.h
+++ b/sound/firewire/lib.h
@@ -31,6 +31,7 @@ struct snd_fw_async_midi_port {
struct fw_device *parent;
struct work_struct work;
bool idling;
+ ktime_t next_ktime;
u64 addr;
struct fw_transaction transaction;