All of lore.kernel.org
 help / color / mirror / Atom feed
* Rawmidi device naming
@ 2006-09-22 17:38 Lee Revell
  2006-09-22 18:04 ` Clemens Ladisch
  0 siblings, 1 reply; 8+ messages in thread
From: Lee Revell @ 2006-09-22 17:38 UTC (permalink / raw)
  To: alsa-devel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-11-10 19:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-22 17:38 Rawmidi device naming Lee Revell
2006-09-22 18:04 ` 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

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.