1. 09 10月, 2015 4 次提交
    • T
      ALSA: firewire-lib: avoid endless loop to transfer MIDI messages at fatal error · bde3e288
      Takashi Sakamoto 提交于
      Currently, when asynchronous transactions finish in error state and
      retries, work scheduling and work running also continues. This
      should be canceled at fatal error because it can cause endless loop.
      
      This commit enables to cancel transferring MIDI messages when transactions
      encounter fatal errors. This is achieved by setting error state.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      bde3e288
    • T
      ALSA: firewire-lib: add throttle for MIDI data rate · ea848b7b
      Takashi Sakamoto 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ea848b7b
    • T
      ALSA: firewire-lib: add a restriction for a transaction at once · d3ef9cb9
      Takashi Sakamoto 提交于
      Currently, when waiting for a response, callers can start another
      transaction by scheduling another work. This is not good for error
      processing of transaction, especially the first response is too late.
      
      This commit serialize request/response transactions, by adding one
      boolean member to represent idling state.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d3ef9cb9
    • T
      ALSA: firewire-lib: add helper functions for asynchronous transactions to transfer MIDI messages · 585d7cba
      Takashi Sakamoto 提交于
      Some models receive MIDI messages via IEEE 1394 asynchronous transactions.
      In this case, MIDI messages are transferred in fixed-length payload. It's
      nice that firewire-lib module has common helper functions.
      
      This commit implements this idea. Each driver adds
      'struct snd_fw_async_midi_port' in its instance structure. In probing,
      it should call snd_fw_async_midi_port_init() to initialize the
      structure with some parameters such as target address, the length
      of payload in a transaction and a pointer for callback function
      to fill the payload buffer. At 'struct snd_rawmidi_ops.trigger()'
      callback, it should call 'snd_fw_async_midi_port_run()' to start
      transactions. Each driver should ensure that the lifetime of MIDI
      substream continues till calling 'snd_fw_async_midi_port_finish()'.
      
      The helper functions support retries to transferring MIDI messages when
      transmission errors occur. When transactions are successful, the helper
      functions call 'snd_rawmidi_transmit_ack()' internally to consume MIDI
      bytes in the buffer. Therefore, Each driver is expected to use
      'snd_rawmidi_transmit_peek()' to tell the number of bytes to transfer to
      return value of 'fill' callback.
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      585d7cba
  2. 21 10月, 2013 1 次提交
    • C
      ALSA: firewire: extend snd_fw_transaction() · 1b70485f
      Clemens Ladisch 提交于
      Add a flag to snd_fw_transaction() to allow it to abort when a bus reset
      happens.  This removes most of the duplicated error handling loops that
      were required around calls to the low-level fw_run_transaction().
      
      Also add a flag to suppress error messages; errors are expected when we
      attempt to clean up after the device was unplugged.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      1b70485f
  3. 18 4月, 2012 1 次提交
  4. 15 3月, 2011 1 次提交