From: Lee Revell <rlrevell@joe-job.com>
To: alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Rawmidi device naming
Date: Fri, 22 Sep 2006 13:38:42 -0400 [thread overview]
Message-ID: <1158946723.1097.90.camel@mindpipe> (raw)
I use the following code in my driver to initialize 2 MPU-like ports:
/* Dreamchip MIDI initializer */
static int __devinit snd_dream_midi_init(struct snd_card_dream *dream, struct snd_card_dream_midi *midi, int device, char *name)
{
snd_rawmidi_t *rmidi;
int err;
if ((err = snd_rawmidi_new(dream->card, name, device, 1, 1, &rmidi)) < 0)
return err;
midi->dream = dream;
strcpy(rmidi->name, name);
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_dream_midi_output);
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_dream_midi_input);
rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT |
SNDRV_RAWMIDI_INFO_INPUT |
SNDRV_RAWMIDI_INFO_DUPLEX;
rmidi->private_data = midi;
midi->rmidi = rmidi;
return 0;
}
/* Dreamchip MIDI constructor */
int __devinit snd_dream_midi(struct snd_card_dream *dream)
{
struct snd_card_dream_midi *midi1 = &dream->midi1;
struct snd_card_dream_midi *midi2 = &dream->midi2;
int err;
if ((err = snd_dream_midi_init(dream, midi1, 0, "Dreamchip MPU interface 1")) < 0)
return err;
midi1->port = MPU1_DATA;
if ((err = snd_dream_midi_init(dream, midi2, 1, "Dreamchip MPU interface 2")) < 0)
return err;
midi2->port = MPU2_DATA;
return 0;
}
But the client names are wrong!
~ # aplaymidi -l
Port Client name Port name
62:0 Midi Through Midi Through Port-0
64:0 Dreamchip MPU interface 1 Dreamchip MPU interface 1
64:32 Dreamchip MPU interface 1 Dreamchip MPU interface 2
88:0 Virtual Raw MIDI 3-0 VirMIDI 3-0
89:0 Virtual Raw MIDI 3-1 VirMIDI 3-1
90:0 Virtual Raw MIDI 3-2 VirMIDI 3-2
91:0 Virtual Raw MIDI 3-3 VirMIDI 3-3
Why do both ports get "Dreamchip MPU interface 1" for the client name?
Lee
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
next reply other threads:[~2006-09-22 17:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-22 17:38 Lee Revell [this message]
2006-09-22 18:04 ` Rawmidi device naming Clemens Ladisch
2006-09-22 18:13 ` Lee Revell
2006-11-09 20:36 ` Lee Revell
2006-11-09 20:39 ` Lee Revell
2006-11-10 8:25 ` Clemens Ladisch
2006-11-10 17:54 ` Lee Revell
2006-11-10 19: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=1158946723.1097.90.camel@mindpipe \
--to=rlrevell@joe-job.com \
--cc=alsa-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.