PDA

View Full Version : How does the synchronisation of players work?



cadfish
2012-11-30, 01:59
For a while I'm asking myself, how the synchronisation of separate players actually works.

As far as I know, IP protocol exchanges messages - and the time of travel of the various packages can vary. So the only way I can think of, is that the players buffer a reasonable amount of data, and are all scheduled to start playing a track at a specific point in time (in the not too far future): e.g. "Start playing the following data at 10:00:00h GMT". But this would only work, if the player clocks are 100% synced. And now I'm back at start: how can LMS make sure the player clocks ARE synced, given the comunication is package based? It may be based on the roundtrip time (as can be watched with ping): if roundtrip time for one player is 20ms longer than for another, then LML could set the current time on this player to a "10ms later value" as compared to the other; so that the time of arrival of the message and the content do match. This would result in (kind of) synced clocks of the players. Asking the players for their time, minus half of the roundtrip time (from issueing the query until receiving the answer) should give the same time for all players if all goes well ... But as time of travel can vary between messages and between forth and back, the success of this method is not guaranteed, plus - which makes it worse - can not be verified.

Am I completely wrong here - do they use a completely different approach? Is it even a Logitech secret or is it a well known standard approach?

Any ideas?

I hope this is not already discussed in another thread I missed.


G´┐Żnther

lrossouw
2012-11-30, 02:29
In terms of sync, technically, I don't know much but there is tech to sync times between devices via IP. ntp time servers are an example here. This is how your computer can set it's clock to the time servers via the internet. These work over the open internet where latency is longer than your local lan. Over your local wifi/lan it should be easier to get clocks syncd.

I guess once the concept of a common clock the rest is easier. Though I guess the clocks could drift so something needs to continue to keep the clocks in sync.

If you are technically minded you can look at the code but I don't know where to start.
http://svn.slimdevices.com/repos/slim/7.8/trunk/

lrossouw
2012-11-30, 02:43
Was curious myself:
Read here: http://forums.slimdevices.com/showthread.php?93330-Hardware-mods-to-perfectly-sync-two-(or-more)-SBs/page2

lrossouw
2012-11-30, 02:58
Even better source: http://forums.slimdevices.com/showthread.php?34535-Status-update-%96-synchronization-work

cadfish
2012-11-30, 04:45
Thanks a lot for the fast response ..

Very interesting - appaerently I was to lazy to find it myself ...

I am aware of NTP but somehow had the idea, that this would not be accurate enough. I thought this is just for syncing usual "clocks" with an accuracy of at much sub-second level, which would not be good enough for synced audio playback. I'm surprised that NTP is accurate on ms level.

But from the thread you pointed me at, I learned, that my "approach" is conceptionally not so far, from how it really works

Thanks

bpa
2012-11-30, 05:43
I am aware of NTP but somehow had the idea, that this would not be accurate enough. I thought this is just for syncing usual "clocks" with an accuracy of at much sub-second level, which would not be good enough for synced audio playback. I'm surprised that NTP is accurate on ms level.

IIRC the hardware players have v. accurate clock and the sync protocol is more interested in comparing the differences in elapsed time (i.e. not current time) as measured by each player. One of the problem with software players on PC is that the PC clock was often not very accurate and so PC based softplayers often didn't sync very well.

It is very interesting to see what is actually happening when players are in sycn by enabling player.sync logging to INFO or DEBUG and see how the server and player adjust. Add in a softplayer such as SoftSqueeze (which I think doesn't have the latest sync protocol features) on a PC to see the larger adjustments being made.

bluegroper
2012-12-04, 01:34
How does the synchronisation of players work ?

It works REALLY nicely. :-)