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 646996 - Speaker test does not read theme correctly
Speaker test does not read theme correctly
Status: RESOLVED DUPLICATE of bug 647254
Product: gnome-control-center
Classification: Core
Component: Sound
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-07 07:58 UTC by David Henningsson
Modified: 2011-07-29 04:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to make speaker test pick up the current sound theme (1.51 KB, patch)
2011-04-07 07:59 UTC, David Henningsson
none Details | Review

Description David Henningsson 2011-04-07 07:58:40 UTC
In Ubuntu, we set the theme to "Ubuntu" which is usually picked up by libcanberra, but for speaker-test it isn't. I'm not sure whether this is a bug in gnome-volume-control or in libcanberra, but it was easier to make a patch for gnome-volume-control (see attachment).
Comment 1 David Henningsson 2011-04-07 07:59:41 UTC
Created attachment 185396 [details] [review]
Patch to make speaker test pick up the current sound theme
Comment 2 Robert Ancell 2011-04-11 07:24:44 UTC
I'm not sure if this patch is correct, as you shouldn't need to explicitly set the theme, and I think this stops the sound theme fallback behaviour from working.

The original problem was the "Test Speakers" feature wasn't working unless "Enable window and button sounds" is enabled.  And digging around, this was found to be due to the Ubuntu sound theme not providing test sounds.  The fallback behaviour for a missing sound is to play the bell, and this seems to be (incorrectly in this case) dependent on the master "window and button sounds" setting.  If you install the freedesktop sound theme (which provides the test sounds) it all works as expected.

So, the correct solution I think is for the fallback sound to be played correctly (not sure what part of the stack that is)

The Ubuntu bug is:
https://bugs.launchpad.net/ubuntu/+source/gnome-media/+bug/736349
Comment 3 David Henningsson 2011-04-11 08:16:04 UTC
@Robert,

The theme is normally being set the same way in libcanberra - the patch above is code almost copy-pasted from there - but this is not done for speaker-test as it uses pa_context_create to manually create a context, instead of using libcanberra's standard context for gtk applications. The patch causes speaker-test to use the same theme lookup methods as being done for other gtk applications. 

I'm not sure the patch is the right way to solve the problem, but that's more about whether that code should be some kind of convenience function in libcanberra, instead of being coded manually in the speaker test function. 

As for the "enable window and button sounds" setting, my conclusion is different than yours: when this is enabled, there is a bell for *every* button you click, that's what you hear. That bell does not work as a fallback as it always sounds in the same channel (panned in the middle), regardless of what button you click in speaker-test.
Comment 4 Bastien Nocera 2011-04-11 17:12:20 UTC
I don't see how doing what you're doing would help libcanberra one bit. It already gets its sound theme name through XSettings (which is where GTK+ gets it too).

If there's any bugs here, it sounds like it's in libcanberra. Try using canberra-gtk-play with the same properties, and see whether you can reproduce the bug. If so, it'd be a bug there.
Comment 5 Robert Ancell 2011-04-12 06:01:49 UTC
@David, for me the bell plays in the correct channel only.  I hadn't considered if it was the button click that was triggering it, but the fact it plays only in one channel made me think it was falling back to it.
Comment 6 David Henningsson 2011-04-12 06:36:03 UTC
@Bastien, the reason why canberra-gtk-play works and speaker-test does not (i e without my patch), is that canberra-gtk-play calls ca_gtk_context_get() to get the context, which in turn checks the "gtk-sound-theme-name" property (which is in the gtk_settings of the screen, see gtk-canberra.c). 
Speaker-test instead calls pa_context_create(), which does not check the "gtk-sound-theme-name" property, and so the Ubuntu sound theme override is not being picked up.
Comment 7 Robert Ancell 2011-04-12 07:28:13 UTC
Further testing shows my system is not behaving correctly so please disregard my comments.
Comment 8 Akhil Laddha 2011-06-15 05:44:23 UTC
duplicate of bug 647254 ?
Comment 9 Akhil Laddha 2011-07-29 04:28:02 UTC
Thanks for taking the time to report this bug.
This particular bug has already been reported into our bug tracking system, but the maintainers need more information to fix the bug. Could you please answer the questions in the other report in order to help the developers?

*** This bug has been marked as a duplicate of bug 647254 ***