Monday, February 6, 2017

games depending on pulseaudio

I haven't posted something for quite some time. However, since every now and then I have some idea which i would like to share, I forced myself to start writing again. Hope i can keep up with new posts as new ideas come up in my mind.

Today i would like to share something about steam games which need pulseaudio. I think some of you might already experienced some issues with games when you haven't installed media-sound/pulseaudio. Most notably was probably Tomb Raider.
In that game you haven't had any audio as long as pulseaudio wasn't installed. Since there was quite some noise on the steam forums, they fixed the issue and now it works well even without pulseaudio.
However, Tomb Raider isn't the only game with pulseaudio issues. Another game which made me quite some headaches was Audiosurf 2. The Problem: Besides no audio i couldn't even play the game and it showed me that i was running only the demo. That means, for me, it wasn't clear that pulseaudio was the problem. A long time after writing a post at the steam forums i got some hint's that pulseaudio might be the problem.

Anyway, that time i already fixed the issue differently.
Since Tomb Raider came out I've searched for a way to play the game without pulseaudio. Sadly i couldn't find anything, but found a way were pulseaudio is only a unintrusive pipe to alsa.
I don't know were exactly I read it, but i found a very nice wiki entry on arch [1] , which also worked as expected on gentoo:

First of all i had to install pulseaudio. For that package is important NOT to install the alsa-plugins so first i had to remove the alsa-plugins use flag:

echo "media-sound/pulseaudio -alsa-plugin" >> /etc/portage/package.use

After emerging i it was important to make some configuration changes for pulseaudio:
/etc/pulse/daemon.conf: (everything else in this file is commented out)
#/etc/pulse/daemon.conf
exit-idle-time = 0 # Exit as soon as unneeded
flat-volumes = yes # Prevent messing with the master volume

/etc/pulse/client.conf (everything else in this file is commented out)
#/etc/pulse/client.conf
autospawn = yes

/etc/pulse/default.pa (this file was completely replaced by following)
#/etc/pulse/default.pa

.fail
    # Set tsched=0 here if you experience glitchy playback. This will
    # revert back to interrupt-based scheduling and should fix it.
    #
    # Replace the device= part if you want pulse to use a specific device
    # such as "dmix" and "dsnoop" so it doesn't lock an hw: device.
    
    # INPUT/RECORD
    load-module module-alsa-source device="default" tsched=1
    
    # OUTPUT/PLAYBACK
    load-module module-alsa-sink device="default" tsched=1 
    
    # Accept clients -- very important
    load-module module-native-protocol-unix

.nofail
.ifexists module-x11-publish.so
    # Publish to X11 so the clients know how to connect to Pulse. Will
    # clear itself on unload.
    load-module module-x11-publish
.endif

With that changes it was possible to play Tomb Raider and also didn't had any problems anymore with Audiosurf 2. While of those games are already quite old, someone might find this information useful for other games.

[1] https://wiki.archlinux.org/index.php/PulseAudio/Examples#PulseAudio_as_a_minimal_unintrusive_dumb_pipe_to_ALSA

No comments:

Post a Comment