15
4
On my system, for apps that use SDL, I need to set an environmental variable:
export SDL_AUDIODRIVER=alsa
to get the sound to work properly. How do I set up my GNOME session so that this variable is present for all applications (so if I run an application through Nautilus, or use DBGL, the apps work properly)?
EDIT:
Configuration files I have set (and reset my machine after each) to no avail:
.xsession
.xsessionrc
.gnomerc
.bash_profile
.profile
<-- This works in the general case, but not when your distro is setting the variable elsewhere./etc/profile
Are you sure this needs to be an environment variable? Seems like it might be some other kind of setting. Have you dug around in the system sound settings applet? – codeLes – 2009-08-06T15:29:36.697
It does indeed. This is how SDL figures out what backend to use. I wish it just used a configuration file, but SDL is fairly consistent in its use of environmental variables to dictate behaviour. – Bernard – 2009-08-06T15:31:15.850
have you seen this: http://modarchive.org/forums/index.php?topic=1879.0
– codeLes – 2009-08-06T15:35:45.2001Well yeah, it's a choice between recompiling SDL or setting an environmental variable. I think I'm making the right choice. :p This works (i.e., in a shell, it works) it's just the thorny issue of getting GNOME to propagate the variable for apps not started from a shell that's the issue. Thank you for your continuing help. – Bernard – 2009-08-06T15:45:12.670
What distro is this in?! (I agree that the config for gdm is really hard to follow, so my first thought, "just look in /etc/gdm/ and read the scripts" is a lot of pain.) Here, .profile seems to work just fine. (debian/testing) – Anders Eurenius – 2009-08-07T00:10:28.790
Also, are you sure that it's not really there (and SDL is ignoring it)? Can you echo it in an xterm? (set, then echo again?) – Anders Eurenius – 2009-08-07T00:11:50.847
It's really not there. Run emacs in an xterm, it echos 'alsa' for M-x getenv. Run GTK+ version of emacs, it echos 'pulse'. I'm guessing the SUSE guys (OpenSUSE 11.1) are setting it somewhere else. – Bernard – 2009-08-07T02:34:44.743