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 118230 - esound should read esd.conf and friends whether it is to autospawn or not
esound should read esd.conf and friends whether it is to autospawn or not
Status: RESOLVED FIXED
Product: esound
Classification: Deprecated
Component: general
0.2.29
Other Linux
: Normal enhancement
: ---
Assigned To: Esound Maintainers
Esound Maintainers
: 97138 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-07-24 20:43 UTC by James Strandboge
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to make esd read esd.conf and friends when not autospawning (8.64 KB, patch)
2003-07-24 20:45 UTC, James Strandboge
none Details | Review

Description James Strandboge 2003-07-24 20:43:53 UTC
Currently when apps like gnome-session call esd and esd is not set to
autospawn, esd does not read esd.conf ESD_SPAWN_OPTIONS or ~/.esd.conf. 
Since esd is often by default not set to autospawn, esd may not work with
certain soundcards that need to specify a rate for esd to work at all (eg
i810_audio needs '-r 48000' to work with esd).

The proposed patch allows esd to work in a more standard way-- it will read
 environment variables (ESD_SPAWN_OPTIONS) and config files (esd.conf and
~/.esd.conf) in addition to parsing command line arguments.

The basic idea of the patch is to take some stuff out of esd_config.c
and put it into a new esd-config.h, so that esd.c can use it, then
modify esd.c (main()) to put esd_spawn_options (as read from esd.conf and
friends) into *opts[], and then put argv after esd_spawn_options in
*opts[]. Then rather than looping through argv, the loop parses *opts[]. 
argv is after esd_spawn_options in *opts[] so that command line arguments
take precedence over esd.conf.

I use esd_config_read() in main() so that esd.conf, ~/.esd.conf and
ESD_SPAWN_OPTIONS are all considered.

The maximum number of combined arguments (argv + esd_spawn_options) is
MAX_ARGS, which in the patch is 128.  This is probably too high, but as
the patch is now, arguments from esd_spawn_options and argv are read
into *opts[], and stops at MAX_ARGS-- any more args are simply dropped. 
So I left it high.

The proposed patch applies cleanly to 0.2.29 and was checked under memprof
with no leaks.
Comment 1 James Strandboge 2003-07-24 20:45:01 UTC
Created attachment 18579 [details] [review]
patch to make esd read esd.conf and friends when not autospawning
Comment 2 Frederic Crozat 2003-08-01 13:34:17 UTC
Modified version committed on CVS. Thanks.
Comment 3 Frederic Crozat 2004-01-12 10:43:04 UTC
*** Bug 97138 has been marked as a duplicate of this bug. ***