Normally the PulseAudio server is started automatically, so most people don't need to know how to run PulseAudio. This page documents how the automatic starting works, how to disable the automatic starting and how to start and stop the server manually.
"Autospawning" means that when a PulseAudio client tries to connect to the server, but the server isn't running, the server gets automatically started. The feature is part of libpulse, and it's completely transparent to applications, that is, applications don't have to explicitly add support for autospawning, autospawning is done automatically as part of the connection process of any PulseAudio application.
Autospawning is the usual way to start the server. The server gets started when the first application wants to connect to it.
Autospawning can be disabled by setting "autospawn = no" in ~/.config/pulse/client.conf or /etc/pulse/client.conf. In that case the server needs to be started manually.
/etc/xdg/autostart/pulseaudio.desktop and start-pulseaudio-x11
/etc/xdg/autostart is a directory that contains information about session services that graphical session managers should start automatically on user login. PulseAudio ships its own file there. pulseaudio.desktop tells the session manager to run start-pulseaudio-x11, which is a script that loads a few X11 related modules (and on KDE also module-device-manager, which is required by KDE's audio routing configuration tools). start-pulseaudio-x11 is usually the first thing that requires a running PulseAudio server, so usually the server gets started when the session manager runs start-pulseaudio-x11 in the beginning of the login session.
If autospawning is disabled, start-pulseaudio-x11 doesn't have effect, because start-pulseaudio-x11 doesn't start the server explicitly. It relies on autospawning when it loads the X11 modules. In this sense the script name is misleading. The start-pulseaudio-x11 script used to start the server explicitly in the past, which explains the script name.
Manual starting and stopping
When debugging problems or trying new things, automatic starting may not be desirable. As described earlier, putting "autospawn = no" to client.conf will disable automatic starting. After doing that, a running server can be stopped with
Those commands work also when autospawning is enabled, but typically some background application will immediately reconnect, causing the server to get immediately restarted.
In the simplest form, the server can be started with this command:
That will run the server in the foreground, which is good if you want to see the log in real time. In this mode you can stop the server with Ctrl-C. If you want to start the server in the background instead, so that you don't have to keep the terminal window open, use the --daemonize option:
By default the log will only show warnings and errors, but when debugging, more verbose logging is usually needed. One -v option will add "info" level messages to the log, but to get full debug logging, use two v's:
Sometimes timestamps are useful when debugging. This command enables debug logging and timestamps:
pulseaudio -vv --log-time