Skip to content

Add automatic MPD server management - #354

Draft
htkhiem wants to merge 24 commits into
mainfrom
feature/mpd-orchestration
Draft

htkhiem wants to merge 24 commits into
mainfrom
feature/mpd-orchestration

Conversation

@htkhiem

@htkhiem htkhiem commented Sep 2, 2026

Copy link
Copy Markdown
Owner

This implements #339 and will allow Euphonica to become a "music player" in the traditional sense: you install the package/Flathub app, point it to a folder with music, and hit play. All the "MPD stuff" like setting up a config file, starting and stopping the server shall be handled transparently by Euphonica.

In this mode, Euphonica only borrows the MPD executable. It does not hijack control of any existing MPD server running on your system; rather, it spins up its own instance with a socket connection to avoid collisions and an autogenerated config file stored in the config folder of Euphonica, not MPD, again to avoid collisions with existing configs.

Configuration

Now that we're managing our own MPD server, that means the burden of writing the config file is upon us. To this end Euphonica will feature a GUI to configure certain fields that still make sense in a local-player context, e.g. we'll mostly focus on audio outputs and where the library is; things like where the DB files, sticker file, MPD playlist folders should be won't be exposed to the user.

Sneak peek of output config page (multiple outputs can be configured):
image

Progress:

  • Subprocess management (start/stop/restart)
  • Basic config file parsing and writing
  • Basic audio output plugin config (just the common settings)
  • Hidden managed FIFO output for visualiser
  • Force visualiser into FIFO mode & to read from managed path when in standalone mode
  • Fix janky FIFO visualiser behaviour until it looks like PipeWire side
  • Programmatically construct plugin-specific config keys with suitable ActionRow subclasses. Configuring these is mandatory for many plugins, like user-configured FIFO.
  • Hide managed FIFO output from bottom bar/pane.
  • Allow customising MPD binary path + add MPD path autodetection for things like Flatpak + add more toplevel config such as resamplers.
  • Add onboarding pages to let users pick between Standalone Mode ("Use Euphonica like a music player") and client mode ("Connect Euphonica to an MPD-compatible server") + subsequent setup pages, like setting library path or connection address.
  • Update AUR and Flatpak distributions to now include mpd as a hard dependency (+ maybe some resampler libs too).
  • Maybe add a new AUR package without MPD deps and with standalone mode hidden from config (euphonica-client-git) should some want to keep their system svelte.
  • Rewrite ALL them READMEs to re-frame ourselves as a "music player" instead.
  • Maybe add a new wiki page to document the whole thing?

Still having trouble on startup (needing one refresh), currently looking for that early operation that has to be refactored to wait for the managed server to complete boot up first.
Removed duplicated server start  and player set_is_foreground invocations.
This is gonna take a while since there is so much to configure and validate...
Huge diff cuz I accidentally hit `cargo fmt` sorry
Will have to construct these programmatically hence all the boilerplate
Wrong sign bit parsing equaled a DC offset to the whole signal ugh
@aaravrav

aaravrav commented Sep 20, 2026

Copy link
Copy Markdown
Contributor
  • todo for me after this PR is merged: add a nixos module for euphonica to automatically manage mpd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants