Introduction

As a part of my on-going project to setup a network based media distribution system for my house, I've run up against the marked lack of suitable software to control/manage things. Since I'm using Snapcast to distribute synchronised audio streams that are sourced from (currently) MPD, I wanted something with the following features:

  • Connect to multiple MPD instances.
  • Use a web-based interface.
  • Have a 'live' interface.
  • Support Snapcast Server control.
  • Support multiple concurrent users.
  • Be small, and lightweight memory and CPU-use-wise.
  • Open Source
  • Be easily end-user modify-able - depends on definition of 'easily' though.

Since there don't appear to be any web-based Snapcast server controllers currently, and nothing that supported most my required features, I decided to find a nice MPD controller, and bodge Snapcast control into it. After spending a lot of time rummaging through Github, I came across YMPD, which is simple, lightweight (it is a single executable), and has an elegant interface.

Over a few months I've added Snapcast server control functionality, fixed a couple of issues with YMPD itself, and made a few cosmetic changes to it's interface to be 'cleaner'. This works well and is reliable, but does not allow an easy way to control multiple MPD clients, and trying to add it this would mean completely butchering the YMPD code.

Thus, I've decided to write my own MPD /SnapCast controller, modeled on YMPD. So we come to Verdigris.

Features to (Try to) Implement

  • Simple client username/password login
  • Single config file
  • Auto-reconnect to MPD
  • Auto-reconnect to Snapcast server
  • Minimise server-to-webclient traffic
  • Plugins for interface - initially a complete (ugly) one, and a simplified (pretty) one
  • Control multiple MPD instances
  • Remote control of audio clients (Shutdown, and Restart to start with)
  • Provide everything (except configuration and HTML data) from a single executable
  • A 'live' interface - JavaScript City here we come!
  • Virtual Groups
  • Playlist management
  • Smart playlists
  • Change MPD config on the fly
  • Get current MPD codec
  • Background image for User Interface
  • Library folder bookmarks (Album, Track, Tree?)
  • PgUp/PgDn to go up/down the Library/Playlist/Queue
  • Library Browse remembers position between uses
  • Repeat Queue or Song button
  • Fixed button positions
  • Update specific folders in Library (rather than the whole Library)
  • Load/use .cue files (?)
  • Resample down to/up to <rate>
  • Resample down to <rate>
  • Resample at least to <rate>
  • Resample at most <rate>
  • Individual user support (?)
  • Multiple libraries (merge into single logical library ?)
  • DLNA (?)

Technical Bits

  • Use Mongoose for TCP/Websockets
  • Use libmpdclient2 to talk to MPDs
  • Use JSON to talk to web clients
  • Use MPD's idle command where possible

Config file format:

[MPD]
  instance=uniquenumber
  name=text
  username=text
  password=text
  address=text
  port=number
  enabled=Y/N
  autoconnect=Y/N
[MPD]
  instance=uniquenumber
  name=text
  username=text
  password=text
  address=text
  port=number
  enabled=Y/N
  autoconnect=Y/N
<repeated as necessary>
...

[User]
  name=uniquetext
  password=text
  rights=text
[User]
  name=uniquetext
  password=text
  rights=text
<repeated as necessary>
  • media_controller.txt
  • Last modified: 2018/08/11 20:18
  • by voxx