PulseAudio is a sound server commonly used by desktop environments like GNOME or KDE. It serves as a proxy to sound applications using existing kernel sound components like ALSA or OSS. Since ALSA is included in Arch Linux by default, the most common deployment scenarios include PulseAudio with ALSA.
- 1 Installation
- 2 Configuration
- 3 Running
- 4 Back-end configuration
- 5 Equalizer
- 6 Applications
- 7 Troubleshooting
- 8 See also
- Required package: pulseaudio
- Optional GTK GUIs: paprefs and pavucontrol
- Optional console (CLI) mixer: ponymix
- Optional web volume control: PaWebControl
- Optional system tray icon: pasystray
- Optional KDE plasma applet: kdemultimedia-kmix (If KMixfail to connect to PulseAudio at boot you may need to edit /etc/pulse/client.conf to include autospawn = yes instead of autospawn = no.)
You'll see Pulseaudio supports many modules to extend its functionality. You find a detailed list of all available modules at Pulseaudio Loadable Modules. To enable them you can just add a line load-module <module-name-from-list> to /etc/pulse/default.pa.
In the unlikely event that PulseAudio is not automatically started upon entering X, it can can be started with:
$ pulseaudio --start
PulseAudio can be stopped with:
$ pulseaudio --kill
3.1 Autostarting in unsupported desktop environments
Check to see if PulseAudio is running:
$ pgrep -af pulseaudio
If PulseAudio is not running and users are using X, the following will start PulseAudio with the needed the X11 plugins manually:
If you are not running GNOME, KDE, or Xfce, and your ~/.xinitrc does not source the scripts in /etc/X11/xinit/xinitrc.d (such as is done in the example file /etc/skel/.xinitrc), then you can launch PulseAudio on boot with:
4 Back-end configuration
To prevent applications from using ALSA's OSS emulation and bypassing PulseAudio (thereby preventing other applications from playing sound), make sure the module snd_pcm_oss is not being loaded at boot. If it is currently loaded (lsmod | grep oss), disable it by executing:
# rmmod snd_pcm_oss
4.1.1 ALSA/dmix without grabbing hardware device
You may want to use ALSA directly in most of your applications and to be able to use other applications, which constantly require PulseAudio at the same time. The following steps allow you to make PulseAudio use dmix instead of grabbing ALSA hardware device.
- Remove package pulseaudio-alsa, which provides compatibility layer between ALSA applications and PulseAudio. After this your ALSA apps will use ALSA directly without being hooked by Pulse.
- Edit /etc/pulse/default.pa.
- Find and uncomment lines which load back-end drivers. Add device parameters as follows. Then find and comment lines which load autodetect modules.
load-module module-alsa-sink device=dmix load-module module-alsa-source device=dsnoop # load-module module-udev-detect # load-module module-detect
- Optional: If you use kdemultimedia-kmix you may want to control ALSA volume instead of PulseAudio volume:
$ echo export KMIX_PULSEAUDIO_DISABLE=1 > ~/.kde4/env/kmix_disable_pulse.sh $ chmod +x ~/.kde4/env/kmix_disable_pulse.sh
- Now, reboot your computer and try running ALSA and PulseAudio applications at the same time. They both should produce sound simultaneously.
- Use pavucontrol to control PulseAudio volume if needed.
There are multiple ways of making OSS-only programs output to PulseAudio:
Install ossp package and start osspd.service.
4.2.2 padsp wrapper
Programs using OSS can work with PulseAudio by starting it with padsp (included with PulseAudio):
$ padsp OSSprogram
A few examples:
$ padsp aumix $ padsp sox foo.wav -t ossdsp /dev/dsp
You can also add a custom wrapper script like this:
#!/bin/sh exec padsp /usr/bin/OSSprogram "$@"
Make sure /usr/local/bin comes before /usr/bin in your PATH.
4.4 OpenALOpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so:
Edit the libao configuration file:
Be sure to remove the dev=default option of the alsa driver or adjust it to specify a specific Pulse sink name or number.
PulseAudio has an integrated 10-band equalizer system. In order to use the equalizer do the following:
5.1 Load equalizer sink and dbus-protocol module
$ pactl load-module module-equalizer-sink $ pactl load-module module-dbus-protocol
5.2 Install and run the GUI front-end
Install python-pyqt4 and execute:
5.3 Load equalizer and dbus module on every boot
Edit the file /etc/pulse/default.pa with your favorite editor and append the following lines:
### Load the integrated PulseAudio equalizer and D-Bus module load-module module-equalizer-sink load-module module-dbus-protocol
To find out if QEMU supports the pulseaudio run:
$ qemu-system-x86_64 -audio-help | grep 'Name: pa'
The QEMU can use environment variables for audio configuration
export QEMU_AUDIO_DRV=pa export QEMU_PA_SINK=alsa_output.pci-0000_04_01.0.analog-stereo.monitor export QEMU_PA_SOURCE=input
For more pulseaudio configuration options run:
$ qemu-system-x86_64 -audio-help | grep '_PA_'
To get list of the supported emulation audio drivers
$ qemu-system-x86_64 -soundhw help
To use e.g. ac97 driver for the guest use the -soundhw ac97 commnad with QEMU.
Make it switch to pulseaudio output
$ nyxmms2 server config output.plugin pulse
and to alsa
$ nyxmms2 server config output.plugin alsa
To make xmms2 use a different output sink, e.g.
$ nyxmms2 server config pulse.sink alsa_output.pci-0000_04_01.0.analog-stereo.monitor
See also the official guide .
6.3 KDE Plasma Workspaces and Qt4
PulseAudio will automatically be used by KDE/Qt4 applications. It is supported by default in the KDE sound mixer. For more information see the KDE page in the PulseAudio wiki. One useful tidbit from that page is to add load-module module-device-manager to /etc/pulse/default.pa.
If the phonon-gstreamer backend is used for Phonon, GStreamer should also be configured as described in #GStreamer.
Audacious natively supports PulseAudio. In order to use it, set Audacious Preferences -> Audio -> Current output plugin to 'PulseAudio Output Plugin'.
6.5 Java/OpenJDK 6
Create a wrapper for the Java executable using padsp as seen on the Java sound with PulseAudio page.
6.6 Music Player Daemon (MPD)
MPlayer natively supports PulseAudio output with the -ao pulse option. It can also be configured to default to PulseAudio output, in ~/.mplayer/config for per-user, or /etc/mplayer/mplayer.conf for system-wide:
$ pactl list sources
If the audio source is "suspended" then modifying the following line in /etc/pulse/default.pa and changing:
And then either restarting PulseAudio or your computer will only idle the input source instead of suspending it. guvcview will then correctly record audio from the device.
8 See also
- http://www.alsa-project.org/main/index.php/Asoundrc - ALSA wiki on .asoundrc
- http://www.pulseaudio.org/ - PulseAudio official site
- http://www.pulseaudio.org/wiki/FAQ - PulseAudio FAQ