* MIDI port names
@ 2003-02-19 12:40 Paul Davis
2003-02-19 13:46 ` Takashi Iwai
0 siblings, 1 reply; 10+ messages in thread
From: Paul Davis @ 2003-02-19 12:40 UTC (permalink / raw)
To: alsa-devel
a few days ago i told mark knecht that i would change the name of the
ports that show up under the sequencer that correspond to the
Hammerfall MIDI ports.
in looking at the code, i now realize i have no idea how to do this,
since the port names are set up (AFAICT) by the module that maps
rawmidi ports to the sequencer API and vice versa.
however, the midisport 2x2 seems to be able to do this. can i get a
pointer on how its done? or better yet, can we form all the port names
in a consistent way, such as card->shortname + " port " + N ?
--p
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-19 12:40 Paul Davis
@ 2003-02-19 13:46 ` Takashi Iwai
0 siblings, 0 replies; 10+ messages in thread
From: Takashi Iwai @ 2003-02-19 13:46 UTC (permalink / raw)
To: Paul Davis; +Cc: alsa-devel
At Wed, 19 Feb 2003 07:40:06 -0500,
Paul Davis wrote:
>
> a few days ago i told mark knecht that i would change the name of the
> ports that show up under the sequencer that correspond to the
> Hammerfall MIDI ports.
>
> in looking at the code, i now realize i have no idea how to do this,
> since the port names are set up (AFAICT) by the module that maps
> rawmidi ports to the sequencer API and vice versa.
>
> however, the midisport 2x2 seems to be able to do this. can i get a
> pointer on how its done? or better yet, can we form all the port names
> in a consistent way, such as card->shortname + " port " + N ?
there is the name field for each rawmidi substream, and the sequencer
looks up this string.
this reminds me the former patch by Clemens, and i've forgotten to
check this issue until now. sorry.
i modified the sequencer part (and mpu401_uart) on the cvs so that the
sequencer retrieves the rawmidi name string if the substream name is
not defined.
so, you don't have to change the hdsp code any more.
ciao,
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
[not found] <E18lUe8-0003K3-00@sc8-sf-list2.sourceforge.net>
@ 2003-02-19 23:46 ` Pedro Lopez-Cabanillas
2003-02-20 8:55 ` Jaroslav Kysela
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Lopez-Cabanillas @ 2003-02-19 23:46 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Clemens Ladisch
[-- Attachment #1: Type: text/plain, Size: 870 bytes --]
On Wednesday 19 February 2003 14:51, Takashi Iwai wrote:
> there is the name field for each rawmidi substream, and the sequencer
> looks up this string.
>
> this reminds me the former patch by Clemens, and i've forgotten to
> check this issue until now. sorry.
>
> i modified the sequencer part (and mpu401_uart) on the cvs so that the
> sequencer retrieves the rawmidi name string if the substream name is
> not defined.
But Clemens' patch (attached is a slightly modified version) was not for port
names but for client names, from "External MIDI x" to the more meaningful
rawmidi name. I think that this is what some people is requesting, and makes
things easier for large studio setups when some applications, like kaconnect,
show client names but not port names. Please, apply.
Regards,
Pedro
--
ALSA Library Bindings for Pascal
http://alsapas.alturl.com
[-- Attachment #2: seq_midi.c.patch --]
[-- Type: text/x-diff, Size: 554 bytes --]
--- alsa-kernel/core/seq/seq_midi.c.old Wed Feb 19 23:23:50 2003
+++ alsa-kernel/core/seq/seq_midi.c Thu Feb 20 00:20:09 2003
@@ -329,7 +329,10 @@
memset(&inf,0,sizeof(snd_seq_client_info_t));
inf.client = client->seq_client;
inf.type = KERNEL_CLIENT;
- sprintf(inf.name, "External MIDI %i", card->number);
+ if (info.name[0])
+ strncpy(inf.name, info.name, sizeof(inf.name) - 1);
+ else
+ sprintf(inf.name, "External MIDI %i", card->number);
snd_seq_kernel_client_ctl(client->seq_client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &inf);
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-19 23:46 ` MIDI port names Pedro Lopez-Cabanillas
@ 2003-02-20 8:55 ` Jaroslav Kysela
2003-02-20 10:57 ` Takashi Iwai
0 siblings, 1 reply; 10+ messages in thread
From: Jaroslav Kysela @ 2003-02-20 8:55 UTC (permalink / raw)
To: Pedro Lopez-Cabanillas
Cc: Takashi Iwai, alsa-devel@lists.sourceforge.net, Clemens Ladisch
On Thu, 20 Feb 2003, Pedro Lopez-Cabanillas wrote:
> On Wednesday 19 February 2003 14:51, Takashi Iwai wrote:
> > there is the name field for each rawmidi substream, and the sequencer
> > looks up this string.
> >
> > this reminds me the former patch by Clemens, and i've forgotten to
> > check this issue until now. sorry.
> >
> > i modified the sequencer part (and mpu401_uart) on the cvs so that the
> > sequencer retrieves the rawmidi name string if the substream name is
> > not defined.
>
> But Clemens' patch (attached is a slightly modified version) was not for port
> names but for client names, from "External MIDI x" to the more meaningful
> rawmidi name. I think that this is what some people is requesting, and makes
> things easier for large studio setups when some applications, like kaconnect,
> show client names but not port names. Please, apply.
I don't agree with this patch. kaconnect or other applications might
simply parse the string and if matches - get the real name over the
control interface. Otherwise, it is not clear, that the port is equal to
a rawmidi device.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-20 8:55 ` Jaroslav Kysela
@ 2003-02-20 10:57 ` Takashi Iwai
2003-02-20 14:14 ` Jaroslav Kysela
0 siblings, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2003-02-20 10:57 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: Pedro Lopez-Cabanillas, alsa-devel@lists.sourceforge.net,
Clemens Ladisch
At Thu, 20 Feb 2003 09:55:18 +0100 (CET),
Jaroslav wrote:
>
> On Thu, 20 Feb 2003, Pedro Lopez-Cabanillas wrote:
>
> > On Wednesday 19 February 2003 14:51, Takashi Iwai wrote:
> > > there is the name field for each rawmidi substream, and the sequencer
> > > looks up this string.
> > >
> > > this reminds me the former patch by Clemens, and i've forgotten to
> > > check this issue until now. sorry.
> > >
> > > i modified the sequencer part (and mpu401_uart) on the cvs so that the
> > > sequencer retrieves the rawmidi name string if the substream name is
> > > not defined.
> >
> > But Clemens' patch (attached is a slightly modified version) was not for port
> > names but for client names, from "External MIDI x" to the more meaningful
> > rawmidi name. I think that this is what some people is requesting, and makes
> > things easier for large studio setups when some applications, like kaconnect,
> > show client names but not port names. Please, apply.
>
> I don't agree with this patch. kaconnect or other applications might
> simply parse the string and if matches - get the real name over the
> control interface. Otherwise, it is not clear, that the port is equal to
> a rawmidi device.
it's of course a bit dangerous to change such behavior.
but basically, the application shouldn't rely on the client name
string to get its information. and, AFAIK, there are no applications
to do that, so far. hence, i don't think it would cause much
problems.
if it looks ok for you, i'll commit more changes in this regard,
including:
- set the sequencer client name from rawmidi name (like above)
- reset the sequencer client name for the rawmidi device 0
in the case that other device was registered formerly.
- set the name of mpu401_uart from card's shortname if already
defined.
the last one requires the definition of the shortname field before
calling snd_mpu401_uart_new(). if not defined, "MPU401 (UART)" is
used like the older version.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-20 10:57 ` Takashi Iwai
@ 2003-02-20 14:14 ` Jaroslav Kysela
2003-02-20 14:38 ` Takashi Iwai
2003-02-20 19:55 ` Pedro Lopez-Cabanillas
0 siblings, 2 replies; 10+ messages in thread
From: Jaroslav Kysela @ 2003-02-20 14:14 UTC (permalink / raw)
To: Takashi Iwai
Cc: Pedro Lopez-Cabanillas, alsa-devel@lists.sourceforge.net,
Clemens Ladisch
On Thu, 20 Feb 2003, Takashi Iwai wrote:
> At Thu, 20 Feb 2003 09:55:18 +0100 (CET),
> Jaroslav wrote:
> >
> > On Thu, 20 Feb 2003, Pedro Lopez-Cabanillas wrote:
> >
> > > On Wednesday 19 February 2003 14:51, Takashi Iwai wrote:
> > > > there is the name field for each rawmidi substream, and the sequencer
> > > > looks up this string.
> > > >
> > > > this reminds me the former patch by Clemens, and i've forgotten to
> > > > check this issue until now. sorry.
> > > >
> > > > i modified the sequencer part (and mpu401_uart) on the cvs so that the
> > > > sequencer retrieves the rawmidi name string if the substream name is
> > > > not defined.
> > >
> > > But Clemens' patch (attached is a slightly modified version) was not for port
> > > names but for client names, from "External MIDI x" to the more meaningful
> > > rawmidi name. I think that this is what some people is requesting, and makes
> > > things easier for large studio setups when some applications, like kaconnect,
> > > show client names but not port names. Please, apply.
> >
> > I don't agree with this patch. kaconnect or other applications might
> > simply parse the string and if matches - get the real name over the
> > control interface. Otherwise, it is not clear, that the port is equal to
> > a rawmidi device.
>
> it's of course a bit dangerous to change such behavior.
>
> but basically, the application shouldn't rely on the client name
> string to get its information. and, AFAIK, there are no applications
> to do that, so far. hence, i don't think it would cause much
> problems.
>
> if it looks ok for you, i'll commit more changes in this regard,
> including:
>
> - set the sequencer client name from rawmidi name (like above)
> - reset the sequencer client name for the rawmidi device 0
> in the case that other device was registered formerly.
> - set the name of mpu401_uart from card's shortname if already
> defined.
>
> the last one requires the definition of the shortname field before
> calling snd_mpu401_uart_new(). if not defined, "MPU401 (UART)" is
> used like the older version.
If there is a way to determine the connection between sequencer port and
rawmidi device, I'm ok with any solution. Otherwise, please, solve this
problem.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-20 14:14 ` Jaroslav Kysela
@ 2003-02-20 14:38 ` Takashi Iwai
2003-02-20 20:19 ` Jaroslav Kysela
2003-02-20 19:55 ` Pedro Lopez-Cabanillas
1 sibling, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2003-02-20 14:38 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: Pedro Lopez-Cabanillas, alsa-devel@lists.sourceforge.net,
Clemens Ladisch
At Thu, 20 Feb 2003 15:14:45 +0100 (CET),
Jaroslav wrote:
>
> If there is a way to determine the connection between sequencer port and
> rawmidi device, I'm ok with any solution. Otherwise, please, solve this
> problem.
one of the advantages of the sequencer is that it hides the lowlevel
implementations, regardless of mpu401 or wavetable. hence, there
is no explicit link between the lowlevel device and the sequencer
client/port, so far. there are only bit flags indicating what kind of
functions are supported by the port.
it's not bad to have such an attribute, though. but if we have that,
it will be an addition.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-20 14:14 ` Jaroslav Kysela
2003-02-20 14:38 ` Takashi Iwai
@ 2003-02-20 19:55 ` Pedro Lopez-Cabanillas
1 sibling, 0 replies; 10+ messages in thread
From: Pedro Lopez-Cabanillas @ 2003-02-20 19:55 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai
Cc: alsa-devel@lists.sourceforge.net, Clemens Ladisch
On Thursday 20 February 2003 15:14, Jaroslav Kysela wrote:
> On Thu, 20 Feb 2003, Takashi Iwai wrote:
> > At Thu, 20 Feb 2003 09:55:18 +0100 (CET),
> >
> > Jaroslav wrote:
> > > On Thu, 20 Feb 2003, Pedro Lopez-Cabanillas wrote:
> > > > On Wednesday 19 February 2003 14:51, Takashi Iwai wrote:
> > > > > there is the name field for each rawmidi substream, and the
> > > > > sequencer looks up this string.
> > > > >
> > > > > this reminds me the former patch by Clemens, and i've forgotten to
> > > > > check this issue until now. sorry.
> > > > >
> > > > > i modified the sequencer part (and mpu401_uart) on the cvs so that
> > > > > the sequencer retrieves the rawmidi name string if the substream
> > > > > name is not defined.
> > > >
> > > > But Clemens' patch (attached is a slightly modified version) was not
> > > > for port names but for client names, from "External MIDI x" to the
> > > > more meaningful rawmidi name. I think that this is what some people
> > > > is requesting, and makes things easier for large studio setups when
> > > > some applications, like kaconnect, show client names but not port
> > > > names. Please, apply.
> > >
> > > I don't agree with this patch. kaconnect or other applications might
> > > simply parse the string and if matches - get the real name over the
> > > control interface. Otherwise, it is not clear, that the port is equal
> > > to a rawmidi device.
> >
> > it's of course a bit dangerous to change such behavior.
> >
> > but basically, the application shouldn't rely on the client name
> > string to get its information. and, AFAIK, there are no applications
> > to do that, so far. hence, i don't think it would cause much
> > problems.
> >
> > if it looks ok for you, i'll commit more changes in this regard,
> > including:
> >
> > - set the sequencer client name from rawmidi name (like above)
> > - reset the sequencer client name for the rawmidi device 0
> > in the case that other device was registered formerly.
> > - set the name of mpu401_uart from card's shortname if already
> > defined.
> >
> > the last one requires the definition of the shortname field before
> > calling snd_mpu401_uart_new(). if not defined, "MPU401 (UART)" is
> > used like the older version.
>
> If there is a way to determine the connection between sequencer port and
> rawmidi device, I'm ok with any solution. Otherwise, please, solve this
> problem.
>
> Jaroslav
>
> -----
> Jaroslav Kysela <perex@suse.cz>
> Linux Kernel Sound Maintainer
> ALSA Project, SuSE Labs
Hi Jaroslav,
I understand your complaints, so let me to propose another solution. Or almost
contribute to the brainstorming session :-)
What about card->id instead of card->number ? I mean, something like "External
MIDI ENS1371" for client names. Or perhaps only the card->id field alone.
This allows you to reach the relevant information from ctl interface, with
only a little more work compared with having card->number inside the client's
name.
The card->id field can be used also to compose a path name with
("/proc/asound/" + card->id) giving the name of a symlink to the
/proc/asound/cardX directory, allowing an easy way to get some information,
inclusively for scripts.
The card->id field allows also a customization level, via the "id" module
params available to every ALSA driver, so the user can change, for example,
"ENS1371" to something like "SB 128 PCI", or any other meaningful, user
friendly name.
Finally, with this solution we don't need to add another field to
snd_seq_client_info_t or any other data structure. Hmmm. Sounds too much good
to be true, so I think I missed again some point :-)
Regards,
Pedro
--
ALSA Library Bindings for Pascal
http://alsapas.alturl.com
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-20 14:38 ` Takashi Iwai
@ 2003-02-20 20:19 ` Jaroslav Kysela
2003-02-25 16:11 ` Takashi Iwai
0 siblings, 1 reply; 10+ messages in thread
From: Jaroslav Kysela @ 2003-02-20 20:19 UTC (permalink / raw)
To: Takashi Iwai
Cc: Pedro Lopez-Cabanillas, alsa-devel@lists.sourceforge.net,
Clemens Ladisch
On Thu, 20 Feb 2003, Takashi Iwai wrote:
> At Thu, 20 Feb 2003 15:14:45 +0100 (CET),
> Jaroslav wrote:
> >
> > If there is a way to determine the connection between sequencer port and
> > rawmidi device, I'm ok with any solution. Otherwise, please, solve this
> > problem.
>
> one of the advantages of the sequencer is that it hides the lowlevel
> implementations, regardless of mpu401 or wavetable. hence, there
> is no explicit link between the lowlevel device and the sequencer
> client/port, so far. there are only bit flags indicating what kind of
> functions are supported by the port.
>
> it's not bad to have such an attribute, though. but if we have that,
> it will be an addition.
We can use different name for client like:
RawMIDI - %s
Where %s is whatever you want ;-)) card->shortname, card->id or anything
else. The card number can be calculated from the client address and device
/ subdevice from the port address.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: MIDI port names
2003-02-20 20:19 ` Jaroslav Kysela
@ 2003-02-25 16:11 ` Takashi Iwai
0 siblings, 0 replies; 10+ messages in thread
From: Takashi Iwai @ 2003-02-25 16:11 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: Pedro Lopez-Cabanillas, alsa-devel@lists.sourceforge.net,
Clemens Ladisch
At Thu, 20 Feb 2003 21:19:19 +0100 (CET),
Jaroslav wrote:
>
> On Thu, 20 Feb 2003, Takashi Iwai wrote:
>
> > At Thu, 20 Feb 2003 15:14:45 +0100 (CET),
> > Jaroslav wrote:
> > >
> > > If there is a way to determine the connection between sequencer port and
> > > rawmidi device, I'm ok with any solution. Otherwise, please, solve this
> > > problem.
> >
> > one of the advantages of the sequencer is that it hides the lowlevel
> > implementations, regardless of mpu401 or wavetable. hence, there
> > is no explicit link between the lowlevel device and the sequencer
> > client/port, so far. there are only bit flags indicating what kind of
> > functions are supported by the port.
> >
> > it's not bad to have such an attribute, though. but if we have that,
> > it will be an addition.
>
> We can use different name for client like:
>
> RawMIDI - %s
>
> Where %s is whatever you want ;-)) card->shortname, card->id or anything
> else. The card number can be calculated from the client address and device
> / subdevice from the port address.
done.
now everthing became more verbose :)
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-02-25 16:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <E18lUe8-0003K3-00@sc8-sf-list2.sourceforge.net>
2003-02-19 23:46 ` MIDI port names Pedro Lopez-Cabanillas
2003-02-20 8:55 ` Jaroslav Kysela
2003-02-20 10:57 ` Takashi Iwai
2003-02-20 14:14 ` Jaroslav Kysela
2003-02-20 14:38 ` Takashi Iwai
2003-02-20 20:19 ` Jaroslav Kysela
2003-02-25 16:11 ` Takashi Iwai
2003-02-20 19:55 ` Pedro Lopez-Cabanillas
2003-02-19 12:40 Paul Davis
2003-02-19 13:46 ` Takashi Iwai
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.