Good evening,
I have a setup, where two screens (4k and HD) have to play videos synchronized.
I have two minix neo u9-h with libreelec 8.2.5 from wrxstasy.
Both players are conneced to a router via ethernet.
On both boxes I have a small python script (/storage/.kodi/userdata/autoexec.py) that connects to a tcp port,
which is created on an esp8266, connected via wifi to the router.
Both players have the exactly same settings.
The esp8266 sends a trigger message to the tcp port which in the python script starts a video via:
xbmc.Player().play(path_to_video)
Now my problem is, that both videos start with a different latency, which is around 1500ms. for one player and 200ms for the other.
I already tried to synchronize the videos by addings a fixed delay,
but this is hard to measure and not very beautiful.
I'm not even sure if it's constant.
Changing the video content seems to change the delay.
Moving the wifi device around (increasing the distance to the router) seems to change the delay slightly.
However I doubt that writing a simple message to a tcp port can result in such long latency.
What is causing the different latency?
1) xbmc.Plyer().play() --> it seems the most direct way to controll kodi. Could it cause latency i.e. because of internal polling?
2) different video content (HD, 4K)? Can switchwing from the GUI's HD resolution to the 4k video resolution cause latency?
3) low wifi on the esp8266? --> I measured the time between and the esp8266 needs 1.5 ms (!) to send the messages to the tcp ports. So I guess it should be OK.
What else could be the reason? Any experiences with similiar setups?
Many Greetings, Himi