Syncplay / syncplay

Client/server to synchronize media playback on mpv/VLC/MPC-HC/MPC-BE on many computers
http://syncplay.pl/
Apache License 2.0
2.11k stars 214 forks source link

Connectivity problems #414

Closed shekelboi closed 3 years ago

shekelboi commented 3 years ago

My girlfriend is from Indonesia and I'm from Hungary and lately, we experience connectivity problems while using Syncplay. It seems to me that the issue is on my girlfriend's side. While pinging the servers of Syncplay from her laptop, the request times out sometimes. image The problem doesn't occur in case of other French servers in fact, in most cases the latency is significantly less. image

My issue is not even with the latency on its own, even half a second is still okay, I believe. The problem is that while using Syncplay the problem randomly says that she left then reconnects her. I don't think she has connection issues since while using Anydesk I didn't experience any problem and I even ran a ping test online to different web servers around the world and her connection seemed to be very stable. Speed isn't a problem either, it's around 10 Mbps but for a program like Syncplay of course this should be more than enough.

My assumption was that there is a timeout set somewhere in the program, as for how long the server should wait for a response from the participants and/or how many consecutive failed pings/responses should cause the program to remove the participant.

I didn't manage to find it in the source code, if it's set inside the program. If it is, then I think there are two main options to fix issue:

  1. Decrease the strictness of connectivity check (increasing timeout and tolerance for failed responses)
  2. Make the above mentioned options customizable by the user somewhere in the settings.
Et0h commented 3 years ago

There are some complexities which explain why we have Syncplay as strict as it is about its connectivity checks and why we haven't already made changing this strictness a feature. Three inter-related issues immediately come to mind:

  1. If there is a temporary disconnection, the sooner this is detected the sooner the user can reconnect.
  2. For the 'pause if someone leaves' feature to work well it is necessary for disconnects to be detected quickly (and consistently).
  3. Changing the strictness on the client would not be enough because the user would still likely be disconnected from the server, and handling multiple levels of strictness on the server side adds complexity to the server.

If for some reason there is poor connectivity with the public servers then you could try hosting your own private server.

If you really wanted to, you could run your own custom server and clients with a higher value for PROTOCOL_TIMEOUT in constants.py. I have never tried this, so can't say what unintended impacts it might cause.

shekelboi commented 3 years ago

Thanks a lot for your input @Et0h, thankfully last time we tried Syncing videos again (yesterday) I didn't encounter the issue anymore, hopefully it stays like this if not I will take your advice 👍

I will close the issue now since it seems like increasing the timeout likely wouldn't be enough to handle the issue and might even cause other problems.