[alsa-devel] longname in sound/core/jack.c
Mark,
I'm not sure whether I've already asked it, but I find it ugly to refer to card->longname for the input device name in sound/core/jack.c. Can it be changed to card->shortname, at least?
The long name is often really long like "HDA Intel at 0xf8400000 irq 21", thus the resultant name will be "HDA Intel at 0xf8400000 irq 21 Line Out at Ext Left" as the jack name.
Takashi
--- diff --git a/sound/core/jack.c b/sound/core/jack.c index 43b10d6..c8254c6 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -55,7 +55,7 @@ static int snd_jack_dev_register(struct snd_device *device) int err;
snprintf(jack->name, sizeof(jack->name), "%s %s", - card->longname, jack->id); + card->shortname, jack->id); jack->input_dev->name = jack->name;
/* Default to the sound card device. */
On Wed, Feb 18, 2009 at 02:40:09PM +0100, Takashi Iwai wrote:
I'm not sure whether I've already asked it, but I find it ugly to refer to card->longname for the input device name in sound/core/jack.c.
Yes, it was discussed at the time. This was chosen because the input subsystems tends towards the verbose when giving names to devices.
Can it be changed to card->shortname, at least?
Obviously, it's just a display string. I think what happened is that when I checked this on some desktop systems I misread card->id as being card->shortname in the /proc/asound output. The former is far too cryptic to be idiomatic in the input subsystem.
At Wed, 18 Feb 2009 14:39:14 +0000, Mark Brown wrote:
On Wed, Feb 18, 2009 at 02:40:09PM +0100, Takashi Iwai wrote:
I'm not sure whether I've already asked it, but I find it ugly to refer to card->longname for the input device name in sound/core/jack.c.
Yes, it was discussed at the time. This was chosen because the input subsystems tends towards the verbose when giving names to devices.
Ah yes, but longname is still too ugly as an identifier, IMHO. That's why I'm asking again.
At each time it's shown in kernel messages, I wonder what is that at all. It's hard to decode as "Jack..." string appears at the very last of the name.
Can it be changed to card->shortname, at least?
Obviously, it's just a display string. I think what happened is that when I checked this on some desktop systems I misread card->id as being card->shortname in the /proc/asound output. The former is far too cryptic to be idiomatic in the input subsystem.
Yeah, card->id is no good form. card->shortname usually contains the basic vendor and product names but without irq, i/o port or such information as in longname.
Takashi
On 18 Feb 2009, at 15:15, Takashi Iwai tiwai@suse.de wrote:
At Wed, 18 Feb 2009 14:39:14 +0000, Mark Brown wrote:
On Wed, Feb 18, 2009 at 02:40:09PM +0100, Takashi Iwai wrote:
I'm not sure whether I've already asked it, but I find it ugly to refer to card->longname for the input device name in sound/core/jack.c.
Yes, it was discussed at the time. This was chosen because the input subsystems tends towards the verbose when giving names to devices.
Ah yes, but longname is still too ugly as an identifier, IMHO. That's why I'm asking again.
At each time it's shown in kernel messages, I wonder what is that at all. It's hard to decode as "Jack..." string appears at the very last of the name.
Sorry, I wasn't clear - I agree with the proposed change.
Can it be changed to card->shortname, at least?
Obviously, it's just a display string. I think what happened is that when I checked this on some desktop systems I misread card->id as being card->shortname in the /proc/asound output. The former is far too cryptic to be idiomatic in the input subsystem.
Yeah, card->id is no good form. card->shortname usually contains the basic vendor and product names but without irq, i/o port or such information as in longname.
Takashi
At Wed, 18 Feb 2009 15:36:00 +0000, Mark Brown wrote:
On 18 Feb 2009, at 15:15, Takashi Iwai tiwai@suse.de wrote:
At Wed, 18 Feb 2009 14:39:14 +0000, Mark Brown wrote:
On Wed, Feb 18, 2009 at 02:40:09PM +0100, Takashi Iwai wrote:
I'm not sure whether I've already asked it, but I find it ugly to refer to card->longname for the input device name in sound/core/jack.c.
Yes, it was discussed at the time. This was chosen because the input subsystems tends towards the verbose when giving names to devices.
Ah yes, but longname is still too ugly as an identifier, IMHO. That's why I'm asking again.
At each time it's shown in kernel messages, I wonder what is that at all. It's hard to decode as "Jack..." string appears at the very last of the name.
Sorry, I wasn't clear - I agree with the proposed change.
OK, fixed now :)
thanks,
Takashi
participants (2)
-
Mark Brown
-
Takashi Iwai