HL1: No sound effects with pure ALSA sound system #824

Closed
dorkster opened this Issue Jan 25, 2013 · 26 comments

Comments

Projects
None yet
10 participants
@dorkster

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:

Processor Information:
    Vendor:  GenuineIntel
    Speed: 2799 Mhz
    2 logical processors
    1 physical processors
    HyperThreading:  Supported
    FCMOV:  Supported
    SSE2:  Supported
    SSE3:  Supported
    SSSE3:  Supported
    SSE4a:  Unsupported
    SSE41:  Unsupported
    SSE42:  Unsupported

Network Information:
    Network Speed:  

Operating System Version:
    "Arch Linux" (32 bit)
    Kernel Name:  Linux
    Kernel Version:  3.7.4-1-ARCH
    X Server vendor:  The X.Org Foundation
    X Server release:  11301000

Video Card:
    Driver:  NVIDIA Corporation GeForce GT 440/PCIe/SSE2

    Driver Version:  4.3.0 NVIDIA 310.19
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 60 Hz
    VendorID:  0x10de
    DeviceID:  0xde0
    Number of Monitors:  1
    Number of Logical Video Cards:  1
    Primary Display Resolution:  1360 x 768
    Desktop Resolution: 1360 x 768
    Primary Display Size: 14.17" x 7.99"  (16.26" diag)
                                            36.0cm x 20.3cm  (41.3cm diag)
    Primary Bus: PCI Express 16x
    Primary VRAM: 511 MB
    Supported MSAA Modes:  2x 4x 8x 16x 

Sound card:
    Audio device: Realtek ALC880

Memory:
    RAM:  1005 Mb

Miscellaneous:
    UI Language:  English
    LANG:  en_US.UTF-8
    Microphone:  Not set
    Total Hard Disk Space Available:  60907 Mb
    Largest Free Hard Disk Block:  42966 Mb

Installed software:

Recent Failure Reports:

@ghost ghost assigned alfred-valve Jan 25, 2013

@DarkDefender

This comment has been minimized.

Show comment
Hide comment
@DarkDefender

DarkDefender Jan 25, 2013

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...

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...

@alfred-valve

This comment has been minimized.

Show comment
Hide comment
@alfred-valve

alfred-valve Jan 25, 2013

What happens if you don't set SDL_AUDIODRIVER?

What happens if you don't set SDL_AUDIODRIVER?

@dscharrer

This comment has been minimized.

Show comment
Hide comment
@dscharrer

dscharrer Jan 25, 2013

I too get the same result, with either SDL_AUDIODRIVER unset or set to alsa.

system info

I too get the same result, with either SDL_AUDIODRIVER unset or set to alsa.

system info

@dorkster

This comment has been minimized.

Show comment
Hide comment
@dorkster

dorkster Jan 25, 2013

I tried not setting SDL_AUDIODRIVER and got the same result.

I tried not setting SDL_AUDIODRIVER and got the same result.

@spacelike

This comment has been minimized.

Show comment
Hide comment
@spacelike

spacelike Jan 25, 2013

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.

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.

@alfred-valve

This comment has been minimized.

Show comment
Hide comment
@alfred-valve

alfred-valve Jan 25, 2013

We have found the issue, the SDL build we picked up for HL1 is missing ALSA support, we are fixing that now.

We have found the issue, the SDL build we picked up for HL1 is missing ALSA support, we are fixing that now.

@alfred-valve

This comment has been minimized.

Show comment
Hide comment
@alfred-valve

alfred-valve Jan 25, 2013

tonights update has a libsdl with ALSA support

tonights update has a libsdl with ALSA support

@dscharrer

This comment has been minimized.

Show comment
Hide comment
@dscharrer

dscharrer Jan 25, 2013

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.

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.

@DarkDefender

This comment has been minimized.

Show comment
Hide comment
@DarkDefender

DarkDefender Jan 25, 2013

Same here. Sound is still not working.
Edit: Same problem with Counter-Strike

Same here. Sound is still not working.
Edit: Same problem with Counter-Strike

@DissCent

This comment has been minimized.

Show comment
Hide comment
@DissCent

DissCent Jan 25, 2013

Not working for me, too.
This should be re-opened.

Not working for me, too.
This should be re-opened.

@DarkDefender

This comment has been minimized.

Show comment
Hide comment
@DarkDefender

DarkDefender Jan 25, 2013

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 :)

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 :)

@DissCent

This comment has been minimized.

Show comment
Hide comment
@DissCent

DissCent Jan 25, 2013

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).

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).

@DarkDefender

This comment has been minimized.

Show comment
Hide comment
@DarkDefender

DarkDefender Jan 25, 2013

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

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

@DissCent

This comment has been minimized.

Show comment
Hide comment
@DissCent

DissCent Jan 25, 2013

That works :) but only if I add SDL_AUDIODRIVER=alsa to it - Thank you very much!

That works :) but only if I add SDL_AUDIODRIVER=alsa to it - Thank you very much!

@dscharrer

This comment has been minimized.

Show comment
Hide comment
@dscharrer

dscharrer Jan 25, 2013

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 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
@DarkDefender

This comment has been minimized.

Show comment
Hide comment
@DarkDefender

DarkDefender Jan 25, 2013

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 ?

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 ?

@dscharrer

This comment has been minimized.

Show comment
Hide comment
@dscharrer

dscharrer Jan 25, 2013

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.

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.

@DarkDefender

This comment has been minimized.

Show comment
Hide comment
@DarkDefender

DarkDefender Jan 25, 2013

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...

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...

@dorkster

This comment has been minimized.

Show comment
Hide comment
@dorkster

dorkster Jan 25, 2013

@dscharrer Your fix worked! Thanks!

@DarkDefender That may be true, but I can confirm this is still an issue with ALSA-only systems.

@dscharrer Your fix worked! Thanks!

@DarkDefender That may be true, but I can confirm this is still an issue with ALSA-only systems.

@DissCent

This comment has been minimized.

Show comment
Hide comment
@DissCent

DissCent Jan 25, 2013

This bug does not occur anymore with the latest Steam update applied.

(SDL2 has been updated I think)

This bug does not occur anymore with the latest Steam update applied.

(SDL2 has been updated I think)

@dscharrer

This comment has been minimized.

Show comment
Hide comment
@dscharrer

dscharrer Jan 25, 2013

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.

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.

@fosskers

This comment has been minimized.

Show comment
Hide comment
@fosskers

fosskers Jan 27, 2013

Sound works only when I use SDL_AUDIODRIVER=alsa LD_LIBRARY_PATH="$LD_LIBRARY_PATH:." ./hl_linux -game valve

Sound works only when I use SDL_AUDIODRIVER=alsa LD_LIBRARY_PATH="$LD_LIBRARY_PATH:." ./hl_linux -game valve

@lumag

This comment has been minimized.

Show comment
Hide comment
@lumag

lumag Jan 28, 2013

@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.

lumag commented Jan 28, 2013

@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.
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 1, 2013

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

ghost commented Feb 1, 2013

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

@fosskers

This comment has been minimized.

Show comment
Hide comment
@fosskers

fosskers Feb 2, 2013

@nullcollision I use startx and fish shell. I suppose I could add that variable, yeah.

fosskers commented Feb 2, 2013

@nullcollision I use startx and fish shell. I suppose I could add that variable, yeah.

@stuartm

This comment has been minimized.

Show comment
Hide comment
@stuartm

stuartm Mar 31, 2013

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.

stuartm commented Mar 31, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment