MPD uses 100% CPU after suspend-to-RAM
Version, Distribution, Desktop Environment:
0.3.23 from Debian package version 0.3.23-1 or master (0881d5b8) on sway
Description of Problem:
With PipeWire configured as a PulseAudio substitute (and PulseAudio not installed), if the computer is suspended-to-RAM while MPD is playing or paused, MPD constantly uses ~100% CPU after the computer is resumed. This does not occur with PulseAudio.
How Reproducible:
100%
Steps to Reproduce:
cat >mpd.conf <<'MPDCONF'
audio_output {
type "pulse"
name "My Pulse Output"
}
MPDCONF
mpd mpd.conf
# Note: Can be any audio, local or remote
mpc add https://audio.wnyc.org/radiolab_podcast/radiolab_podcast21redherring.mp3
mpc play
mpc pause # Optional
# Suspend to RAM, then resume
sudo rtcwake --mode mem --seconds 1
Actual Results:
mpd
will use ~100% CPU indefinitely. (Even after stopping pipewire
.)
Expected Results:
mpd
should be using ~1% CPU.
Additional Info
Running perf record -p "$(pidof mpd)"
for about a minute after resume shows 284 MMAP2 events and almost nothing else. (perf.data)
Let me know if there's any other information I can collect, or if I should open an issue with MPD (either to get their input or if you think the issue is on their side).
Thanks,
Kevin