I've installed Debian 8.6 on an old Mac laptop (PowerBook G4) as a living-room music player. This machine sits on a shelf and does exactly one thing: play music using mpd. So I want it to do that one thing well. ;-)
(This laptop is from 2005: it has a 1.5 GHz G4 processor and 768 MB of RAM. Plenty of horsepower for playing music, but not much else!)
And it mostly works ... except a couple of times an hour, the music stutters for maybe half a second. I strongly suspect that the process providing audio data (mpd) is unable to keep its output buffer full, so something (ALSA? the hardware?) plays that little snippet of audio in a tight loop until mpd gets back to feeding audio.
I further suspect that the problem is CPU starvation: something is blocking mpd from running for a large fraction of a second. My evidence for this comes from running "atop" during audio playback to capture a snapshot of the system state every second. When I review those snapshots, I don't see any spike in memory use or I/O, but I do see a spike in CPU usage: pulseaudio shoots up to 40-60% of CPU usage. That fits well with my "large fraction of a second" observation: if pulseaudio is consuming the entire CPU for 400 ms, that would probably show as 40% use during a 1 s interval, and if it starves mpd of CPU for 400 ms, that could account for the stuttering.
So that makes me wonder: why do I need pulseaudio to play music on this thing? I want this laptop to do one thing, play music, and I don't want any other process than mpd to use the audio hardware. So I would like mpd to simply use ALSA directly, without going through pulseaudio. And I can't figure out how.
Even more annoying, I can't even get ALSA utilities (aplay) to play audio without going through pulseaudio! It appears that any process that plays audio ends up causing pulseaudio to run. It further appears that systemd is involved in this conspiracy, since there is never more than one pulseaudio per user, and its parent PID is always 1 (/sbin/init, which is systemd).
Right now, I'm not entirely sure if this is an ALSA question, a pulseaudio question, a Debian question, or a systemd question. I'm fairly sure it's not an mpd question, since I can't even get aplay to play without going through pulseaudio.
So: how I do I disable pulseaudio on Debian 8.6, if that is indeed the source of my audio stuttering problem?