Skip to contentSkip to conversation

seq_midi client names

PATCH Applied Alan Horstmann 2 participants 6 messages Apr 12, 2006 – Apr 21, 2006

lore
Share & tools
lore
#0 lore raw

(Takashi -message sent again with correct cc)

I delayed posting revised 'ice1712-pref-midi-names' patch to explore a side-effect:- the client name in /proc/asound/seq/clients also becomes 'Wavetable DMX6fire 0' which is the intended name of the 2nd port.

AFAICT in seq_midi.c 'snd_seq_midisynth_register_port' occurs first for the 2nd port, and has NULL client, so (L322) calls 'snd_seq_create_kernel_client', passing info->name as the string augument, which is actually the specific port name. Attached diff shows changing it to card->id for example; card->shortname would be similar, both give a more reasonable client name. Is it correct for client to be NULL in this way? When 'snd_seq_midisynth_register_port' is called the second time ( for the first port) client == NULL is false so the section is passed.

Do you think this client name behaviour is OK as it is, or should it be changed?

Revised ice1712 patch posted separately.

Alan

alsa-kernel/core/seq/seq_midi.c +2 -2
@@ -320,8 +322,8 @@
 		}
 		client->seq_client =
 			snd_seq_create_kernel_client(
-				card, 0, "%s", info->name[0] ?
-				(const char *)info->name : "External MIDI");
+				card, 0, "%s MIDI", card->id[0] ?
+				(const char *)card->id : "External");
 		if (client->seq_client < 0) {
 			kfree(client);
 			mutex_unlock(&register_mutex);
#1 lore raw
Quoted 4 lines · Alan Horstmann

AFAICT in seq_midi.c 'snd_seq_midisynth_register_port' occurs first for the 2nd port, and has NULL client, so (L322) calls 'snd_seq_create_kernel_client', passing info->name as the string augument, which is actually the specific port name.

info->name is the device name, the port name would be info->subname (which isn't set for most single-port devices).

When there is more than one RawMIDI port, it would make sense to use a (common) client name that is card specific rather than port specific. I hope this wouldn't be too confusing for cards that have only one MIDI port.

Quoted 3 lines

Attached diff shows changing it to card->id for example; card->shortname would be similar, both give a more reasonable client name.

The id is just an internal identifier, shortname would be better.

Quoted 1 line

Is it correct for client to be NULL in this way?

Yes, the client must be created at some time.

Regards,
Clemens

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#2 lore raw
Quoted 2 lines · you

info->name is the device name, the port name would be info->subname (which isn't set for most single-port devices).

Ah, thanks. Probably I've been mis-using the term 'port'. The ice1712 envy24 chip provides two mpu401 uart ports. Is this the same use of the term, ie the hardware wired to the panel connectors that midi uses; can a midi device have more than one port? So rmidi->name is a device name, not port name?

Quoted 5 lines

When there is more than one RawMIDI port, it would make sense to use a (common) client name that is card specific rather than port specific. I hope this wouldn't be too confusing for cards that have only one MIDI port.
The id is just an internal identifier, shortname would be better.

I'll post a patch to change seq_midi to use card->shortname instead of info->name for the new client name, if that is OK with you?

Regards Alan

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#3 lore raw
Quoted 4 lines · Alan Horstmann

The ice1712 envy24 chip provides two mpu401 uart ports. Is this the same use of the term, ie the hardware wired to the panel connectors that midi uses; can a midi device have more than one port? So rmidi->name is a device name, not port name?

Yes; yes. Yes.

Quoted 4 lines
Quoted 1 line

The id is just an internal identifier, shortname would be better.

I'll post a patch to change seq_midi to use card->shortname instead of info->name for the new client name, if that is OK with you?

Yes.

Regards,
Clemens

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#4 lore raw
Quoted 5 lines · Clemens
Quoted 2 lines · Alan Horstmann

I'll post a patch to change seq_midi to use card->shortname instead of info->name for the new client name, if that is OK with you?

Yes.

Patch to change midi client names, following discussion with Clemens.

seq_midi.c-client-naming.patch

Summary: Change seq_midi.c so client name is card, rather than port, specific

Change snd_seq_midisynth_register_port() in seq_midi.c so that if a new client is created, the client name string is based on card->shortname not (port-specific) info->name.

alsa-kernel/core/seq/seq_midi.c +2 -2
@@ -320,8 +320,8 @@
 		}
 		client->seq_client =
 			snd_seq_create_kernel_client(
-				card, 0, "%s", info->name[0] ?
-				(const char *)info->name : "External MIDI");
+				card, 0, "%s", card->shortname[0] ?
+				(const char *)card->shortname : "External MIDI");
 		if (client->seq_client < 0) {
 			kfree(client);
 			mutex_unlock(&register_mutex);
#5 lore raw
Quoted 5 lines · Alan Horstmann

Summary: Change seq_midi.c so client name is card, rather than port, specific

Change snd_seq_midisynth_register_port() in seq_midi.c so that if a new client is created, the client name string is based on card->shortname not (port-specific) info->name.

Thanks, applied.

Clemens

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642