PulseAudio is a sound system used in modern Linux distributions. In most scenarios sound will work without any problem and you’ll not know what is under the hood. The fun begins when some additional settings are needed and that usually leads to debugging process
PulseAudio daemon has default settings to shut down itself after defined time of inactivity. In /etc/pulse/daemon.conf can be read the following line:
; exit-idle-time = 20
The line is commented and that means default value of 20 seconds before PulseAudio will exit. Later will be explained why is “exit-idle-time” important.
Here are main switches for PulseAudio:
pulseaudio -k -> kill PulseAudio daemon pulseaudio -D -> start PulseAudio as a daemon pulseaudio -v -> start PulseAudio daemon from terminal with increased verbosity level
Sound utility that is also needed is pavucontrol – PulseAudio volume control. In Fedora 22 pavucontrol is not installed by default. As a root user it can be installed in a minute:
# dnf install pavucontrol
Installed pavucontrol and pulseaudio is sufficient for debugging sound problems. In my case I killed pulseaudio with “-k” and start it from command line with “-v”. It’s important to mention that starting and stopping pulseaudio (as well as pavucontrol) should be performed as a normal user (not root). Otherwise, some .config files will be written in the user home directory with root uid and this should be corrected manually (with chown).
To start debugging PulseAudio, just type the following command from the terminal:
> pulseaudio -k > pulseaudio -v
This will give a lot of info to the output. If sound is not needed by any client then PulseAudio will exit after default time of inactivity. Don’t be confused, and that is normal behaviour of the sound daemon. So, the main debug procedure is to kill PulseAudio daemon and start it from the command line with “-v” switch. Actually, “-v” will increase verbosity output and it’s possible to use higher levels up to level 4 (see manual for more info). To stop running PulesAudio – press Ctrl-C in terminal, make changes in config files and run it again. In my case I was trying to set simultaneous sound output to Line and HDMI for my Kodi HTPC and I have to “play” with config files for the couple of hours … ;)
Anyway, I hope this described procedure will help you to start debugging PulseAudio.