Advanced MPD Configurations: Networking, Caching, and Performance Tweaks

Advanced MPD Configurations: Networking, Caching, and Performance Tweaks

Overview

  • Focus: MPD (Music Player Daemon) advanced settings to improve network access, caching, and playback performance on servers and embedded devices.
  • Assumes MPD >= 0.21 and a Linux host with systemd. Paths and user/group: /etc/mpd.conf, user mpd, music directory /var/lib/mpd/music (adjust to your system).

1. Safe baseline: backup and permissions

  1. Backup current config and DB:

    Code

    sudo cp /etc/mpd.conf /etc/mpd.conf.bak sudo cp /var/lib/mpd/tag_cache /var/lib/mpd/tagcache.bak || true
  2. Ensure MPD owns its directories:

    Code

    sudo chown -R mpd:audio /var/lib/mpd /var/log/mpd /etc/mpd.conf sudo chmod 750 /var/lib/mpd

2. Networking: remote clients, TLS, and binding

  • Bind address: in /etc/mpd.conf set the audio_bind_to_address and port in the “audio_output” and “bind_toaddress” (listen) fields. Example to allow LAN clients only:

    Code

    bind_toaddress “192.168.1.100” port “6600”
  • Allow any host (not recommended): use “0.0.0.0”.
  • Firewall: open TCP 6600 for trusted subnets (ufw example):

    Code

    sudo ufw allow from 192.168.1.0/24 to any port 6600 proto tcp
  • TLS proxy: MPD lacks native TLS. Use stunnel or socat to terminate TLS and forward to localhost:6600.
    • stunnel minimal: terminate TLS on 6601 and forward to 6600; run stunnel as a system service.
  • Access control: restrict by bind address + firewall. For per-client auth, run MPD behind an SSH tunnel for untrusted networks.

3. Multi-room & networked audio

  • Pipe outputs and network

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *