[alsa-devel] [PATCH 1/2] ALSA: firewire-lib: remove rx_blocks_for_midi quirk

Takashi Sakamoto o-takashi at sakamocchi.jp
Thu Nov 27 13:45:00 CET 2014


On Nov 26 2014 23:38, Clemens Ladisch wrote:
> Takashi Sakamoto wrote:
>> On Nov 26 2014 06:52, Clemens Ladisch wrote:
>>> There are several devices that expect to receive MIDI data only in the
>>> first eight data blocks of a packet.  If the driver restricts the data
>>> rate to the allowed rate (as mandated by the specification, but not yet
>>> implemented by this driver), this happens naturally.  Therefore, there
>>> is no reason to ever try to use more data packets with any device.
>>>
>>> Signed-off-by: Clemens Ladisch <clemens at ladisch.de>
>>> ---
>>>  sound/firewire/amdtp.c                      |   10 +++++++---
>>>  sound/firewire/amdtp.h                      |    3 ---
>>>  sound/firewire/bebob/bebob_stream.c         |    7 -------
>>>  sound/firewire/fireworks/fireworks_stream.c |    5 -----
>>>  4 files changed, 7 insertions(+), 18 deletions(-)
>>
>> Can I ask your opinion about applying this patch to devices with
>> non-blocking mode? At least, your comment of this patch is for blocking
>> mode (the fixed number of data blocks in a packet).
> 
> This patch does not assume that there is a fixed number of data blocks.
> 
> It does not matter whether a stream is (non-)blocking: eight data blocks
> per packet (i.e., one MIDI byte per MPX-MIDI data channel per packet) is
> always enough for MIDI.  Even at 32 kHz, there are about 4000 packets
> per seconds in blocking mode.  In non-blocking mode, the packets are
> smaller (so not ecery MPX-MIDI data channels gets sent in every packet),
> but there are exactly 8000 packets per second, so the overall number of
> samples (= data blocks) does not change.

I was suspicious of unfairless for 8 MPX-MIDI data streams to transfer
MIDI messages in non-blocking mode, because .the MPX-MIDI data stream in
the first data block is different per packet.

But this is not matter. At 32.0/44.1/48.0, the number of data blocks in
a packet is lesser than 8 therefore all of MPX-MIDI data stream has the
same chances to transfer MIDI messages. At 88.2 kHz or higher, the
number of data blocks in a packet is bigger than 8 but8 MPX-MIDI data
streams has a chance per packet. As a result, All of MPX-MIDI data
stream has the same opportunity to transfer MIDI messages.

Reviewed-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>

I tested these two patch with below devices. All of them can transmit
MIDI messages correctly at any sampling transfer tates.

M-Audio: FIreWire 1814 (snd-bebob)
M-Audio: FireWire 410 (snd-bebob)
M-Audio: FireWire AudioPhile (snd-bebob)
M-Audio: Ozonic (snd-bebob)
Yamaha: GO44 (snd-bebob)
Yamaha: GO46 (snd-bebob)
Echo Audio: AudioFire4 (snd-fireworks)
Echo Audio: AudioFirePre8 (snd-fireworks)
TC Electronic: Impact Twin (snd-dice)

These two patches solves one of issues which I wrote in my report.
9.5 A lack of throttles for MIDI messages in outgoing stream
https://github.com/takaswie/alsa-firewire-report


Thanks

Takashi Sakamoto
o-takashi at sakamocchi.jp



More information about the Alsa-devel mailing list