PulseAudio

The aim of the article is to guide you in installing and configuring the PulseAudio server. For more Information about the PulseAudio Server check the PulseAudio Wiki.

USE Flags
Before installation check the active USE flags. The USE flags of are:
 * - Send PulseAudio information through the X11 protocol.
 * - Enable ALSA support.
 * - Asynchronous name resolution for network sound devices.
 * - Enable support for network sound devices discovery.
 * - Enable support for Bluetooth sound devices.
 * - Enable POSIX capabilities support for PulseAudio dropping root rights.
 * - Enable D-Bus support.
 * - Installs API documentation.
 * - Enable glib support for the libpulse client library, so it can be used by glib-based programs.
 * - Store user preferences in gconf. Not compatible with USE flag.
 * - Enable Internet Protocol Version 6 support.
 * - Enable JACK support.
 * - Use for sample rate conversions.
 * - Enable support for remote controls.
 * - Enable Open Sound System support.
 * - Enable support for  realtime prioritization.
 * - (Not recommend) Installs the system-wide PulseAudio server.
 * - Enable TCP wrapper support.
 * - Installs some test programs.
 * - (Recommend) Sound device discovery by udev.

Activate the USE flag in  to enable support for PulseAudio in other programs. You don't need to install PulseAudio by yourself, but instead let it be installed as a dependency of these other programs:

For ALSA "fallback" support install with the  USE flag enabled:

Multi-user support
In a normal multi-user setup (no USE flag) it doesn't make sense to share sound devices. To give rights to the sound devices only to the local active user session, you have to have  and  installed with the USE flag  enabled. Also you need the following kernel option:

After a restart the permission field of many of the sound device nodes should contain the plus character in the end:

crw-rw+ 1 root audio 116, 7 Aug  2 08:57 pcmC0D0p

Configuration
PulseAudio's configuration files are located in. However, you probably don't need to edit the configuration to get PulseAudio working. If you do need to, make sure you pay close attention to the comments.

eselect esd
Run so that esound applications use PulseAudio:

access rights
For an one-user system it is sufficient to add the user to the audio group:

For a normal multi-user system you should let udev manages the access rights, see above.

PulseAudio Server
At this point, you should have a working Pulseaudio installation. There are a few alternate ways to run PulseAudio, though. If you're just setting up a normal desktop system, skip ahead to the next section on application support.

System Server
It's possible to use a system-wide instance for the PulseAudio server. This is strongly discouraged by upstream, though, except in extremely special cases, such as
 * embedded systems that don't have user accounts or
 * running MPD independent of the currently logged in user.

You will want to add to the default runlevel.

Then, add your user to the pulse and pulse-access groups. For the Music Player Daemon, the user name is mpd.

Networking
If you want to setup PulseAudio as a network sound server and try to run it via the init.d-script with the unchanged default configs, you may get these messages: Network error messages

The solution is to edit and to comment out the lines:

For an easy configuration for listening on a TCP port (4713 by default), add this line to :

For the output of the sound, if you use ALSA and have only one card, this line (again in default.pa) should be fine:

On the client, add the to  and reemerge the packages with this support (for example ). This will also emerge for you as a dependency. Then edit the file and add this(replace SERVER with you PulseAudio server):

Tools
There are several tools for managing PulseAudio in portage, use to search for them and get their description:

One application in particular is, it provides a nice "control panel" for the PulseAudio server which is useful when you're not running something like GNOME where the PulsaAudio control are integrated (provided you emerged GNOME with enabled).

Pavucontrol - Volume Control

emerge pavucontrol

(gnome2 reports pavucontrol as deprecated, and uses gnome-media by default)

Paprefs - Preferences configuration dialog for PulseAudio

emerge paprefs

Application support
The Pulseaudio wiki has an excellent page on setting up various applications to use PulseAudio for output. Particularly, the section on setting up ALSA applications will let you get apps using the ALSA APIs to run through Pulseaudio, which should cover most apps that don't directly support PulseAudio.

GStreamer
GStreamer plugins are available through "split" ebuilds on Gentoo. For the GStreamer Pulseaudio plugin, emerge :

Or set the USE flag on. Which will merge automatically.

Also some gconf-keys need to be set for Gstreamer to use pulseaudio. This can be done with either gstreamer-properties (gui-tool), by selecting pulse-audio-server for both input and output or manually via gconftool/gconftool-2 :


 * Hint* Make sure to set these keys as the correct user, since these settings are userwide, not systemwide !! Also, in some cases, the gui-tool gstreamer-properties doesnt bring the desired effect, though not giving an error or similar. In this case, simply use the manual command.

Advantage : if you have configured pulseaudio to create a virtual sounddevice, allowing the output of audiostreams to multiple sounddevices simultaneously, this works with gstreamer ootb also, which will be useful e.g. for multimedia-systems that have an additional HDMI-Audio-Out configured.

Locked sound device
PulseAudio handles things poorly when another program has locked the audio device. Open the PulseAudio volume control application, and check the Output Devices tab. If the only available device is "Dummy Output", it means that PulseAudio couldn't access your real audio devices. Running will let you see which process IDs are holding the audio device, and closing / killing that process will frequently get PulseAudio working again(Pidgin and Flash are programs known to cause this). This can also happen if you used virtualbox before installing pulseaudio, as the settings of the existing virtual machines should be updated to use pulse audio.

If you see a Dummy Output but doesn't show anything, it's possible that there's another issue with output. Kill all instances of PulseAudio, and then run "pulseaudio -vvvv" in a terminal to get more verbose debug output.

Flash support
Flash Player 9: If you want to have Flash support on your system you will have to install libflashsupport.

Flash Player 10: Flash 10 should work well with PulseAudio out-of-the-box, if the alsa device named "default" is configured to use the pulse plugin, as instructed in the ALSA section below on this page.

Note From the current ebuild:
 * You do not need libflashsupport to use adobe-flash with pulseaudio
 * Please consider removing this package and using
 * media-plugins/alsa-plugins[pulseaudio] instead.

pbbuttonsd cannot adjust volumes
needs access to PulseAudio to adjust the sound volume. So you have to add the user that is running pbbuttonsd (probably root) to the PulseAudio groups.

System Server & GNOME
If you want to hear system sounds in system-wide instance you need change startup script. In function add this text after :

Bluetooth Headset support
Add to the end of, or for a system-wide pulseaudio install:

Then under Default Sink and Default Source in PulseAudio Device Chooser, select your bluetooth headset and all audio will be routed to it.

Skype not detecting pulseaudio
If Skype happens not to detect PulseAudio after following the guide above, this forum thread could help you get it working: http://forums.gentoo.org/viewtopic-t-789181-highlight-pulseaudio.html

Flash/HTML5/other ALSA users not giving sound
Make sure you have installed the ALSA extra plugins: Emerge alsa-plugins by running:

For system-wide configuration add the following to /etc/asound.conf or alternatively for every user to ~/.asoundrc in order for applications which uses ALSA to give any sound: pcm.pulse { type pulse } ctl.pulse { type pulse } pcm.!default { type pulse } ctl.!default { type pulse }

load-module module-alsa-sink device=hw:0 load-module module-alsa-source device=hw:0

No sound from the subwoofer
To make PulseAudio use the subwoofer when upmixing stereo audio, "disable-lfe-remixing = no" shuld be added to /etc/pulse/daemon.conf (pulseAudio must be restarted to activate this setting).