1. Home
  2. Docs
  3. Applications
  4. mpd ~ Music Player Daemon

mpd ~ Music Player Daemon

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.

https://www.musicpd.org/

There are definitely hundreds of ways to use and set up mpd …
I am showing a variant here in which mpd runs as a user and is available as a stream via the local network.

install packages:

sudo pacman -S mpd mpc

mkdir ~/.config/mpd
mkdir ~/.config/mpd/playlists

creating config –> nano ~/.config/mpd/mpd.conf

#See: /usr/share/doc/mpd/mpdconf.example

pid_file "~/.config/mpd/mpd.pid"
db_file "~/.config/mpd/mpd.db"
state_file "~/.config/mpd/mpdstate"

# replace with your path to playlist and music directory
playlist_directory "path to playlists"
music_directory "path to music"
auto_update "yes"

#pulseaudio

audio_output {
type "pulse"
name "pulse audio"
}

#local-stream

audio_output {
type "httpd"
name "MPD - Musik Stream Server"
encoder "lame" # optional
port "8000"

quality "5.0" 
# do not define if bitrate is defined
#bitrate "128" 
# do not define if quality is defined 
format "44100:16:1" 
always_on "yes" 
# prevent MPD from disconnecting all listeners when playback is stopped. 
tags "yes" 
# httpd supports sending tags to listening streams.
}

now simple start the service as your user:

systemctl --user start mpd

this will be present till next reboot, to enable per default on every boot:

systemctl --user start --now mpd

Stream will be available from many devices and apps, calling it via url. EXAMPLE:

http://192.168.178.90:8000

Inside your local network.

Creation of playlist and player input can be done with one of the available mpd player interfaces:

from terminal: nncmpp

graphical interfaces: Ario, Cantata, xfmpc

XFCE4 panel plugin: xfce4-mpc-plugin

More info:

https://wiki.archlinux.org/index.php/Music_Player_Daemon

https://github.com/MusicPlayerDaemon/MPD

Follow us
Was this article helpful to you? Yes No

How can we help?