Redirecting Valve Linux Games to PulseAudio

I was playing with ScreenStudio again a little bit earlier, and noticed something:  None of the audio from the Valve game I was playing (Left4Dead 2) was making it to the stream.

The reason appears to be that the Valve games are defaulting to ALSA output, not PulseAudio (even though it’s the system default).  All you need to do is set the appropriate SDL variable when launching steam:

SDL_AUDIODRIVER=pulseaudio STEAM_FRAME_FORCE_CLOSE=1  /usr/bin/steam -silent %U

The important item here is the setting of the SDL_AUDIODRIVER environment variable.  The STEAM_FRAME_FORCE_CLOSE isn’t related to the sound issue, but is something I include because I like to autostart Steam minimized on login.