At Tue, 2 Jun 2009 09:29:49 +0200, Daniel Mack wrote:
On Tue, Jun 02, 2009 at 01:46:48AM +0200, Takashi Iwai wrote:
Give the card an 'id' name which will prevent ALSA from calling choose_default_name(). This implementation only took the last part of a name containing whitespaces which for example caused 'Audio 4 DJ' to be shortened to 'DJ', which was not very descriptive.
The implementation now takes the short name and removes all whitespaces from it which is much nicer.
Unfortunately, this code does not handle id collisions for multiple cards.
Moreover, the id can be passed via a module option. Thus overriding the id itself is no good idea.
So what's your suggestion to fix the behaviour I was describing? Maybe a combination of Jaroslav's collision detection together with a logic that does not touch the id in case it was passed as module option?
Sounds reasonable. We may need just a number suffix if any collision occurs.
I'm afraid touching choose_default_name() will cause a lot of breakage for users as their card IDs will suddenly change and former '-D hw:xxx' syntax won't work anymore.
Fully agreed. I'm also against changing the existing behavior.
What we can provide would be an additional function to allow drivers to check the id string before calling snd_card_create().
Meanwhile, I applied the rest patches (except for the version bump) now to topic/caiaq branch on sound git tree, with minor fixes. git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git topic/caiaq Please base on it when you create a new patch.
thanks,
Takashi