After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 332442 - multiple sound devices with the same name aren't shown
multiple sound devices with the same name aren't shown
Status: RESOLVED FIXED
Product: ekiga
Classification: Applications
Component: Devices
GIT master
Other All
: Low enhancement
: ---
Assigned To: Snark
Ekiga maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-24 13:32 UTC by Real Name
Modified: 2013-01-28 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
New class to make life easier for plugin writers (581 bytes, text/plain)
2006-09-01 19:45 UTC, Snark
  Details
Sample test for the PNoCollisionDictionary class (506 bytes, text/plain)
2006-09-01 19:46 UTC, Snark
  Details
Updated code (792 bytes, text/plain)
2006-09-02 16:44 UTC, Snark
  Details
Patch for the alsa plugin (4.38 KB, patch)
2006-11-25 21:14 UTC, Snark
none Details | Review
Patch for the alsa plugin (4.31 KB, patch)
2007-02-01 17:30 UTC, Snark
none Details | Review

Description Real Name 2006-02-24 13:32:38 UTC
Please describe the problem:
well, that's basically it  
  
And, BTW, this bugzilla stuff sucks - the amount of work I had to do, just to 
let you know this single line of text: first, I had to create an account with 
some made-up information totally unrelated to the bug and then I even had to 
enable cookies in the browser or enter the login information after every step. 

Steps to reproduce:
1. 
2. 
3. 

Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Snark 2006-04-20 15:21:52 UTC
ALSA plugin limitation ?
Comment 2 Damien Sandras 2006-04-20 15:24:24 UTC
Yes.
Comment 3 Snark 2006-08-31 19:45:36 UTC
What can be done to fix this limitation ?
Comment 4 Damien Sandras 2006-08-31 20:32:12 UTC
Append #1, #2, ... to identical names and make sure the function that is doing the Open() can determine which soundcard to open in such a case.
Comment 5 Snark 2006-09-01 05:17:23 UTC
I had an idea tonight : let's write a dictionary/mapping/associative array/whatever you want to call it, which maps strings to "device descriptors" (the plugin puts whatever it wants here), with an Add (key, descriptor) method, which would do the following :
- if key is not in here already, just Set(key, descriptor) ;
- if it is in there, see if key + "[2]", key + "[3]", etc are there, and when we find one which isn't, just Set(newKey, descriptor).

Now our device plugins would have a dict of this type in them, and :
(1) GetDeviceNames would dict.Flush (), then Add (not Set) all detected plugins to dict
(2) Open would search the name in the dict, and use the descriptor associated to it.

This would allow sharing the code to solve device name collision between all the plugins easily (and simplify their code...).

Good idea ?
Comment 6 Damien Sandras 2006-09-01 11:02:17 UTC
I think it is a good idea...
Comment 7 Snark 2006-09-01 11:18:58 UTC
Ok, yet another bug in my list... sigh.
Comment 8 Snark 2006-09-01 19:45:25 UTC
Created attachment 72043 [details]
New class to make life easier for plugin writers

Ok, I took a few minutes to write my idea down. How does that look ?
Comment 9 Snark 2006-09-01 19:46:48 UTC
Created attachment 72044 [details]
Sample test for the PNoCollisionDictionary class

If you put this file in the same directory as no_collision_dict.h, you should be able to just do :
g++ test.cxx -lpt -o test
to see it in action.
Comment 10 Snark 2006-09-01 20:48:56 UTC
Hmmmm... where is the GetKeys method I would need ?
Comment 11 Damien Sandras 2006-09-02 15:01:22 UTC
Looks good, now you need the opposite method.
Comment 12 Snark 2006-09-02 16:44:53 UTC
Created attachment 72085 [details]
Updated code

This one has the GetKeys method too.
Comment 13 Snark 2006-11-25 21:14:39 UTC
Created attachment 77140 [details] [review]
Patch for the alsa plugin

Ok, this patch uses my little PNoCollisionDictionary class, and is mostly clean (it just has a silly #include on the class header in my home directory).

Some testing by someone else would be appreciated.
Comment 14 Snark 2007-02-01 17:30:26 UTC
Created attachment 81681 [details] [review]
Patch for the alsa plugin

This patch is now current with cvs -- notice that for some reason the "Default" devices don't work. But since those are added brute-force, I don't know why they should work either ; here is the error message in console using them :
ALSA lib pcm.c:2017:(snd_pcm_open_conf) Invalid type for PCM default definition (id: default, value: cards.pcm.default)

But it does detect all devices libasound2 makes available.
Comment 15 Snark 2007-07-25 19:37:12 UTC
Is there a way to make a "please-fellow-developpers-review" tag? ;-)
Comment 16 Snark 2007-12-07 20:32:35 UTC
Sigh, I guess I'll write patches replicating this for each and every plugin...
Comment 17 Jan Schampera 2008-09-05 04:27:41 UTC
What about this in 3.x with current ptlib?
Comment 18 Snark 2008-09-05 05:50:39 UTC
Well, Jan, you see the comments... I'm still waiting for feedback!
Comment 19 Damien Sandras 2008-09-05 07:49:08 UTC
As long as the "default" devices do not work, we can not use it...

Are you using plughw ?
Comment 20 Eugen Dedu 2009-03-25 15:40:08 UTC
Any news?
Comment 21 Snark 2009-03-25 20:48:56 UTC
None. I'd prefer having a single good-working gstreamer plugin (which would relieve us from the care of such things).
Comment 22 Eugen Dedu 2009-03-26 14:27:57 UTC
Is this bug still valid, since I see in the changelog for 3.2.0:
- Allow several ALSA devices to have the same name
Comment 23 Eugen Dedu 2013-01-28 10:52:09 UTC
This is fixed in the future 4.0.1.  ALSA added [1], [2] etc., and moreover the sub-device name is added to the device name.