Commit 5c697e5b authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Takashi Iwai

ALSA: firewire-lib: remove rx_blocks_for_midi quirk

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: default avatarClemens Ladisch <clemens@ladisch.de>
Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 92cb4658
...@@ -21,7 +21,13 @@ ...@@ -21,7 +21,13 @@
#define CYCLES_PER_SECOND 8000 #define CYCLES_PER_SECOND 8000
#define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND) #define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND)
#define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */ /*
* Several devices look only at the first eight data blocks.
* In any case, this is more than enough for the MIDI data rate.
*/
#define MAX_MIDI_RX_BLOCKS 8
#define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */
/* isochronous header parameters */ /* isochronous header parameters */
#define ISO_DATA_LENGTH_SHIFT 16 #define ISO_DATA_LENGTH_SHIFT 16
...@@ -78,8 +84,6 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit, ...@@ -78,8 +84,6 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
s->callbacked = false; s->callbacked = false;
s->sync_slave = NULL; s->sync_slave = NULL;
s->rx_blocks_for_midi = UINT_MAX;
return 0; return 0;
} }
EXPORT_SYMBOL(amdtp_stream_init); EXPORT_SYMBOL(amdtp_stream_init);
...@@ -474,7 +478,7 @@ static void amdtp_fill_midi(struct amdtp_stream *s, ...@@ -474,7 +478,7 @@ static void amdtp_fill_midi(struct amdtp_stream *s,
b = (u8 *)&buffer[s->midi_position]; b = (u8 *)&buffer[s->midi_position];
port = (s->data_block_counter + f) % 8; port = (s->data_block_counter + f) % 8;
if ((f >= s->rx_blocks_for_midi) || if ((f >= MAX_MIDI_RX_BLOCKS) ||
(s->midi[port] == NULL) || (s->midi[port] == NULL) ||
(snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0)) (snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0))
b[0] = 0x80; b[0] = 0x80;
......
...@@ -152,9 +152,6 @@ struct amdtp_stream { ...@@ -152,9 +152,6 @@ struct amdtp_stream {
/* quirk: fixed interval of dbc between previos/current packets. */ /* quirk: fixed interval of dbc between previos/current packets. */
unsigned int tx_dbc_interval; unsigned int tx_dbc_interval;
/* quirk: the first count of data blocks in an rx packet for MIDI */
unsigned int rx_blocks_for_midi;
bool callbacked; bool callbacked;
wait_queue_head_t callback_wait; wait_queue_head_t callback_wait;
struct amdtp_stream *sync_slave; struct amdtp_stream *sync_slave;
......
...@@ -484,13 +484,6 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob) ...@@ -484,13 +484,6 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob)
amdtp_stream_destroy(&bebob->rx_stream); amdtp_stream_destroy(&bebob->rx_stream);
destroy_both_connections(bebob); destroy_both_connections(bebob);
} }
/*
* The firmware for these devices ignore MIDI messages in more than
* first 8 data blocks of an received AMDTP packet.
*/
if (bebob->spec == &maudio_fw410_spec ||
bebob->spec == &maudio_special_spec)
bebob->rx_stream.rx_blocks_for_midi = 8;
end: end:
return err; return err;
} }
......
...@@ -179,11 +179,6 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw) ...@@ -179,11 +179,6 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw)
destroy_stream(efw, &efw->tx_stream); destroy_stream(efw, &efw->tx_stream);
goto end; goto end;
} }
/*
* Fireworks ignores MIDI messages in more than first 8 data
* blocks of an received AMDTP packet.
*/
efw->rx_stream.rx_blocks_for_midi = 8;
/* set IEC61883 compliant mode (actually not fully compliant...) */ /* set IEC61883 compliant mode (actually not fully compliant...) */
err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883); err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment