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 97138 - esd server option are harcoded
esd server option are harcoded
Status: RESOLVED DUPLICATE of bug 118230
Product: gnome-control-center
Classification: Core
Component: Sound
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-10-29 15:25 UTC by Christian Marillat
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make esd read esd.conf if called without arguments (8.14 KB, patch)
2002-12-12 23:28 UTC, James Strandboge
none Details | Review
make esd always use esd_config_read(), instead of just when autospawning (8.22 KB, patch)
2002-12-13 14:29 UTC, James Strandboge
none Details | Review

Description Christian Marillat 2002-10-29 15:25:39 UTC
Hi,

http://bugs.debian.org/125803

Default options for esd are harcoded. Esd should read his options in
/etc/esound/esd.conf instead.
Comment 1 Christian Marillat 2002-10-29 15:47:42 UTC
Sorry but this bug is a control center bug.

In gnome-settings-daemon/gnome-settings-sound.c line line 53 I read :

static const char *esd_cmdline[] = {ESD_SERVER, "-nobeeps", NULL};
Comment 2 Andrew Sobala 2002-11-08 19:07:15 UTC
*** Bug 3558 has been marked as a duplicate of this bug. ***
Comment 3 Christian Marillat 2002-11-08 19:20:12 UTC
Bug 3558 has nothing to do with this bug.
Comment 4 Andrew Sobala 2002-11-08 19:57:42 UTC
You can't fix both bugs though. Either esd reads its options from
esd.conf (the right thing to do), or control-center sets them (would
work for fixing bug 3558, but that is what this bug is about!).
Comment 5 James Strandboge 2002-12-12 23:24:58 UTC
I have been trying to get esd and gnome to work with my laptop for
some time, and have to specify -r 48000 to esd to get it to work.  I
feel the esd.conf file should be read by esd if no other options are
present.  Based on feedback from others, this seems like the right
thing to do.  I could patch gnome-session to parse esd.conf, but esd's
default behavior is backward IMO, so I did it there.

This patch makes esd read in esd.conf if it is called without
arguments (and ESD_SPAWN_OPTIONS is unset).  Though other behaviors
are possible, this made the most sense to me:  if the user supplies
command line arguments, then assume the user knows what he or she is
doing and don't merge in esd.conf.  Likewise for ESD_SPAWN_OPTIONS.

The benefits of this patch are twofold.  

1.  the user can adjust a single configuration file, rather than
having to worry about environment variables and command line
arguments.  It also keeps users from wondering why adjusting esd.conf
doesn't do anything when esd is not set to autospawn (its default
behavior).

2.  this patch decouples gnome-session from having to know what
options are used to set esd (eg, '-nobeeps').  The esound packager can
simply put in reasonable defaults into esd.conf, and gnome-session
will just work.  Because this patch only reads esd.conf if esd is
called with no options, gnome-session would need to be recompiled to
not pass esd any options (trivial).

The patch is based on the existing code in esound.  First, I created
esd-config.h, and just pulled a couple of defines out of esd_config.c
and put them into esd-config.h, so I could use them in esd.c.  I did a
small cleanup to get rid of a compilation warning for the strtok_r
define.  After that, the only change to esd_config.c is to include
esd-config.h.

The main part of the patch is a modification to esd.c, in main(). 
Basically, I reference esd_spawn_options in esd_config.c in the same
manner that esdlib.c does (ie via extern).  Then, if argc > 1, nothing
is changed-- command line arguments are processed.  If argc == 1, then I
call esd_config_read() (from esd_config.c), tokenize esd_spawn_options
and then they are processed with the same code that processes argv.

To make the code cleaner, I made:

num_opts = argc;
opts = argv;

and then just use num_opts and opts in place of argc and argv for
parsing the arguments.  The net effect is that if esd is called without
arguments, I create arguments for it based on the 'spawn_options' line
in esd.conf.  Because I am using esd_config_read(), ESD_SPAWN_OPTIONS
are also honored.

To apply, save the patch to the directory that esound-0.2.28 is in, and
do:
cd esound-0.2.28
cat ../esound-0.2.28.esdconf.patch | patch -p1
Comment 6 James Strandboge 2002-12-12 23:28:44 UTC
Created attachment 12954 [details] [review]
make esd read esd.conf if called without arguments
Comment 7 James Strandboge 2002-12-13 14:29:01 UTC
Created attachment 12970 [details] [review]
make esd always use esd_config_read(), instead of just when autospawning
Comment 8 James Strandboge 2002-12-13 14:36:13 UTC
Based on feedback from the debian maintainer, I changed the patch to
make esd.conf a general config file.  In other words, esd always looks
at ESD_SPAWN_OPTIONS and spawn_options in esd.conf first (by calling
esd_config_read()), then merges command line arguments.  Command line
arguments take precedence over ESD_SPAWN_OPTIONS and esd.conf.

This patch will greatly help gnome users have have flaky hardware
(like me with i810_audio) who have to specify a rate for esd to work
at all.  It also makes configuring esd more intuitive in that the user
can configure it using /etc/esound/esd.conf, ~/.esd.conf,
ESD_SPAWN_OPTIONS, and command line arguments-- esd will act the same
whether it is set to autospawn or not.

Please use the new patch instead..
Comment 9 Kjartan Maraas 2002-12-14 18:28:08 UTC
Maybe doing some work to create a list of known problematic hardware
would be nice too. I'm sure that would help the bugherders when trying
to help users fix their sound problems.
Comment 10 Frederic Crozat 2003-03-13 15:09:14 UTC
*** Bug 108197 has been marked as a duplicate of this bug. ***
Comment 11 Kjartan Maraas 2003-04-22 23:20:33 UTC
Should the patch keyword be removed? Is there a patch in here that's
acceptable?
Comment 12 Kjartan Maraas 2004-01-11 14:57:47 UTC
Frédéric? Should we remove the patch keyword or close this or what do
you think?
Comment 13 Frederic Crozat 2004-01-12 10:43:05 UTC
Hmm, James opened another bug with this patch (or a similar patch)
attached and it was applied to esound.

Duplicating..

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