- 1 Installation
- 2 Easy configuration
- 3 Advanced configuration
- 4 Modules
- 5 Further resources
PulseAudio only requires thepackage to run, but you may also want to install various other tools to help you configure it and integrate better with your desktop environment.
|Package||Usage||(required)||The main daemon, commandline tools and libraries.|| Provides an
||A GUI for general daemon configuration.||An advanced volume control GUI: allows to change the volume of individual streams and configure the ports of all sound cards.||and AUR||CLI mixers similar to pavucontrol.||PaWebControl||A web GUI similar toto remotely control volumes (like from a mobile device).||AUR||A system tray for volume adjustment as well as a few basic operations like switching sinks and sources.||KDE's default volume control applet with similar functions to pavucontrol.||broken link: archived in aur-mirror]AUR[||An advanced PulseAudio applet for KDE.|
By default, PulseAudio is configured to automatically detect all sound cards and manage them. It takes control of all detected ALSA devices and redirect all audio streams to itself, making the PulseAudio daemon the central configuration point. The daemon should work mostly out of the box, only requiring a few minor tweaks using the GUI configuration tools. All settings are saved in
~/.config/pulse and automatically restored when the daemon starts. Use the following tools to configure the daemon to your taste:
- Simultaneous output to all sound cards
- Network device streaming and discovery (requires Avahi daemon to be installed and running): play sound on any computer on your network from any computer.
- Per-application volume control
- Manage input and output devices volumes and outputs
- Sound card configuration to select input/output ports to use and enable/disable devices
While PulseAudio usually runs fine out of the box and requires only minimal configuration, advanced users can change almost every aspect of the daemon by either altering the default configuration file to disable modules or writing your own from scratch. PulseAudio runs as a server daemon that can run either system-wide or on per-user basis using a client/server architecture. The daemon by itself does nothing without its modules except to provide an API and host dynamically loaded modules. The audio routing and processing tasks are all handled by various modules, including Pulse's native protocol itself (provided by module-native-protocol-unix). Clients reach the server through one of many protocol modules that will accept audio from external sources, route it through PulseAudio and eventually have it go out through a final other module. The output module does not have to be an actual sound output: it can dump the stream into a file, stream it to a broadcasting server such as Icecast, or even just discard it.
PulseAudio can be configured in multiple ways depending on your needs and uses multiple different configuration files. Configuration files are read from
~/.config/pulse/ first, then from
/etc/pulse/ for system-wide defaults. People usually change the system-wide version unless they intend to have multiple users with different configurations.
This is the main configuration file to configure the daemon itself. It defines base settings like the default sample rates used by modules, resampling methods, realtime scheduling and various other settings related to the server process. These can not be changed at runtime without restarting the PulseAudio daemon. Most defaults make sense here and are self-explaining, see the
pulse-daemon.conf man page for additional information. Boolean options accepts any of these:
1 as well as
|Option||Description||system-instance|| If set to
||realtime-scheduling|| If your kernel supports realtime scheduling (for instance, Kernels#-rt or Kernels#-ck), set this to
||exit-idle-time||If you want to run PulseAudio only when needed and use ALSA otherwise, you can set a delay in seconds after which the daemon will automatically shutdown after all clients are disconnected. Set it to -1 to disable this feature.||resample-method|| When PulseAudio needs to pass audio from one module to another using incompatible sample-rate (for example, playback at 96kHz to a card that only supports a maximum of 48kHz), specifies which resampler to use. You can use the command
||enable-remixing|| When the input and output have a different channel count (for example, outputting a 6 channel movie into a stereo sink), pulse can either remix all the channels (default,
||default-fragments|| Audio samples are splitted into multiple fragments of
||default-fragment-size-msec||The size in milliseconds of each fragment. This is the amount of data that will be processed at once by the daemon. TODO: Verify|
This file is a startup script and is used to configure modules. It is actually parsed and read after the daemon has finished initializing and additional commands can be sent at runtime using
$ pactl or
$ pacmd. The startup script can also be provided on the command line by starting PulseAudio in a terminal using
$ pulseaudio -nC. This will make the daemon load the CLI module and will accept the configuration directly from the command line, and output resulting information or error messages on the same terminal. This can be useful when debugging the daemon or just to test various modules before setting them permanently on disk. The manual page is quite self explaining, please consult
man pulse-cli-syntax for the details of the syntax.
In order to configure the daemon, you will mostly only need the very basic commands:
|| Loads a module called
||Unloads a module by its index (returned by the load-module command) or all modules by name.||
||Allows all commands after this statement to fail without interrupting the script and shutting down the daemon. This is useful when you know some commands could fail and would not affect overall operation, like loading modules for removable devices or network devices that can potentially get unreachable.||
||Reverse of .fail: failing commands after this statement will interrupt the script and will cause the daemon to return an error.|
There are plenty more commands available that are useful at runtime to control the daemon, see the
pactl manpage for more details. Everything that an be made in
pavucontrol can also be made on the command line, useful for bash scripts.
This is the configuration file read by every PulseAudio client applications. It is used to configure runtime options for individual clients. It can be used to set the configure the default sink and source statically as well as allowing (or disallowing) clients to automatically start the server if not currently running.
|Option||Description||autospawn||If enabled, clients will automatically start PulseAudio if it is not already running when a client attempts to connect to it. This can be useful if you do not want PulseAudio to always be running to conserve system resources. Otherwise, you really should have it start with your X11 session.|
Connection & authentication
Since PulseAudio runs as a daemon as the current user, clients needs to know where to find the daemon socket to connect to it as well as a shared random cookie file clients use to authenticate with it. By default, clients should be able to locate the daemon without problem using environment variables, X11 root window properties and finally by trying the default location (
unix:/run/user/$ID/pulse/native). However, if you have clients that needs to access PulseAudio outside of your X11 session like mpd running as a different user, you will need to tell it how to connect to your PulseAudio instance. See PulseAudio/Examples#TODO[broken link: invalid section] for a complete example. An authentication cookie containing random bytes is enabled by default to ensure audio does not leak from one user to another on a multi-user system. If you already control who can access the server using user/group permissions, you can disable the cookie by passing
These two variables are the important ones in order for libpulse clients to locate PulseAudio if you moved its socket to somewhere else. See
man pulseaudio for more details and other useful environment variables clients will read.
|| Defines where the server is. It takes a protocol prefix like
||Point this to the location of a file that contains the random cookie generated by PulseAudio. This file will be read by clients and its content sent to the server, thus the file has to be readable by all audio clients. It does not need to be the same file, as long as its content matches the one the daemon uses.|
PulseAudio also uses window properties on the root window of the X11 server to help find the daemon. Since environment variables cannot be modified after child processes are started , X11 properties are more flexible because they are more easily changed because they are globally shared. As long as applications receive a
DISPLAY= environment variable, it can read the most up-to-date values. X11 properties can be queried using
xprop -root, or with
pax11publish -d to read pulse-specific properties.
pax11publish can also be used to update the properties from environment variables (
pax11publish -e or remove them entirely
. If possible, it is recommended to let PulseAudio do it my itself using the module-x11-publish module or the
start-pulseaudio-x11 command. The following table is there only for completeness, you should not ever need to manually set these variables by hand.
|| String value (
||String value that contains the hexadecimal representation of the authentication cookie.|
Filters & Routing