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 155121 - No sound when pressing play button
No sound when pressing play button
Status: RESOLVED FIXED
Product: libgnome
Classification: Deprecated
Component: general
2.6.x
Other other
: Normal normal
: ---
Assigned To: libgnome maintainer
libgnome maintainer
Depends on:
Blocks:
 
 
Reported: 2004-10-11 18:28 UTC by Cliff Wright
Modified: 2006-10-23 10:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description Cliff Wright 2004-10-11 18:29:16 UTC
Distribution: NetBSD 2.0_BETA/i386
Package: control-center
Severity: normal
Version: GNOME2.6.2 2.6.x
Gnome-Distributor: GNOME.Org
Synopsis: No sound when pressing play button
Bugzilla-Product: control-center
Bugzilla-Component: sound
Bugzilla-Version: 2.6.x
Description:
Description of Problem:
No sound is heard when selecting a sound (e.g. generic.wav), and
pressing the Play button.


Steps to reproduce the problem:
1. This is an esd configured system
2. 
3. 

Actual Results:


Expected Results:


How often does this happen?


Additional Information: Although this is for 2.6.x, I see from cvs that
the same problem exist in the latest. libgnome/libgnome/gnome-sound.c
has this odd code that treats a null host being passed to esd as
sometimes ok, and other times not. Yet it is always ok to pass a null
host to esd, and preferable, as gome has no way to pass parameters to
esd, and with null passed the end user can provide an environment
variable with the host info.
The patch I used to fix this is below:

--- libgnome-2.6.1.1/libgnome/gnome-sound.c.orig        2002-01-08
13:17:34.0000
00000 -0800
+++ libgnome-2.6.1.1/libgnome/gnome-sound.c     2004-10-07
16:07:33.000000000 -0
700
@@ -39,7 +39,6 @@

 #ifdef HAVE_ESD
 static char *esound_hostname = NULL;
-static gboolean esound_hostname_null_ok = FALSE;
 static int gnome_sound_connection = -1;
 #endif

@@ -300,15 +299,14 @@
 use_sound (void)
 {
   if (gnome_sound_connection == -1){
-    if (esound_hostname || esound_hostname_null_ok){
       gnome_sound_connection = esd_open_sound (esound_hostname);
       if (gnome_sound_connection == -1){
-       g_free (esound_hostname);
-       esound_hostname = NULL;
-       esound_hostname_null_ok = FALSE;
+       if(esound_hostname){
+         g_free (esound_hostname);
+         esound_hostname = NULL;
+       }
        return FALSE;
       }
-    }
   }
   return TRUE;
 }
@@ -505,11 +503,12 @@
 {
 #ifdef HAVE_ESD
        srand(time(NULL));
-       g_free (esound_hostname);
+       if(esound_hostname){
+         g_free (esound_hostname);
+         esound_hostname = NULL;
+       }
        if (hostname)
                esound_hostname = g_strdup (hostname);
-       else
-               esound_hostname_null_ok = TRUE;
 #endif
 }

@@ -522,8 +521,10 @@
 gnome_sound_shutdown(void)
 {
 #ifdef HAVE_ESD
-       g_free (esound_hostname);
-       esound_hostname = NULL;
+       if(esound_hostname){
+         g_free (esound_hostname);
+         esound_hostname = NULL;
+       }
        if(gnome_sound_connection >= 0){
                esd_close(gnome_sound_connection);
                gnome_sound_connection = -1;




------- Bug moved to this database by unknown@bugzilla.gnome.org 2004-10-11 14:29 -------


Unknown platform unknown. Setting to default platform "Other".
Unknown milestone "unknown" in product "control-center".
   Setting to default milestone for this product, '---'
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here, unknown@bugzilla.gnome.org.
   Previous reporter was cliff@snipe444.org.
Setting to default status "UNCONFIRMED".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.

Comment 1 Vincent Noel 2004-10-12 15:55:10 UTC
Adding the PATCH keyword for visibility.
Comment 2 Jody Goldberg 2004-10-20 22:15:04 UTC
That patch seems reasonable.  Lets re-assign this to libgnome
Comment 3 Kjartan Maraas 2005-01-04 01:47:39 UTC
Anders? Is this good to go?
Comment 4 Kjartan Maraas 2006-10-23 10:58:00 UTC
I commited this. Sorry for taking so long and please verify that it works since I had to apply the patch by hand.