aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 09:45:10 -0400
committerTakashi Iwai <tiwai@suse.de>2014-05-26 08:28:14 -0400
commit53111cdc53205fd35aac392c1d33893766be514e (patch)
tree7d03049d4b5dfc0ec256e6be982192e6bb1610c8 /sound
parenta63d3ff1059a4d2236521e4fdbafabfc62b4f81a (diff)
ALSA: fireworks/firewire-lib: Add a quirk of data blocks for MIDI in out-stream
Fireworks has a quirk to ignore MIDI messages in data blocks more than 8. This commit adds a flag for this quirk and codes to skip 8 or more data blocks to transfer MIDI messages. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/firewire/amdtp.c5
-rw-r--r--sound/firewire/amdtp.h3
-rw-r--r--sound/firewire/fireworks/fireworks_stream.c5
3 files changed, 12 insertions, 1 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 5e13b3f15516..28ee3d86164d 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -78,6 +78,8 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
78 s->callbacked = false; 78 s->callbacked = false;
79 s->sync_slave = NULL; 79 s->sync_slave = NULL;
80 80
81 s->rx_blocks_for_midi = UINT_MAX;
82
81 return 0; 83 return 0;
82} 84}
83EXPORT_SYMBOL(amdtp_stream_init); 85EXPORT_SYMBOL(amdtp_stream_init);
@@ -472,7 +474,8 @@ static void amdtp_fill_midi(struct amdtp_stream *s,
472 b = (u8 *)&buffer[s->midi_position]; 474 b = (u8 *)&buffer[s->midi_position];
473 475
474 port = (s->data_block_counter + f) % 8; 476 port = (s->data_block_counter + f) % 8;
475 if ((s->midi[port] == NULL) || 477 if ((f >= s->rx_blocks_for_midi) ||
478 (s->midi[port] == NULL) ||
476 (snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0)) 479 (snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0))
477 b[0] = 0x80; 480 b[0] = 0x80;
478 else 481 else
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
index 42c75c916684..fb5934cc01aa 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -125,6 +125,9 @@ struct amdtp_stream {
125 /* quirk: fixed interval of dbc between previos/current packets. */ 125 /* quirk: fixed interval of dbc between previos/current packets. */
126 unsigned int tx_dbc_interval; 126 unsigned int tx_dbc_interval;
127 127
128 /* quirk: the first count of data blocks in an rx packet for MIDI */
129 unsigned int rx_blocks_for_midi;
130
128 bool callbacked; 131 bool callbacked;
129 wait_queue_head_t callback_wait; 132 wait_queue_head_t callback_wait;
130 struct amdtp_stream *sync_slave; 133 struct amdtp_stream *sync_slave;
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c
index 3a3f203177b1..f9d836fc5039 100644
--- a/sound/firewire/fireworks/fireworks_stream.c
+++ b/sound/firewire/fireworks/fireworks_stream.c
@@ -212,6 +212,11 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw)
212 destroy_stream(efw, &efw->tx_stream); 212 destroy_stream(efw, &efw->tx_stream);
213 goto end; 213 goto end;
214 } 214 }
215 /*
216 * Fireworks ignores MIDI messages in more than first 8 data
217 * blocks of an received AMDTP packet.
218 */
219 efw->rx_stream.rx_blocks_for_midi = 8;
215 220
216 /* set IEC61883 compliant mode (actually not fully compliant...) */ 221 /* set IEC61883 compliant mode (actually not fully compliant...) */
217 err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883); 222 err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883);