diff options
-rw-r--r-- | sound/firewire/amdtp.c | 12 | ||||
-rw-r--r-- | sound/firewire/amdtp.h | 3 | ||||
-rw-r--r-- | sound/firewire/bebob/bebob_stream.c | 7 | ||||
-rw-r--r-- | sound/firewire/fireworks/fireworks_stream.c | 5 |
4 files changed, 8 insertions, 19 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index 3badc70124ab..ef399cadb8a5 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c | |||
@@ -21,7 +21,13 @@ | |||
21 | #define CYCLES_PER_SECOND 8000 | 21 | #define CYCLES_PER_SECOND 8000 |
22 | #define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND) | 22 | #define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND) |
23 | 23 | ||
24 | #define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */ | 24 | /* |
25 | * Several devices look only at the first eight data blocks. | ||
26 | * In any case, this is more than enough for the MIDI data rate. | ||
27 | */ | ||
28 | #define MAX_MIDI_RX_BLOCKS 8 | ||
29 | |||
30 | #define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */ | ||
25 | 31 | ||
26 | /* isochronous header parameters */ | 32 | /* isochronous header parameters */ |
27 | #define ISO_DATA_LENGTH_SHIFT 16 | 33 | #define ISO_DATA_LENGTH_SHIFT 16 |
@@ -78,8 +84,6 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit, | |||
78 | s->callbacked = false; | 84 | s->callbacked = false; |
79 | s->sync_slave = NULL; | 85 | s->sync_slave = NULL; |
80 | 86 | ||
81 | s->rx_blocks_for_midi = UINT_MAX; | ||
82 | |||
83 | return 0; | 87 | return 0; |
84 | } | 88 | } |
85 | EXPORT_SYMBOL(amdtp_stream_init); | 89 | EXPORT_SYMBOL(amdtp_stream_init); |
@@ -474,7 +478,7 @@ static void amdtp_fill_midi(struct amdtp_stream *s, | |||
474 | b = (u8 *)&buffer[s->midi_position]; | 478 | b = (u8 *)&buffer[s->midi_position]; |
475 | 479 | ||
476 | port = (s->data_block_counter + f) % 8; | 480 | port = (s->data_block_counter + f) % 8; |
477 | if ((f >= s->rx_blocks_for_midi) || | 481 | if ((f >= MAX_MIDI_RX_BLOCKS) || |
478 | (s->midi[port] == NULL) || | 482 | (s->midi[port] == NULL) || |
479 | (snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0)) | 483 | (snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0)) |
480 | b[0] = 0x80; | 484 | b[0] = 0x80; |
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h index e6e8926275b0..cd4c4dfb3951 100644 --- a/sound/firewire/amdtp.h +++ b/sound/firewire/amdtp.h | |||
@@ -152,9 +152,6 @@ struct amdtp_stream { | |||
152 | /* quirk: fixed interval of dbc between previos/current packets. */ | 152 | /* quirk: fixed interval of dbc between previos/current packets. */ |
153 | unsigned int tx_dbc_interval; | 153 | unsigned int tx_dbc_interval; |
154 | 154 | ||
155 | /* quirk: the first count of data blocks in an rx packet for MIDI */ | ||
156 | unsigned int rx_blocks_for_midi; | ||
157 | |||
158 | bool callbacked; | 155 | bool callbacked; |
159 | wait_queue_head_t callback_wait; | 156 | wait_queue_head_t callback_wait; |
160 | struct amdtp_stream *sync_slave; | 157 | struct amdtp_stream *sync_slave; |
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 1aab0a32870c..0ebcabfdc7ce 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c | |||
@@ -484,13 +484,6 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob) | |||
484 | amdtp_stream_destroy(&bebob->rx_stream); | 484 | amdtp_stream_destroy(&bebob->rx_stream); |
485 | destroy_both_connections(bebob); | 485 | destroy_both_connections(bebob); |
486 | } | 486 | } |
487 | /* | ||
488 | * The firmware for these devices ignore MIDI messages in more than | ||
489 | * first 8 data blocks of an received AMDTP packet. | ||
490 | */ | ||
491 | if (bebob->spec == &maudio_fw410_spec || | ||
492 | bebob->spec == &maudio_special_spec) | ||
493 | bebob->rx_stream.rx_blocks_for_midi = 8; | ||
494 | end: | 487 | end: |
495 | return err; | 488 | return err; |
496 | } | 489 | } |
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index b985fc5ebdc6..4f440e163667 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c | |||
@@ -179,11 +179,6 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw) | |||
179 | destroy_stream(efw, &efw->tx_stream); | 179 | destroy_stream(efw, &efw->tx_stream); |
180 | goto end; | 180 | goto end; |
181 | } | 181 | } |
182 | /* | ||
183 | * Fireworks ignores MIDI messages in more than first 8 data | ||
184 | * blocks of an received AMDTP packet. | ||
185 | */ | ||
186 | efw->rx_stream.rx_blocks_for_midi = 8; | ||
187 | 182 | ||
188 | /* set IEC61883 compliant mode (actually not fully compliant...) */ | 183 | /* set IEC61883 compliant mode (actually not fully compliant...) */ |
189 | err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883); | 184 | err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883); |