Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dorkster opened this issue Jan 25, 2013 · 27 comments
Closed

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

dorkster opened this issue Jan 25, 2013 · 27 comments

Comments

@dorkster
Copy link

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
Copy link

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
Copy link

What happens if you don't set SDL_AUDIODRIVER?

@dscharrer
Copy link

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

system info

@dorkster
Copy link
Author

I tried not setting SDL_AUDIODRIVER and got the same result.

@spacelike
Copy link

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
Copy link

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

@alfred-valve
Copy link

tonights update has a libsdl with ALSA support

@dscharrer
Copy link

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
Copy link

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

@DissCent
Copy link

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

@DarkDefender
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@dscharrer
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link
Author

@dscharrer Your fix worked! Thanks!

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

@DissCent
Copy link

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

(SDL2 has been updated I think)

@dscharrer
Copy link

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
Copy link

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

@lumag
Copy link

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
Copy link

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
Copy link

fosskers commented Feb 2, 2013

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

@stuartm
Copy link

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.

@fineless71
Copy link

Installing lib32-libpulse fixed this for me, while setting the variables and linker settings above did nothing.

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

No branches or pull requests