Unter Debian 12 wird der MusicPlayerDaemon mpd als system service installiert und beim booten gestartet. Das ist nicht so sinnvoll wenn Debian auf einem Desktop Rechner unter KDE läuft.
Deshalb wird hier folgendes empfohlen:
# As root, disable system service
systemctl disable --now mpd
# As user logged in the desktop session
systemctl --user enable mpd
# mpd starten
systemctl --user start mpd
meine ~/.conf/mpd/mpd.conf
music_directory "/home/wnf/Musik"
playlist_directory "/home/wnf/.config/wnfmpd/playlists"
db_file "/home/wnf/.config/wnfmpd/tag_cache"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "wnf"
log_level "verbose"
filesystem_charset "UTF-8"
input {
plugin "curl"
}
decoder {
plugin "hybrid_dsd"
enabled "no"
}
decoder {
plugin "wildmidi"
enabled "no"
}
audio_output {
type "alsa"
name "wnfAlsa"
}
mit obiger Vorgehensweise treten diese Fehler nicht mehr auf:
Literatur
Auch unter Raspberry Pi OS Lite läuft der Music Player Daemon (mpd).
zur Beachtung:
Nachdem auf dem Raspi Zero das Soundsystem funktioniert, kann ich den mpd installieren.
sudo apt install mpd
Der User mpd muss zur Gruppe audio hinzugefügt werden
sudo usermod -aG audio mpd
Anzeige der vorhandenen Soundkarten
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [HifiBerry DAC HiFi pcm5102a-hifi-0]
Subdevices: 0/1
Subdevice #0: subdevice #0
Die Datei /etc/mpd.conf anpassen:
sudo nano /etc/mpd.conf
Die Zeile kommentieren, damit der Zugriff über das Handy funktioniert:
# bind_to_address "localhost"
audio_output {
type "alsa"
name "Hifi Berry DAC"
device "hw:1,0" # optional
mixer_type "software" # optional
## mixer_device "default" # optional
## mixer_control "PCM" # optional
## mixer_index "0" # optional
}
sudo systemctl enable mpd
sudo service mpd restart
sudo service mpd status
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
Bei Problemen das journalctl anzeigen:
journalctl -f -u mpd
Meine Fehlermeldungen:
Tags: raspi mpd#! /bin/bash
# Playlist leeren, bis auf den aktuellen song
mpc crop
# Alle Songs an die aktuelle Playlist anhängen
mpc ls | mpc add
# Mischt alle Songs der Playlist.
mpc shuffle
# Die Playlist abspielen
mpc play
Tags: Linux-Scripte mpc mpd