Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Support for MPD satellite mode
#1
mpd has this interesting feature called satellite mode.

In satellite mode, you have master copy of mpd running somewhere, usually on the computer that has your local music on it. Other satellite copies of mpd can share the database from the master server. You still need to mount the music directory to play music, but all library updates are sent by the satellite server to the master server and it does the updates and shares it's database.

This makes updates a LOT faster, since they're done locally and not over the network. It also means, if you have multiple mpd based players around the house that support satellite mode, if you update the music library on one device, all devices set up in satellite mode, get the update.

I don't know how well I explained this.

Here is the mpd documentation for satellite setup:

https://mpd.readthedocs.io/en/latest/use...lite-setup
Reply
#2
The main challenge is reliability because it requires (1) reliable network, (2) reliable NAS, (3) correctly configured Samba or NFS.

These happen to be the top 3 categories of support issues :-0 and so I'm not too keen on creating a feature that would likely increase the numbers of these types of issues.

Having the MPD database local on each Pi is not that hard to admin since you can easily connect to each Pi via the Players >>  option and then Menu, Update library. There is also /var/www/libupd-submit.php which can be run from a cron job

Our build of MPD does include the proxy database plugin so in theory one could actually test it out by hand editing /etc/mpd.conf. This file does get auto-rewritten though during some processes for example saving MPD Config, rebooting with a configured I2S DAC so those would need to be avoided.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Well, I would not want this to be the default, just an option when configuring a library.

I scanned my library last night, and it took about 45 minutes to do it. If I set it up as a satellite, it would have taken about 30 seconds.

Like I said, just make it an option.

If I manually configured the mpd.conf to be a satellite server, would it break anything?
Reply
#4
You need to make a good case for adding this to the TODO list. "Just make it an option" is not a very compelling case. Remember that features compete with one another on the TODO list for developer time and they compete with dev time required to fix bugs and provide support.

Optional configs require time and effort to support just like default configs and as I mentioned earlier this one falls into the top 3 categories of support issues: Network, NAS and File sharing.

Your best bet would be to rig it up manually and then post your configuration so other users that are interested can test it out on their own systems. If there is sufficient demand for something like this then maybe there is a basis for a case to made to add it to the TODO list.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
Fair enough. I am not a developer. I will not demand features.
Reply
#6
I use satellite mode for all my players around 8 of them. I have enabled NFSv4 on a RPI4 which uses the database plugin "simple". On the satellite mode I use the proxy database plugin. When I add songs to the NFS server, the same database gets available to all satellite players. The advantage of this setup is that you need to update only one server when you add/delete songs and this can be automatic if you have auto_update to yes in mpd.conf. Also when you save a playlist on any of the satellite mpd player, the same playlist gets available on all mpd players.

Quote:auto_update                      "yes"


Code:
# mpd.conf database configuration entry for PI4
music_directory     "/var/lib/mpd/MDrive/Music"
playlist_directory  "/var/lib/mpd/MDrive/playlists"
database {
 plugin          "simple"
 path            "/var/lib/mpd/MDrive/data/tag_cache.PI4"
 cache_directory "/var/lib/mpd/MDrive/cache"
}

# mpd.conf database configuration entry for client
# pi4 is an entry in /etc/hosts for the device
# providing the database
music_directory     "/var/lib/mpd/MDrive/Music"
playlist_directory  "/var/lib/mpd/MDrive/playlists"
database {
   plugin          "proxy"
   host            "pi4"
   port            "6600"
}

There are few issues when you use this kind of setup

1) The satellite mpd will hang / not work when your central mpd server is down or if there is any network issue
2) You need a good network. But I would like to mention that this has never been an issue for me when using wireless n and above
3) Makes configuration complicated for end users. They need to configure a network share using NFS or Samba on the server that will have the mpd database
4) You need to configure all satellite clients to mount the share on the same directory mentioned for music_directory in /etc/mpd.conf. So the end user will have to edit /etc/fstab or have the mount command somewhere or configure autofs which will automount the directory whenever it gets accessed.

I know two clients that support this
Desktop Client Cantata has the option 'Server detects changes automatically'
[img]blob:http://moodeaudio.org/d6ba9a9d-44d5-4586-9598-91f87f164193[/img]
The other player that I know supports this is rompr. For satellite players one has to check the 'Remote' radiobutton and it shows 'Update MPD database' only when you connect to the main mpd server
[img]blob:http://moodeaudio.org/bc671624-39d6-4c74-9298-ec6ae0337ea5[/img]
Reply
#7
(09-23-2021, 06:22 AM)cprogrammer Wrote: I use satellite mode for all my players around 8 of them. I have enabled NFSv4 on a RPI4 which uses the database plugin "simple". On the satellite mode I use the proxy database plugin. When I add songs to the NFS server, the same database gets available to all satellite players. The advantage of this setup is that you need to update only one server when you add/delete songs and this can be automatic if you have auto_update to yes in mpd.conf. Also when you save a playlist on any of the satellite mpd player, the same playlist gets available on all mpd players.

Quote:auto_update                      "yes"


Code:
# mpd.conf database configuration entry for PI4
music_directory     "/var/lib/mpd/MDrive/Music"
playlist_directory  "/var/lib/mpd/MDrive/playlists"
database {
 plugin          "simple"
 path            "/var/lib/mpd/MDrive/data/tag_cache.PI4"
 cache_directory "/var/lib/mpd/MDrive/cache"
}

# mpd.conf database configuration entry for client
# pi4 is an entry in /etc/hosts for the device
# providing the database
music_directory     "/var/lib/mpd/MDrive/Music"
playlist_directory  "/var/lib/mpd/MDrive/playlists"
database {
   plugin          "proxy"
   host            "pi4"
   port            "6600"
}

There are few issues when you use this kind of setup

1) The satellite mpd will hang / not work when your central mpd server is down or if there is any network issue
2) You need a good network. But I would like to mention that this has never been an issue for me when using wireless n and above
3) Makes configuration complicated for end users. They need to configure a network share using NFS or Samba on the server that will have the mpd database
4) You need to configure all satellite clients to mount the share on the same directory mentioned for music_directory in /etc/mpd.conf. So the end user will have to edit /etc/fstab or have the mount command somewhere or configure autofs which will automount the directory whenever it gets accessed.

I know two clients that support this
Desktop Client Cantata has the option 'Server detects changes automatically'
[img]blob:http://moodeaudio.org/d6ba9a9d-44d5-4586-9598-91f87f164193[/img]
The other player that I know supports this is rompr. For satellite players one has to check the 'Remote' radiobutton and it shows 'Update MPD database' only when you connect to the main mpd server
[img]blob:http://moodeaudio.org/bc671624-39d6-4c74-9298-ec6ae0337ea5[/img]

Added to TODO list for post 7.4.0 release.

It's prolly more of an expert-mode configuration but I think a UI for it is doable. It will just take some thought.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
I don't have anything as formal as a ToDo list but it's always been in the back of my mind that since I'm already using a OpenMediaVault NAS I'd explore running an instance of MPD on it to keep a "master" database in sync with the NAS Music share.

In this configuration your reliability issues 1 and 2 become a more general "is the NAS reachable or not" question (and I too have always had reliable NAS service over WiFi.)

Regards,
Kent
Reply


Forum Jump: