ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.18k stars 173 forks source link

PulseAudio and SDL1.2 vs. SDL2.0 -> SDL_AUDIODRIVER environment variable differences #1849

Closed DeadPig closed 11 years ago

DeadPig commented 11 years ago

Problem: difference within interpretation of environment variable SDL_AUDIODRIVER

SDL1.2: needs SDL_AUDIODRIVER=pulse

SLD2.0: needs SDL_AUDIODRIVER=pulseaudio

Means:

Users who want to directly specify the audio-backend which should be uses have to consider if they want to play games for SDL1.2 OR SDL2.0. They have no way to specify this in a way both SDL versions recognice it. Best option to solve this problem would be to convince the SDL developer group to integrate a patch for SDL2.0+ which not only uses SDL_AUDIODRIVER=pulseaudio but also respects the "old" backend name like SDL_AUDIODRIVER=pulse

It is not in the interest of users to decide which game/software the will be using via steam and which is using SDL before they start steam (and setting the appropriate SDL_AUDIODRIVER) which would mean that you have to decide if you wanna play games using SDL1.2 OR SDL2.0 (with sound).

If you/them/others/whoKnows (Valve games like TF2 are using SDL2.0) will break when a user wants to force that PulseAudio gets used, they will have to choose if they want to play SDL1.2 OR SDL2.0 based games/software.

Due to the fact that currently pulseaudio is auto-probed by default as the first choice whenever SDL_AUDIODRIVER is not provided, there is not much issue because all users who use pulseaudio just have to "unset SDL_AUDIODRIVER" variable and SDL(1.2/2.0) games will automatically detect/use pulseaudio. But as soon there arises a new audio backend which can be configured via SDL_AUDIODRIVER (or the way SDL detect/probes for existing backends) gets added, pulseaudio users (like most of ubuntu/debian(sid)) will get a problem.

This is not a direct problem/bug introduced by valve/steam but a general negative consequence of ignorant thinking by SDL developers who seem to think that there can be just no problem when they change things because everybody else udsing SDL just has to move to a/the new version, and therefore no backwards compatibility is needed.. Hey, distributions who distribute/provide SDL always can make patches to make it work.. no need4us to provide backward compat thingys... yea.. the right way to go... sight (btw.. this is what i think of why this happend, but is not the way i would have handled it...)

I hope that valve might be in contact to SDL developers and can convince them to make SDL_AUDIODRIVER (SDL1.2=pulse/SDL2.0=pulseaudio) environment variable backward-compatible to give users of steam4linux the ability to decide which (in this case pulseaudio) audiobackend they wanna use.

Thanx and have a good night(or day... whenever YOU read this) :) OINK

Gps2010 commented 11 years ago

If I am allowed to ask a question.

To have sound in steam on openSUSE, I need to start from the command line with: SDL_AUDIODRIVER=pulseaudio steam

Is this related to what your telling us ?

I am asking this because I was told by an opensuse user, that ubuntu vs suse and arch on the other hand used a different name. Pulse vs pulse audio.

Reading what you tell us, about (SDL1.2=pulse/SDL2.0=pulseaudio) I instantly remembered this.

DeadPig commented 11 years ago

As far as I can interpret your comment this might be the problem I mentioned.

You might just wanna try to set it (SDL_AUDIODRIVER) to 'pulse', then check which games still have working Audio, and then set it to 'pulseaudio'. If your problem is related to this bug/issue report then some games will have sound and others not, and as soon as you change it to 'pulse' (and restart steam to get the new env-settings) then the former working sound-games could be mute and the non working "should" work...

I can only comment this as a "developer" who looked at the SDL code (1.2/2.0) and at least for me this is the problem why I cannot set it to force pulse, but have to unset SDL_AUDIODRIVER so that SDL uses auto-detection (which at least the last time I check sdl code should at first probe for pulseaudio).

Gps2010 commented 11 years ago

Thank you for your reply. I doubt my problem is related then. I have no sound at all, or after this command sound in all games. At least the games I have installed. half life, counterstrike, and Teamfortress 2

My issue on the git hub about this is still open, but of course I try to look for a solution my self too. Its seems this is not it. :)

I do like your suggesting though, they might listen to Valve.

tarikm commented 11 years ago

When I launch Steam with SDL_AUDIODRIVER=pulseaudio I can play TF2 with sound. When I launch Steam with SDL_AUDIODRIVER=pulse I can play Killing Floor with sound.

slouken commented 11 years ago

I'm changing SDL 2.0 to allow "pulse" as well as "pulseaudio", but they are the default audio drivers for stock SDL 1.2 and 2.0 already. If you have a game that requires you to set the environment variable to "pulse", then it's probably using an old version or modified version of SDL 1.2 which didn't have pulse audio as the default driver.

If that's the case, please let me know which games have that issue and I'll contact the authors.

Mailaender commented 11 years ago

I can confirm this on openSUSE. This is annoying when switching from Valve games to older SDL games like http://www.urbanterror.info and having users export variables via the terminal is not very user friendly. This will probably fix 99% percent of the "no sound" bug reports like #351.

slouken commented 11 years ago

This is fixed in the latest Steam update. You can use SDL_AUDIODRIVER=pulse for both SDL 1.2 and SDL 2.0.

Mailaender commented 11 years ago

Nope, today's Steam update did not fix it. Tried both Source 1 and GoldSrc engine games.

slouken commented 11 years ago

@Mailaender: Today's update did not affect the Valve games, just Steam. Make sure you're opted into the beta and see if Big Picture has sound, as well as your SDL 1.2 games, with the audio driver set to "pulse".

Out curiosity, why do you set the environment variable? Pulseaudio is the default for both SDL 1.2 and 2.0.

Mailaender commented 11 years ago

Big picture has sound without the need to export a different SDL_AUDIODRIVER. I was confused because the bug report here was about the games.

Mailaender commented 11 years ago

As described in https://en.opensuse.org/SDB:Team_Fortress_2 those workarounds are required to hear sounds in Valve games. I don't know why this is broken by default.

http://software.opensuse.org/package/libSDL_sound-1_0-1 is version 1.0.3 http://software.opensuse.org/package/libSDL-1_2-0 is version 1.2.15 http://software.opensuse.org/package/SDL_mixer is currently 1.2.11 which I will try to update it to 1.2.12 now in openSUSE games.

slouken commented 11 years ago

Those were probably the audio bugs in the Steam Runtime on SUSE that were fixed last week.

Mailaender commented 11 years ago

I removed the workaround from https://en.opensuse.org/Steam then.

slouken commented 11 years ago

Test it, of course. :)

Mailaender commented 11 years ago

Confirmed the fix and removed the workaround from https://en.opensuse.org/SDB:Team_Fortress_2

slouken commented 11 years ago

Thanks!