Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. Through plugins and libraries it can play a variety of sound files while being controlled by its network protocol. - www.musicpd.org
Above is a short description from MPD developer site. Indeed too short. MPD is powerful and feature rich. On one hand it has too many features I don’t need. I just want a music player that can be control remotely. On the other hand the mpd package from Alpine repository some how has a high cpu usage and I have no clue how to debug it. Eventually I decided to just roll my own version and cut everything to the bare minimum.
music_directory "/home/<user>/.mpd/Music"
playlist_directory "/home/<user>/.mpd/playlists"
log_file "syslog"
pid_file "/home/<user>/.mpd/mpd.pid"
state_file "/home/<user>/.mpd/mpd.state"
sticker_file "/home/<user>/.mpd/mpd.sticker"
user "<user>"
group "audio"
bind_to_address "::"
port "6600"
log_level "default"
auto_update "yes"
database {
plugin "simple"
path "/home/<user>/.mpd/mpd.db"
}
audio_output {
type "alsa"
name "ALSA"
auto_format "no"
auto_channels "no"
auto_resample "no"
}
Must add <user> to group audio, else mpd cannot connect to ALSA device.
Result
MPD features is cut to the bare minimum, a music player that can be control remotely from my main desktop with GUI or command line, and from my phone. CPU usage remain ~2% when playing on my 10yrs old laptop.