On my raspberry pi I want to use mpd to listen to music. That should also work without any user logged in. This is the only case you should (and have to) use pulseaudio in the so called system-mode. If you don’t want to do that, you could also configure your machine to auto-login a user, but I won’t describe that here. Servers normally operate without logged-in users. That’s why you call them servers: they passively offer their services.
In all other cases you don’t need the system mode. Read here.
The drawback of system mode is, that you cannot easily interact with pulseaudio, so getting information about audio sinks and served soundcards, which normally can be done using pacmd and pactl is not that easy. How we can do this anyway I’ll describe now briefly.
First stop your pulseaudio service, running in system-mode.
sudo /etc/init.d/pulseaudio stop or on debian/ubuntu systems
sudo service pulseaudio stop
Then start the service as normal user with
If your user is member of the groups pulse and pulse-access you are now able to use
which gives you a list of all available sinks, cards and modules. For more detailed description of pacmd see the manpage. You can now get the needed information, e.g. to insert lines like
set-default-sink sink set-card-profile 0 profile
in the system-mode configuration of pulseaudio located at /etc/pulse/system.pa to force pulseaudio to use some sink with a specified card profile by default. Then test the changes just made by killing your session-mode service with
(test it with
ps -eF|grep pulse) and start pulseaudio in debug mode
sudo pulseaudio --system -vvvv
If pulseaudio then uses the sink you want it to, issue Ctr+C and restart pulseaudio. Voilá!