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

2010-09-02 Thread Colin Guthrie
'Twas brillig, and Ivar Mossin at 01/09/10 23:23 did gyre and gimble:
 On Mon, Aug 30, 2010 at 5:49 PM, Tanu Kaskinen ta...@iki.fi
 mailto:ta...@iki.fi wrote:
 
 I pushed a new patch to my repo. The patch should now solve the problem
 of identically named sinks and sources too. Please test :)
 
 
 I pulled your latest changes and compiled. According to the logs both
 cards with sinks and sources loaded perfectly. Thank you very much for
 your effort. :)

OK, I've pushed Tanu's patch to master now.

Thanks for testing.

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/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-09-01 Thread Ivar Mossin
On Mon, Aug 30, 2010 at 5:49 PM, Tanu Kaskinen ta...@iki.fi wrote:

 I pushed a new patch to my repo. The patch should now solve the problem
 of identically named sinks and sources too. Please test :)


I pulled your latest changes and compiled. According to the logs both cards
with sinks and sources loaded perfectly. Thank you very much for your
effort. :)

-Ivar!
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-30 Thread Tanu Kaskinen
On Sun, 2010-08-29 at 23:27 +0200, Ivar Mossin wrote:
 Thanks for the fix. I've been a bit busy lately, so haven't had the
 time to look too closely into it. But I cloned your git repo and tried
 to run it. The alsa-module did load nicely, however, it seemed to be a
 similar issue when creating the sink:

Good that you can handle compiling from source and testing git versions,
because as was demonstrated, I'm not able to test module-udev-detect's
ability to load multiple identical cards myself :)

 Unless you get ahead of me, I could try to see if I'm able to apply a
 similar approach as you did for loading the card itself. But as I
 said, I didn't have time to look too closely into it yet.

I pushed a new patch to my repo. The patch should now solve the problem
of identically named sinks and sources too. Please test :)

-- 
Tanu Kaskinen

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-29 Thread Ivar Mossin
Daniel Mack:
 BTW, just out of curiosity: did you ever try to connect these two cards to
a Windows machine? At least years ago, Microsoft's insanely ugly-smelling
low-level USB stack would completely freak out for two identical devices
with no serial number.

No, I don't have access to a windows machine, so I couldn't test it.

Tanu Kaskinen:

Thanks for the fix. I've been a bit busy lately, so haven't had the time to
look too closely into it. But I cloned your git repo and tried to run it.
The alsa-module did load nicely, however, it seemed to be a similar issue
when creating the sink:


Aug 29 22:27:06 willpower pulseaudio[32123]: sink.c: Failed to register name
alsa_output.usb-BeAutiful_Qing_Audioengine_AW1-00.analog-stereo.
Aug 29 22:27:06 willpower pulseaudio[32123]: alsa-sink.c: Failed to create
sink object
Aug 29 22:27:06 willpower pulseaudio[32123]: module.c: Loaded
module-alsa-card (index: #2; argument: device_id=2
name=usb-BeAutiful_Qing_Audioengine_AW1-00
card_name=alsa_card.usb-BeAutiful_Qing_Audioengine_AW1-00
namereg_fail=false tsched=yes ignore_dB=no
card_properties=module-udev-detect.discovered=1).


When issuing 'pactl list' I could find the other cards with their
sinks/sources, and I also found the second card correctly named
'alsa_card.usb-BeAutiful_Qing_Audioengine_AW1-00.2', but no sinks connected
to it. Quickly looking into the source, the failing log-output comes from
pulsecore/card.c:185 as it hits the if-test:
if (!(name = pa_namereg_register(core, data-name, PA_NAMEREG_SINK, s,
data-namereg_fail))) {

Unless you get ahead of me, I could try to see if I'm able to apply a
similar approach as you did for loading the card itself. But as I said, I
didn't have time to look too closely into it yet.


-Ivar!
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-24 Thread Tanu Kaskinen
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.

 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(-)

-- 
Tanu Kaskinen

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-23 Thread Tanu Kaskinen
On Sat, 2010-08-21 at 21:51 +0200, Ivar Mossin wrote:
 So my questions are:
 Is there a way to load both these cards without modifying the source?

This is a bug that should be fixed in the source. But you can work
around this by loading the failing card manually, just give it a unique
name in the module arguments.

 What is the reasoning behind setting this flag at all?
 Which side-effect will I experience by simply ignoring this flag, and
 trying to add a .%u to the card-name anyway?

The flag exists, because if the card is loaded manually, and the user
provides a name for the card, it makes sense to fail in case the name
isn't unique. The user may have some configuration or scripts or
something that depends on the name not being automatically mangled -
failing early in such situation is better than failing late.

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.

-- 
Tanu Kaskinen

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-23 Thread Colin Guthrie
'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.

I'm guessing this could be related to a duplicate serial number in the
usb device itself or similar (e.g. lazy manufacturers?). This is why
Daniel asked for lsusb -v output to see what additional details are able
to be used here.


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.

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/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-23 Thread Daniel Mack
On Sun, Aug 22, 2010 at 04:12:43PM +0200, Ivar Mossin wrote:
 On Sun, Aug 22, 2010 at 2:52 AM, Daniel Mack dan...@caiaq.de wrote:
  Can you post the output of lsusb -v with both cards connected?
 
  Thanks,
  Daniel
 
 
 Daniel:
 I'm not sure how the output of lsusb -v will help the issue as both cards
 are working in ALSA, 

What it shows is that these cards don't offer a serial number string. If
they did, the behaviour would be different IIRC.

BTW, just out of curiosity: did you ever try to connect these two cards
to a Windows machine? At least years ago, Microsoft's insanely
ugly-smelling low-level USB stack would completely freak out for two
identical devices with no serial number.

Daniel

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-22 Thread Chris Gilland
OK, well, thanks for not jumping down my throat.  As I said, I really don't 
have a clue, but figured that could possibly be the case.  If that isn't it, 
then I'm sorry, I don't have a slightest idea.

Again, sorry about that.  I figured I'd at least take a stab, though.

Chris.

  - Original Message - 
  From: Ivar Mossin 
  To: General PulseAudio Discussion 
  Sent: Saturday, August 21, 2010 8:40 PM
  Subject: Re: [pulseaudio-discuss] Two identical USB sound-cards - second card 
fails to load because card-name found in hashmap.


  Thanks for the reply, but no, that is not the case. Both cards are working in 
ALSA. They are both USB cards, and all USB devices share 1 single IRQ assigned 
to the USB-Controller, AFAIK.

  Ivar.


  On Sat, Aug 21, 2010 at 11:54 PM, Chris Gilland cgilla...@carolina.rr.com 
wrote:

Is it possible that sense you have two of the exact same cards, maybe one 
of them isn't working as there is an I R Q conflict between both of them?  I'll 
admit my expertees on Pulse Audio are not very good at all, and probably I 
shouldn't be making this assumption being I really don't totally know what I'm 
doing, admittedly, but it is a thought.

Chris.





--


  ___
  pulseaudio-discuss mailing list
  pulseaudio-discuss@mail.0pointer.de
  https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-22 Thread Ivar Mossin
On Sun, Aug 22, 2010 at 2:52 AM, Daniel Mack dan...@caiaq.de wrote:


 Can you post the output of lsusb -v with both cards connected?

 Thanks,
 Daniel


Daniel:
I'm not sure how the output of lsusb -v will help the issue as both cards
are working in ALSA, PulseAudio can find both cards and I have traced the
problem to one particular point in the source-code where the problem is that
both cards have the same name, causing the loading of the module to fail,
rather than the USB devices not being detected by the system. Unless, of
course, I'm on the completely wrong track with my debugging. However, I
added the lsusb -v output on pastebin [ http://pastebin.com/LX1zaR1R ].


 OK, well, thanks for not jumping down my throat.  As I said, I really
don't have a clue, but figured that could possibly be the case.  If that
isn't it, then I'm sorry, I don't have a slightest idea.
 Again, sorry about that.  I figured I'd at least take a stab, though.

 Chris.

Chris:
I don't have for a habit to jump down the throat of those trying to help me.
No worries. :)


-Ivar!
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-21 Thread Chris Gilland
Is it possible that sense you have two of the exact same cards, maybe one of 
them isn't working as there is an I R Q conflict between both of them?  I'll 
admit my expertees on Pulse Audio are not very good at all, and probably I 
shouldn't be making this assumption being I really don't totally know what I'm 
doing, admittedly, but it is a thought.

Chris.

  - Original Message - 
  From: Ivar Mossin 
  To: pulseaudio-discuss@mail.0pointer.de 
  Sent: Saturday, August 21, 2010 3:51 PM
  Subject: [pulseaudio-discuss] Two identical USB sound-cards - second card 
fails to load because card-name found in hashmap.


  Hello.

  I'm having problems loading two identical sound-cards in my computer. I'm 
using Ubuntu 9.10 and PulseAudio 0.9.19 coming with this release.

  I have tried looking at the logs, and when using loglevel 4 I find these 
lines:

  (first card - failing scenario):
  Aug  9 22:53:08 ivar-laptop pulseaudio[2573]: module.c: Loaded 
module-alsa-card (index: #24; argument: device_id=1 
name=usb-BeAutiful_Qing_Audioengine_AW1-00 
card_name=alsa_card.usb-BeAutiful_Qing_Audioengine_AW1-00 tsched=yes 
ignore_dB=no card_properties=module-udev-detect.discovered=1).

  (second card - failing scenario):
  Aug  9 22:58:32 ivar-laptop pulseaudio[2573]: module.c: Failed to load  
module module-alsa-card (argument: device_id=2 
name=usb-BeAutiful_Qing_Audioengine_AW1-00 
card_name=alsa_card.usb-BeAutiful_Qing_Audioengine_AW1-00 tsched=yes 
ignore_dB=no card_properties=module-udev-detect.discovered=1): 
initialization failed.


  I downloaded the source-code using 'apt-get source pulseaudio' and was 
looking around a bit. What I found was that the pa__init() function in 
modules/alsa/module-alsa-card.c called a function pa_card_new() located in 
pulsecore/card.c which returned a null-pointer. This function again called 
pa_namereg_register() in pulsecore/namereg.c which returned NULL because it 
could find the card-name in the hashmap and the fail argument was set to TRUE. 
As a simple test, I changed the fail argument to FALSE, and the second module 
loaded as well:

  (first card - working scenario):
  Aug 21 18:10:03 ivar-laptop pulseaudio[3835]: module.c: Loaded 
module-alsa-card (index: #18; argument: device_id=2 
name=usb-BeAutiful_Qing_Audioengine_AW1-00 
card_name=alsa_card.usb-BeAutiful_Qing_Audioengine_AW1-00 tsched=yes 
ignore_dB=no card_properties=module-udev-detect.discovered=1).

  (second card - working scenario):
  Aug 21 18:12:37 ivar-laptop pulseaudio[3835]: module.c: Loaded 
module-alsa-card (index: #19; argument: device_id=3 
name=usb-BeAutiful_Qing_Audioengine_AW1-00 
card_name=alsa_card.usb-BeAutiful_Qing_Audioengine_AW1-00 tsched=yes 
ignore_dB=no card_properties=module-udev-detect.discovered=1).


  Having this flag set to TRUE basically disables the functionality further 
down in the pa_namereg_register() which tries to add a .%u to the card-name, 
where %u starts at 2 and gives up at 99. Trying to figure out where this flag 
was set, I found that it had been set by a function set_card_name() called 
further up in pa__init(). If the module being loaded has the argument 
card_name or name, then data-namereg_fail is set to TRUE. Looking at the 
arguments given in the logfile, it actually provides both of these arguments, 
also at load-time:

  (second card - failing scenario):
  Aug  9 22:58:32 ivar-laptop pulseaudio[2573]: module-udev-detect.c: Loading 
module-alsa-card with arguments 'device_id=2 
name=usb-BeAutiful_Qing_Audioengine_AW1-00 
card_name=alsa_card.usb-BeAutiful_Qing_Audioengine_AW1-00 tsched=yes 
ignore_dB=no card_properties=module-udev-detect.discovered=1'


  So my questions are:
  Is there a way to load both these cards without modifying the source?
  Can I configure something to make this work?
  What is the reasoning behind setting this flag at all?
  Which side-effect will I experience by simply ignoring this flag, and trying 
to add a .%u to the card-name anyway?

  Thanks for any help provided.


  Kind Regards,
  Ivar Mossin



--


  ___
  pulseaudio-discuss mailing list
  pulseaudio-discuss@mail.0pointer.de
  https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-21 Thread Ivar Mossin
Thanks for the reply, but no, that is not the case. Both cards are working
in ALSA. They are both USB cards, and all USB devices share 1 single IRQ
assigned to the USB-Controller, AFAIK.

Ivar.

On Sat, Aug 21, 2010 at 11:54 PM, Chris Gilland
cgilla...@carolina.rr.comwrote:

  Is it possible that sense you have two of the exact same cards, maybe one
 of them isn't working as there is an I R Q conflict between both of them?
 I'll admit my expertees on Pulse Audio are not very good at all, and
 probably I shouldn't be making this assumption being I really don't totally
 know what I'm doing, admittedly, but it is a thought.

 Chris.

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


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

2010-08-21 Thread Daniel Mack
On Sat, Aug 21, 2010 at 09:51:17PM +0200, Ivar Mossin wrote:
 I'm having problems loading two identical sound-cards in my computer. I'm
 using Ubuntu 9.10 and PulseAudio 0.9.19 coming with this release.

Can you post the output of lsusb -v with both cards connected?

Thanks,
Daniel
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss