[alsa-devel] [PATCH] rawmidi.c Set a name for a newly allocated rawmidi substream

Clemens Ladisch clemens at ladisch.de
Wed May 7 19:39:46 CEST 2014

Ralf Beck wrote:
> Rationale: Bitwig Studio (and possibly other rawmidi clients) enumerate the Midi I/Os by
> substream names. With the current rawmidi implementation, the name is an empty string
> and only the USB mididriver changes it to a meaningful value after allocation.

Many RawMIDI devices have only one substream, or multiple substreams that are
merged into one port.  For these, separate substream names do not make sense.

> This patch sets a default substream name of the form "somename x-y-z"

The ID string is not meant to be a name.

Also see Documentation/SubmittingPatches.

> @@ -1420,6 +1421,8 @@ static int snd_rawmidi_alloc_substreams(
>          substream->number = idx;
>          substream->rmidi = rmidi;
>          substream->pstr = stream;
> +            snprintf(substream->name, sizeof(substream->name),

Your mailer broke whitespaces.


More information about the Alsa-devel mailing list