Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Beck <musical_snake@gmx.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH] rawmidi.c Set a name for a newly allocated rawmidi substream
Date: Wed, 07 May 2014 19:24:13 +0200	[thread overview]
Message-ID: <536A6C3D.6080906@gmx.de> (raw)

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.

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

--- linux-source-3.13.0/sound/core/rawmidi.c.orig    2014-05-06 
20:25:33.683081389 +0200
+++ linux-source-3.13.0/sound/core/rawmidi.c    2014-05-06 
17:42:35.058097185 +0200
@@ -34,6 +34,7 @@
  #include <sound/control.h>
  #include <sound/minors.h>
  #include <sound/initval.h>
+#include <linux/string.h>

  MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
  MODULE_DESCRIPTION("Midlevel RawMidi code for ALSA.");
@@ -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),
+                 "%s %d-%d-%d", rmidi->id, rmidi->card->number, 
rmidi->device, idx);
          list_add_tail(&substream->list, &stream->substreams);
          stream->substream_count++;
      }

             reply	other threads:[~2014-05-07 17:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 17:24 Ralf Beck [this message]
2014-05-07 17:39 ` [PATCH] rawmidi.c Set a name for a newly allocated rawmidi substream Clemens Ladisch
2014-05-08  6:07   ` Ralf Beck
2014-05-08 20:08     ` Clemens Ladisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=536A6C3D.6080906@gmx.de \
    --to=musical_snake@gmx.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=ralfbeck1@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox