-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add high accuracy sync ? #18
Comments
The current implemented syncing algorithm is described here: https://github.com/enmasseio/timesync#algorithm Do you know of a better algorithm? That would be interesting. |
Maybe the PTP protocol ? I think the main difficulty is "The accuracy of the two-way method depends on the validity of the assumption that the path delay is symmetric", see : |
The PTP protocol looks the same as the protocol currently implemented (which is described here: http://www.mine-control.com/zack/timesync/timesync.html), but please correct me if I'm wrong. On top of that, that the current algorithm repeats calculating the offset and takes the median of it which should give more stable results. Could also be that I haven't implemented it correctly of course, please let me know if you see issues in the current implementation. There is indeed an issue when the internet speed is not symmetric. |
Indeed, it seemed to me that there was a strong similarity, however, I admit that the third point on the explanation of the algorithm (https://github.com/enmasseio/timesync#algorithm) lacked clarity ( certainly due to my lack of English). About the algorithm used here, I think that we must find a more stable / precise way in terms of the asymmetric delay of a request, unfortunately I have no solution ready, but perhaps to be based on the operation described here: https://www.perle.com/supportfiles/precision-time-protocol.shtml From what I understood, the idea is to refine the shift thanks to follow up and a repetition of queries to reduce the delay between the clocks. Do you think that if we combine the use of WebSocket plus the use of FollowUp and a set of queries allowing a refinement of delay would be a good idea? I would also add that for my need, it is not a problem if I have to wait x minutes (the first time) to have a sync within 100ms Finally, at most the presision of the timestamp is fine at best it is. By cons I have not yet found equivalent side FrontEnd. To see if there is no asctuce. For my need, it's not a problem to install a Node.JS instance to get precision down to nano |
I don't know whether using websockets would improve the performance, but that could definitely help. Would be interesting to do some experimenting with it of course! Would you be able to give syncing time via websockets a try? |
I can give it a try if I find some spare time. I want to sync music with it. How do you recommend to verify accuracy? I mean, how can you check if it is really better and how much precision you really have? |
that would be great
That's an interesting question. You can't really check that by connecting two devices via internet, because the variable latencies would introduce measurement errors. If you're doing something with sound, maybe you can have two devices alternately make a ticking noise once per two seconds, and have a third device listen and compare the delay between the ticks from the different sources :D |
Hello, In the meantime here is an article which explains why I think to gain a better precision with the WebSocket (of course, I know that the nature of the Internet network makes that one will not be able to have a stable precision). Watch the part: Why Websocket and Not HTTP? |
Thanks for sharing @darkterra |
Hi ! I should be able to start working again on the project which asks me to have a great precision, so I would try to give a try with WebSocket and timesync :) |
cool, I'm curious to hear the results! |
What I ended up doing to measure the sync precision is to display a clock on a browser in 2 different devices, film both screens, and compare frame by frame the difference between both clocks. |
That makes sense @canda, thanks for the update. |
Hi,
is it possible to add an option to have a synchronization with a high precision, kind real time ?
Somme time I have less than 100ms between my differents clients, and on the next sync I have more than 600ms.
I need to play different part of video on different glued screen. Same thing when I need to play a set of images
Thank in advance
The text was updated successfully, but these errors were encountered: