Topic: Pulseaudio and #! - A How To
Pulseaudio is a sound server for linux. It lets you do fun things like easily piping your audio to other machines on your network, having a system wide equalizer, or switching from internal analog to hdmi audio with 1 click. Pulseaudio has earned a bad reputation, mostly due to a bad implementation in several versions of Ubuntu. I have installed it on a couple of #! installs and the Debian implementation seems to be solid.
First we need to install the following packages. Note that this is a light install of pulseaudio, no bluetooth, no plugins for any programs, though this is easy to fix by opening synaptic and searching for pulse, and checking your audio application settings. For a heavier install check the links at the end of this post.
sudo apt-get install pulseaudio paprefs pavucontrol pulseaudio-module-hal pulseaudio-module-x11 pulseaudio-utils libasound2-plugins paman pavumeter pulseaudio-esound-compat libpulse0 libsdl1.2debian-pulseaudioNow save the following into /etc/asound.conf
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}You should be able to run pulseaudio -D in a terminal now and have a running Pulseaudio setup. Execute pavucontrol to see if things are working. If not try rebooting your machine.
Now we need to apply one tweak to make volumeicon work better with Pulseaudio. If you click on Open Mixer in the menu it will still launch the alsa mixer. To make it launch the Pulseaudio mixer open $HOME/.config/volumeicon/volumeicon in your favorite text editor. Find the onclick= line and change it to read as follows:
onclick=pavucontrolIf your keyboard has media keys, your volume controls may not work. I was able to fix this by putting the following code into the <keyboard> section of $HOME/.config/openbox/rc.xml.
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>amixer set Master 5%+</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer set Master 5%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer set Master toggle</command>
</action>
</keybind>Enjoy your new pulseaudio setup!
UPDATE March 23 2011:
SDL programs need a change to work with pulseaudio. This is included in the how to now, but if you need it here is how.
sudo apt-get install libsdl1.2debian-pulseaudioUPDATE April 30 2011:
Removed the pulseaudio -d added to autostart.sh as it was not needed, and to add a note about possibly needing to restart your machine to get things working. Thanks @ceph for pointing this out.
These instructions were largely stolen from the following sources:
Pulseaudio : The Perfect Setup
Debian Sid and Pulseaudio
Debian Forums - How-to:Pulseaudio
Last edited by hardran3 (2011-04-30 23:58:31)