Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53111cdc authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a63d3ff1
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -78,6 +78,8 @@ 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);
@@ -472,7 +474,8 @@ 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 ((s->midi[port] == NULL) ||
		if ((f >= s->rx_blocks_for_midi) ||
		    (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;
		else
		else
+3 −0
Original line number Original line Diff line number Diff line
@@ -125,6 +125,9 @@ 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;
+5 −0
Original line number Original line Diff line number Diff line
@@ -212,6 +212,11 @@ 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);