protonscr

Feature request: Check the sound server during startup

steamclosed Feature Requestreviewed
ValveSoftware/steam-for-linux#678 · opened 2013-01-12 by Tea23 · updated 2019-07-18 · 7 comments · github
TTea23 2013-01-12 github

At the moment, due to Ubuntu being the primary target, Steam + TF2 (and presumably all further Source games) also target PulseAudio. On my Arch system, it's necessary for me to export the SDL_AUDIODRIVERenvironment variable with the value 'alsa' when running Steam. To make this easier, I simply add export SDL_AUDIODRIVER=alsa to the top of /usr/bin/steam.

It should be fairly trivial to simply incorporate upstream, a check in the Steam script to find out what sound server the user is running and export SDL_AUDIODRIVER accordingly if necessary.

Admittedly, I'm not the best BASH monkey in the world so I'm not sure what the check would look like. I imagine, however, Pulse must set some kind of environment variable that we could simply check the existence of in an if statement, and export SDL_AUDIODRIVER if it doesn't, do nothing if it does. For OSS, I would imagine that the value of alsa in the variable might actually be sufficient if the user has ALSA emulation installed; I'm not sure if the variable would work if oss was chosen as the variable.

Ultimately I believe such a check - or indeed another solution or workaround - would help Steam get closer to true distro-agnosticism.

Jjohndrinkwater 2013-01-12 github

Is there a reason you do not use pulseaudio?

TTea23 2013-01-12 github

I find it easier to configure, but that's not a relevant question on this issue tracker at all - however you can email me or whatever if it interests you enough.

Steam's job isn't to get us all using Pulseaudio and Ubuntu and it should remain as distro-agnostic out of the box as possible.

MMrSchism 2013-01-12 github

@Tea23 Realistically, Steam's job is just to supply content to whatever platform and software the developers have made available. The Steam beta, which we are currently all using, is not distro-agnostic. Those features will probably show up later in development when they get the more main-line bugs resolved.

MMajkl578 2013-01-12 github

@johndrinkwater: You shouldn't assume that everyone out there uses Pulseaudio.
@MrSchism: Afaik, even on Ubuntu you don't have to use Pulseaudio. It is just installed by default and preferred. I knew some people that had to use Alsa due to some problems with Pulseaudio. (IIRC Pulseaudio still uses Alsa internally, doesn't it?)
But this isn't the only thing where Steam fails to be independent… Steam just shouldn't force users to use some specific software or make decisions instead of them.

Looking at some proprietary packages, e.g. Skype, they depend just on libasound2, nothing else.

TTele42 2013-01-15 github

@Majkl578: Pulseaudio is audio middleware. It functions on top of alsa and never will replace alsa.

DDarkDefender 2013-01-24 github

I think it would be really great if you could choose your sound driver and output device.
Kinda like you can with the recording device is steam settings->Voice->Audio input device.

IIRC Valve will be/is using openal for audio. This means that we can have lots of different audio output backends. Now we only need an easy way to select what we want.
It would be really great if we could have something like in the Heroes of Newerth linux client where you can select sound driver and output. Really useful for me because I use OSS4 and have multiple soundcards.
See images.

hon_set1
honset2

Kkisak-valve maintainer 2017-03-29 github

SDL 2 has a list of preferred audio backends that it walks through. If it can not connect to a running pulseaudio instance, then it continues down the list and eventually tries alsa. If you need SDL 2 to support for an audio backend like JACK or OSSv4, you will need to make sure a system variant of the libraries used by the game(s) is available and is built with support for the backend you want to use.

NOTE: Most games have not been tested against less common audio backends and may have quirk behavior. Your mileage may vary.

Launch options