Same problem here. It's the same for me with or without SDL_AUDIODRIVER="alsa".
However I also get this printed out in the terminal:
SDL_InitSubSystem(SDL_INIT_AUDIO) failed.
S_Startup: SNDDMA_Init failed.
The question is why it still plays the music and not any sound effect what so ever...
What happens if you don't set SDL_AUDIODRIVER?
I too get the same result, with either SDL_AUDIODRIVER unset or set to alsa.
I tried not setting SDL_AUDIODRIVER and got the same result.
alfred-valve
I tried it with it set and with it not set (restarted steam without setting the variable) and the result is the same.
Also, I installed pulseaudio and now I get full sound working.
We have found the issue, the SDL build we picked up for HL1 is missing ALSA support, we are fixing that now.
tonights update has a libsdl with ALSA support
alfred-valve: Just to be clear: is that fix supposed to be in the update that already went out after you closed this issue or is there another one planned? As it is, sound effect in Half-Life are still not working for me. Same for Counter-Strike.
Same here. Sound is still not working.
Edit: Same problem with Counter-Strike
Not working for me, too.
This should be re-opened.
If anyone like me don't want to wait you can build sdl2 for yourself to fix the sound!
Just checkout the latest sdl version:
hg clone http://hg.libsdl.org/SDL
Run autoconf and create a build dir
./autogen.sh
mkdir build
cd build
../configure
If you like me is running a 64bit system you need to add -m32 to CFLAGS and LDFLAGS in the Makefile in the build dir.
After that "make" the project and when it's done and overwrite the current libsdl2 file with your own one:
cd build/.libs
cp libSDL2-2.0.so.0.0.0 ~/.local/share/Steam/SteamApps/common/Counter-Strike/libsdl2-2.0.so.0
Now sound works flawlessly for me so far :)
Thanks, but already tried that and also copying the SDL2-lib from TF2 doesn't help.
I tried it with Half-Life though - maybe that only works with CS (which I don't own).
Have you tried to start if from terminal?
IE go to the Half-Life dir in steamapps and run:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./hl_linux -game valve -console
It's strange that this works but not starting it from within steam... :S
That works :) but only if I add SDL_AUDIODRIVER=alsa to it - Thank you very much!
I can confirm that
SDL_AUDIODRIVER=alsa LD_LIBRARY_PATH="$LD_LIBRARY_PATH:." ./hl_linux -game valve
works, even without substituting your own libsdl2. My guess is that when launched from Steam it picks up ~/.steam/root/ubuntu12_32/libsdl2-2.0.so.0
Edit: confirmed that it picks up the wrong libsdl:
$ cat /proc/`pidof hl_linux`/maps | grep sdl
f61c6000-f6292000 r-xp 00000000 08:32 12867449 /home/dscharrer/Games/Steam/ubuntu12_32/libsdl2-2.0.so.0
f6292000-f6294000 r--p 000cc000 08:32 12867449 /home/dscharrer/Games/Steam/ubuntu12_32/libsdl2-2.0.so.0
f6294000-f629b000 rw-p 000ce000 08:32 12867449 /home/dscharrer/Games/Steam/ubuntu12_32/libsdl2-2.0.so.0
I guess you're right that it must be using "~/.steam/root/ubuntu12_32/libsdl2-2.0.so.0" instead.
But I can't replace it as steam crashes if I do that while it's running (not too surprising) and if I replace it while steam is not running steam will "update"/replace with the old one as it's probably not matching with some checksums.
Is there a way to replace libsdl2 in ubuntu12_32 ?
DarkDefender: I'd wait for Valve to either change the LD_LIBRARY_PATH order when HL is launched from Steam or update the libsdl in the Steam root. But if you really need to be able to launch HL/CS with sound from within Steam now you could just wrap the binary:
$ mv hl_linux hl_linux.bin
Then create a new hl_linux file with
#!/bin/sh
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
exec ./hl_linux.bin "$@"
And finally
$ chmod +x hl_linux
Of course, the wrapper will be overwritten the next time that file is updated, but that's probably desirable anyway.
Thanks dscharrer!
I don't really need to be able to launch it via steam right now. It's just that I want to know if any additional workarounds if I need to replace libsdl2 in the future.
You see I use OSS4 instead of ALSA and I think steams libsdl2 only has alsa and pulseaudio support complied into them. So I have to compile my own libs.
I'm really thankful valve uses open source libs so I can do this...
@dscharrer Your fix worked! Thanks!
@DarkDefender That may be true, but I can confirm this is still an issue with ALSA-only systems.
This bug does not occur anymore with the latest Steam update applied.
(SDL2 has been updated I think)
Fixed for me too :)
It still uses ~/.steam/root/ubuntu12_32/libsdl2-2.0.so.0 and not the libsdl in the Half-Life dir, but that one seems to work with ALSA now.
Sound works only when I use SDL_AUDIODRIVER=alsa LD_LIBRARY_PATH="$LD_LIBRARY_PATH:." ./hl_linux -game valve
@alfred-valve @fosskers
I also have the same issue. I have up to date HL and Steam client. If I start HL from Steam, I get no sound. I have to go to console, go to game folder and run
SDL_AUDIODRIVER="alsa" ./hl.sh -game valve
to get sound to work.
Please, investigate the issue.
For the reference, I use Debian wheezy with no pulseaudio installed.
/proc/xxx/maps shows that hl-linux uses sdl from game directory:
b5ab9000-b5b87000 r-xp 00000000 fe:03 235726688 /home/lumag/.local/share/Steam/SteamApps/common/Half-Life/libsdl2-2.0.so.0
b5b87000-b5b89000 r--p 000ce000 fe:03 235726688 /home/lumag/.local/share/Steam/SteamApps/common/Half-Life/libsdl2-2.0.so.0
b5b89000-b5b90000 rw-p 000d0000 fe:03 235726688 /home/lumag/.local/share/Steam/SteamApps/common/Half-Life/libsdl2-2.0.so.0
This is the log part when sound is not working:
Platform config directory: platform/config
0:Initializing platform...
SDL_InitSubSystem(SDL_INIT_AUDIO) failed.
S_Startup: SNDDMA_Init failed.
Server module initialized.
Are you guys running a logon manager or do you start X via startx? If you start it via startx add
export SDL_AUDIODRIVER="alsa"
to your ~/.bashrc
@nullcollision I use startx and fish shell. I suppose I could add that variable, yeah.
I ran into this issue recently and ultimately discovered that it was linking some old libs in "Steam/ubuntu12_32/steam-runtime.old/" instead of the new ones. Deleting the "steam-runtime.old" directory fixed it. Now I'm not saying this will work for everyone but it's worth looking at.
Installing lib32-libpulse fixed this for me, while setting the variables and linker settings above did nothing.
SDL_AUDIODRIVER="alsa"x4 2013-02SDL_Ix2 2013-01SDL_INIT_AUDIOx2 2013-01SDL_AUDIODRIVER=alsax3 2013-01SDL_AUDIODRIVERx3 2013-01
Background music still plays, so the problem appears to only be with sound effects.
Note that I have set
SDL_AUDIODRIVER="alsa"in my environment, which helped fix no sound in TF2.System Information: