MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.18k stars 351 forks source link

Low latency MPD server syncronization #876

Open avuton opened 4 years ago

avuton commented 4 years ago

Feature request

I'd love to have a way to get low latency playback synchronization between servers. There are a few different clients that can synchronize playback, but low latency wouldn't be a possibility, even in the best of circumstances.

skidoo23 commented 4 years ago

+1 :) In a local (wired) network PTP Precision Time Protocol https://github.com/ptpd/ptpd should be a sufficient precise clock source. But how to keep server outputs in sync? Detect and fill or skip silence?

geneticdrift commented 4 years ago

May be worth having a look at snapcast

Snapcast is a multiroom client-server audio player, where all clients are time synchronized with the server to play perfectly synced audio. It's not a standalone player, but an extension that turns your existing audio player into a Sonos-like multiroom solution. The server's audio input is a named pipe /tmp/snapfifo. All data that is fed into this file will be sent to the connected clients. One of the most generic ways to use Snapcast is in conjunction with the music player daemon (MPD) or Mopidy, which can be configured to use a named pipe as audio output.

skidoo23 commented 4 years ago

Tried snapcast a few years ago. It worked (had some issues which might already be fixed) BUT you have to deal with two controls. Volume changes or pause on software controlled MPD is rendered with quite large delay and snapcast is not able to change tracks on a MPD server. Snapcast is more targeted to wireless networks it sends unicast packets to its clients. But why? Even wireless equipment should be able to deal with multicast. Come on it is the 21th century. The future, you remember ;)

At the moment I like Dante. USB to Dante (wired ethernet, 4 channels audio) and PoE powered wired ethernet to XLR or AES/EBU are available for more or less reasonable pricing. But control is more targed to professional audio people. Very, very low WAF ;)

MaxKellermann commented 4 years ago

Snapcast uses MPD's experimental "fifo" output with all its weaknesses. That's a rather bad choice. Now if Snapcast had a documented protocol, MPD could implement a "native" Snapcast output plugin without all the "fifo" trouble. But I think this feature request is not about broadcasting/multicasting actual audio data, but about synchronizing multiple MPD instances with the same database/music files.

avuton commented 4 years ago

But I think this feature request is not about broadcasting/multicasting actual audio data, but about synchronizing multiple MPD instances with the same database/music files.

Yes, that was the intention of the feature request.

skidoo23 commented 4 years ago

See. Shared queue between group members, re-multicast / broadcast play command, expand play and queue commands with some kind of @group?

skidoo23 commented 4 years ago

Just a second thought: if there is a larger number of satellites not all buffers filled at the same time. Some kind of agreement between players necessary. Nothing near low latency.

@avuton: please give synced multicasting a second thought.