Skip to content

Add MPD server support#826

Open
M0Rf30 wants to merge 11 commits intodweymouth:mainfrom
M0Rf30:feat/mpd-support
Open

Add MPD server support#826
M0Rf30 wants to merge 11 commits intodweymouth:mainfrom
M0Rf30:feat/mpd-support

Conversation

@M0Rf30
Copy link
Copy Markdown
Contributor

@M0Rf30 M0Rf30 commented Jan 26, 2026

Hey! This adds MPD (Music Player Daemon) as a supported server type.

What's this about?

MPD is different from Subsonic/Jellyfin - it doesn't stream audio to clients, it plays audio directly on the server. So Supersonic connects to MPD and controls playback remotely (jukebox mode), while still providing the full browsing experience.

How it works

  • Browse your library normally (albums, artists, playlists, genres, etc.)
  • Playback happens on the MPD server, not locally
  • Works alongside other MPD clients - you can control the same queue from multiple apps
  • Uses MPD stickers for favorites, ratings, and play counts
  • Artist images come from Deezer, biographies from Wikipedia (since MPD doesn't have this metadata)

Technical bits

  • New backend/mediaprovider/mpd/ package with the provider implementation
  • Enhanced JukeboxPlayer to support event-driven status updates (uses MPD idle commands instead of polling when available)
  • Queue sync so you can connect to an already-playing MPD instance without disrupting it
  • UI adapts automatically - disables features that don't make sense in jukebox mode (like the equalizer, local audio settings, etc.)

Testing

Tested against MPD 0.23.x with a ~50k track library. Works well with ncmpcpp and other clients running simultaneously.

Let me know if you have questions or want me to change anything.

@dweymouth
Copy link
Copy Markdown
Owner

Thanks! This looks pretty cool, but heads-up it will take me awhile to review and test this. I also want to let #820 finish up first, and this will likely have to be rebased and have merge conflicts with the queue shuffle implementation, which will have to be added for MPD as well

@M0Rf30 M0Rf30 force-pushed the feat/mpd-support branch 6 times, most recently from 937a5e3 to a609fbf Compare February 4, 2026 00:03
@M0Rf30 M0Rf30 force-pushed the feat/mpd-support branch 2 times, most recently from 1205d2a to 731ef0d Compare February 10, 2026 21:00
@dweymouth
Copy link
Copy Markdown
Owner

OK, the shuffle PR is in! There will be probably pretty significant merge conflicts when rebasing this, but I think nothing else coming up should cause much or any merge headaches later on. I will aim to put out a feature release soon, and if necessary a bugfix release, and then to have this go in the feature release after that. I guess I'll have to set up a MPD server to test with :) but I'll start looking over the code once you've rebased and implemented shuffling for MPD and add comments as I see things.

@M0Rf30 M0Rf30 force-pushed the feat/mpd-support branch 2 times, most recently from d557341 to 7bd0617 Compare February 21, 2026 11:59
@Badsheep
Copy link
Copy Markdown

Badsheep commented Mar 8, 2026

Hello, is it possible to test this version ? I don’t know how to built :(
My OS is macOS Intel.

@M0Rf30 M0Rf30 force-pushed the feat/mpd-support branch 4 times, most recently from 0937a07 to d4608ae Compare March 9, 2026 18:50
@M0Rf30
Copy link
Copy Markdown
Contributor Author

M0Rf30 commented Mar 9, 2026

Hello, is it possible to test this version ? I don’t know how to built :( My OS is macOS Intel.

https://github.com/dweymouth/supersonic/actions/runs/22869505037/artifacts/5836111009

@Badsheep
Copy link
Copy Markdown

Badsheep commented Mar 9, 2026

Hi, thank you M0Rf30 ! I just tried it :)

1st impression : it works ! It connects successfully to my navidrome and my MPD and everything works fine.

Now the question I ask myself is more about the implementation : in fact we have TWO separate libraries. What would be really cool (if possible, I don't know) would be to use the same library, just switch the audio output...

Thanks again !

@M0Rf30 M0Rf30 force-pushed the feat/mpd-support branch from d4608ae to f4beaca Compare March 13, 2026 22:29
@dweymouth
Copy link
Copy Markdown
Owner

Could the Wikipedia and Deezer agents be implemented as a fallback for all servers rather than specific to the MPD implementation? (like the existing LrcLib integration for example). We should also add a checkbox to the settings dialog to disable these integrations for users who don't want Supersonic reaching out to any network endpoints besides their server.

This could be done in a separate PR to main, and then merging that in and rebasing this would lessen its line count a bit and make it easier to review thoroughly :)

@dweymouth
Copy link
Copy Markdown
Owner

Hi, thank you M0Rf30 ! I just tried it :)

1st impression : it works ! It connects successfully to my navidrome and my MPD and everything works fine.

Now the question I ask myself is more about the implementation : in fact we have TWO separate libraries. What would be really cool (if possible, I don't know) would be to use the same library, just switch the audio output...

Thanks again !

It will not be in scope to have MPD and Navidrome merged into a single library on the Supersonic side. It has to assume the library is different per-server. If you want to play back music from your server but also be able to stream the same library to a client, you're looking for Navidrome (Subsonic)'s Jukebox mode, which isn't currently supported by Supersonic but will probably be a lot easier to support after this PR

M0Rf30 added 4 commits March 15, 2026 11:45
Extract artist info fetching from external sources (Deezer for images,
Wikipedia for biographies) into a shared ArtistInfoManager that works
as a fallback for all server types, not just MPD.

When a server returns incomplete artist info (missing biography or image),
the manager automatically queries Deezer and Wikipedia to fill in the gaps.
This follows the same pattern as the existing LrcLib lyrics fallback.

A new 'Enable Deezer/Wikipedia artist info' checkbox in Settings > Advanced
allows users to disable these external integrations.
Extract artist info fetching from external sources (Deezer for images,
Wikipedia for biographies) into a shared ArtistInfoManager that works
as a fallback for all server types, not just MPD.

When a server returns incomplete artist info (missing biography or image),
the manager automatically queries Deezer and Wikipedia to fill in the gaps.
This follows the same pattern as the existing LrcLib lyrics fallback.

A new 'Enable Deezer/Wikipedia artist info' checkbox in Settings > Advanced
allows users to disable these external integrations.
M0Rf30 added 7 commits March 15, 2026 11:46
Remove the embedded Deezer/Wikipedia artist info fetcher from the MPD
backend and use the shared ArtistInfoManager (from feat/external-artist-info)
instead. This eliminates ~350 lines of duplicated code.

- Delete backend/mediaprovider/mpd/artistinfo.go
- Simplify MPD GetArtistInfo to return empty (manager handles fallback)
- Remove CacheManager interface (cache now in shared manager)
- Remove Language field from MPDServer (shared fetcher reads from config)
- Thread ArtistInfoManager through grid view pages and router
- Update OnLoadArtistImage callback to include artist name for fallback
@M0Rf30 M0Rf30 force-pushed the feat/mpd-support branch from 8b64c5f to de18960 Compare March 15, 2026 10:46
@Badsheep
Copy link
Copy Markdown

Ok I understand, thank for your answer ! I’ll have a look later if one day Supersonic supports Jukebow mode 👍 this app is really nice.

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.

3 participants