[alsa-devel] [PATCH 2/3] fireface: add transaction support

Clemens Ladisch clemens at ladisch.de
Tue Dec 8 11:22:06 CET 2015


Takashi Sakamoto wrote:
> +static void transmit_midi_msg(struct snd_ff *ff, unsigned int port)
> ...
> +	/* Retrieve one MIDI byte to calculate length of the message. */
> +	len = snd_rawmidi_transmit_peek(substream, buf,
> +					SND_FF_MAXIMIM_MIDI_QUADS);

SND_FF_MAXIMIM_MIDI_QUADS does not have the value 1.

> +		/* Calculate consume bytes. */
> +		consume = calculate_message_bytes(status);
> +		if (consume <= 0)
> +			return;

As far as I can see, sending one of the "undefined" bytes can stop the
stream permanently.  Invalid bytes need to be acked to ignore/remove
them.


Regards,
Clemens


More information about the Alsa-devel mailing list