Monday, May 9, 2011

Sound not working in Outgun

In Ubuntu 10.04 sound was not working in Outgun. The fix that worked was one I came across when having sound issues with Skype.
  1. "...edit or create the file ~/.pulse/client.conf and add a line containing "autospawn = no" there..."
  2. Restart (maybe log out/in works?)

This fixed the sound problem but created new problems:
  • Audio controls on the keyboard no longer worked
  • Volume slider in the panel no longer worked
  • System > Prefs > Sound no longer worked

After some toying around, I found that pulseaudio could be disabled / enabled without having to restart or log out. I put together a script that disables pulseaudio, runs Outgun, and then restarts pulseaudio after the game is shut down.
 
The script doesn't entirely make sense to me. Creating the client.conf file wouldn't be necessary I would think, especially right before killing pulseaudio. But the sound fix didn't work otherwise.
 
#!/bin/bash
# create client.conf file
cd ~/.pulse
echo "autospawn = no" > client.conf
# kill pulseaudio
pulseaudio -k

# run outgun
cd ~/outgun_1.0.3_r336
./outgun

# remove client.conf file
cd ~/.pulse
rm client.conf

# restart pulseaudio
pulseaudio --start

No comments:

Post a Comment