• Takashi Sakamoto's avatar
    ALSA: firewire-lib: add throttle for MIDI data rate · ea848b7b
    Takashi Sakamoto authored
    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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    ea848b7b
lib.c 5.85 KB