How-To: Disable pulseaudio and sound in GDM
If like me you use MPD as a service daemon to listen to music, you might be annoyed anytime GDM start a pulseaudio process which prevents MPD from accessing the sound device.
Typically, the output of ps will produce the following output:
$ ps aux | grep pulse
gdm 1371 0.0 0.4 98180 4776 ? S<sl Jun13 0:00 /usr/bin/pulseaudio --start --log-target=syslog
gdm 1411 0.0 0.2 10748 2968 ? S Jun13 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
One way to sort the situation would be to kill this process manually, unfortunately, next time you reboot, the issue will happen again.
Another solution is to simply tell GDM not to use the sound. This can be done by editing /var/lib/gdm/.pulse/client.conf and add:
autospawn = no
daemon-binary = /bin/true
Mind that this file or parent directories might not exist, hence you might have to create them.
And the last thing to do is to grant access to this file to gdm user:
# chown gdm:gdm /var/lib/gdm/.pulse/client.conf
Now, next time you will restart your graphical session, the sound device will be accessible by mpd.