Music Player Daemon (MPD) Server


# STEP9

# install MPD (server)and MPC (music player)
# Music Player Daemon (MPD) Info:
# https://www.musicpd.org/

# create a simbolic link for backward compatibility with old version of MPD # which target by default the configuration file in /usr/local/etc/mpd.conf

  1. $ ls /usr/local/etc


# result should be empty or not found then type

  1. $ sudo rm -r /usr/local/etc


  1. $ sudo ln -s /etc /usr/local/


# type again and result should show the files of etc/ directory

  1. $ ls /usr/local/etc

# optional pkg update

  1. $ sudo apt update

# install MPD

  1. $ sudo apt install mpd mpc -y

# Check mpd version

  1. $ mpd -V

# should be 0.21.22 or greater
# if the version is lower then compile and install mpd
# ( version 0.23.12 works really well with Raspberry PI 4 and Odroid C4, latest version works with barbone PC as well )

# our recommendation is to start with the super stable 0.23.12 and later give the latest version of MPD a try.

# you decide, you have the full info here to compile and install MPD, this is one of the benefit to get a full control of your audio server.

Click NEXT button below to skip the compilation of MPD …


COMPILE AND INSTALL MPD - Click To Read More...

# check your gcc version:

  1. $ gcc --version

# if command not found install build-essential package

  1. $ sudo apt -y install build-essential

# skip the gcc install if version is 8.x+ or greater

  1. $ sudo apt install gcc-8-base

# FOR RASPBERRY PI 4 OWNERS:

# on compilation error increase swap file size,
# change default 100 to 1024

  1. $ sudo nano /etc/dphys-swapfile

CONF_SWAPSIZE=1024

# reboot if you change the swap size

  1. $ sudo reboot

# get url archive from https://www.musicpd.org/download.html
# download latest archive mpd-0.23.x.tar.xz into your home directory (Downloads/ for example)
https://www.musicpd.org/download/mpd/0.2X/mpd-0.2X.XX.tar.xz

# be sure to select your /Downloads folder inside your home directory (create the folder Downloads if needed)

  1. cd ~/Downloads

# hyper stable MPD release

  1. $ sudo wget https://www.musicpd.org/download/mpd/0.23/mpd-0.23.12.tar.xz

# extract (replace -version by the version of mpd mpd-0.23.12.tar.xz):

  1. $ sudo tar xf mpd-version.tar.xz

# enter directory:

  1. $ cd mpd-0.23.12

# or get the very latest (unstable dev release) by cloning the MPD git to MPD/

# install git if not found

  1. $ sudo apt install git
  1.  $ sudo git clone https://github.com/MusicPlayerDaemon/MPD.git
  1. $ cd MPD

# install dependencies:

In any case, you need: a C++17 compiler (e.g. GCC 8 or clang 5) Meson 0.49.0 and Ninja Boost 1.58 pkg-config

  1. $ sudo apt-get install ninja-build

# the command below must includes a lot of dev libraries
# be careful to double check it before validation with enter key
#

$ sudo apt install meson g++ \
libfmt-dev \
libpcre2-dev \
libmad0-dev libmpg123-dev libid3tag0-dev \
libflac-dev libvorbis-dev libopus-dev libogg-dev \
libadplug-dev libaudiofile-dev libsndfile1-dev libfaad-dev \
libfluidsynth-dev libgme-dev libmikmod-dev libmodplug-dev \
libmpcdec-dev libwavpack-dev libwildmidi-dev \
libsidplay2-dev libsidutils-dev libresid-builder-dev \
libavcodec-dev libavformat-dev \
libmp3lame-dev libtwolame-dev libshine-dev \
libsamplerate0-dev libsoxr-dev \
libbz2-dev libcdio-paranoia-dev libiso9660-dev libmms-dev \
libzzip-dev \
libcurl4-gnutls-dev libyajl-dev libexpat-dev \
libasound2-dev libao-dev libjack-jackd2-dev libopenal-dev \
libpulse-dev libshout3-dev \
libsndio-dev \
libmpdclient-dev \
libnfs-dev \
libupnp-dev \
libavahi-client-dev \
libsqlite3-dev \
libsystemd-dev \
libgtest-dev \
libboost-dev \
libicu-dev \
libchromaprint-dev \
libgcrypt20-dev 

# reboot maybe required here # check meson version (0.49 minimum)

  1. $ meson -v

# configure:

  1. $ sudo meson . output/release --buildtype=debugoptimized -Db_ndebug=true -Dsysconfdir=/etc

# check configuration:

  1. $ sudo meson configure output/release

# compile (could take a while… ):

  1. $ sudo ninja -C output/release

# install:

# stop mpd in case it’s running

  1. $ sudo systemctl stop mpd
  1. $ sudo ninja -C output/release install

# go to home directory

  1. $ cd ~/

# Congrats! MPD is compiled and installed

Click the button NEXT below to continue…