[pulseaudio-discuss] Two identical USB sound-cards - second card fails to load because card-name found in hashmap.

Colin Guthrie gmane at colin.guthr.ie
Tue Aug 24 09:29:15 PDT 2010


'Twas brillig, and Tanu Kaskinen at 24/08/10 16:41 did gyre and gimble:
> On Mon, 2010-08-23 at 10:01 +0100, Colin Guthrie wrote:
>> 'Twas brillig, and Tanu Kaskinen at 23/08/10 07:31 did gyre and gimble:
>>> So, how to fix the bug? I'd just add a new module argument for
>>> module-alsa-card: namereg_fail. It could be used by module-udev-detect
>>> to override the normal logic for setting the flag.
>>
>> Either that or just fix udev-detect prior to trying to load it.
> 
> Do you mean making sure that the name is unique in module-udev-detect?
> The module would need to iterate through all card names, try to find
> duplicates and come up with a way for making the new card name unique.
> That code exists already in the name registry, and duplicating it
> doesn't sound like good design. Therefore, I prefer introducing the
> namereg_fail argument for module-alsa-card.

Well yes, but the namereg code may not do it in the most sensible way...

e.g. really we should loop thorugh all devices first, then work out
which ones are duplicates and then work out what to call them...

i.e. if you have two usb cards that would result in same name, then it
would make sense to name them after the ports they are plugged in to...
(but iff there are conflicts).

To be honest it all gets rather messy, as plugging them in one at a time
will ultimately cause problems anyway :s

I can't help but feel that a fallback will ultimately lead to some kind
of problems of one device picking up the others settings in an
unreliable and unpredictable way... but I've not really got any good
suggestions on how to fix it :p


>> However, I *strongly* advise using the latest release of PA + the
>> patches on stable-queue. 0.9.19 is quite old now and there are a couple
>> hundred additional fixes already committed, one of which may have looked
>> at this kind of issue.
> 
> The card name generation in module-udev-detect seems to be unchanged
> between 0.9.19 and git master, so this is most still broken. I wrote a
> fix, btw :) If you like it, please pull. Here's the "git request-pull"
> output:
> 
> The following changes since commit
> ef0c73cb9de92c1ea3c7c3e2fc2808dc87af5c7f:
>   Wim Taymans (1):
>         echo-cancel: take into account snapshot delay
> 
> are available in the git repository at:
> 
>   git://gitorious.org/~tanuk/pulseaudio/tanuk-clone.git master
> 
> Tanu Kaskinen (3):
>       module-alsa-card: New argument: namereg_fail.
>       module-udev-detect: When loading module-alsa-card, use
> namereg_fail=false.
>       alsa-sink: Get rid of a compiler warning regarding
> rewind_safeguard type.
> 
>  src/modules/alsa/alsa-sink.c        |    4 ++--
>  src/modules/alsa/module-alsa-card.c |   15 +++++++++++++++
>  src/modules/module-udev-detect.c    |    1 +
>  3 files changed, 18 insertions(+), 2 deletions(-)
> 

Cool, I'll take a look soon :)

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list