Genlock Pis on a network

Hi
I wonder if anybody looked into the ability to sync the video out on the PIs thru LAN or other means
I understand the precision needed (<40ms) is pretty high for a network-based sync signal, but NTP should be under a millisecond, and its already used in info-beamer, if I’m not mistaken. So what is needed is the locking of the video out sync to the NTP signal, then the ability to offset it. Another, more precise but probably cumbersome way, would be to use a GPIO to input a sync signal (blackburst or trilevel sync, or just Vclk)

I have made a few searches, and found this thread:


https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=218571&p=1343555&hilit=genlock#p1343555

it seems they have found a way to change the PLL driving the HDMI clock, therefore creating sync in a device. What do you think?

Interesting link, although to be honest I’m not entirely sure what I’m looking at, as I’m not really a hardware person. It seems they need the exact clock rate to avoid tearing or other effects. So they clock the HDMI output rate to multiple of the incoming video signal. Is that correct?

As for syncing: There’s multiple way to sync and some can be combined:

  • You should obviously use NTP, preferably a local service with low latency, so the sync results in a somewhat precise time.
  • Optionally, an info-beamer device can be peer-to-peer (P2P) enabled and you can use P2P NTP syncing. Each device will open up its NTP port and neighboring devices will use each other (in an order determined by their IP addresses) to sync from each other. This might help if you otherwise don’t have a local NTP server, as they should all sync to the device with the “lowest” IP address.
  • Also optionally you can enable PTP. In tests, it seems it really only works on Ethernet, not WiFi. Using it, devices will usually be in perfect sync and it doesn’t make sense to also use P2P NTP in that case.

Now to the HDMI output. If you have displays with 60Hz, it means each generated output will take 16.6ms. If you power up two random displays and Pis, the maximum offset between each of them generating an output frame will be 8.3ms.

info-beamer can try to sync the vsync interval based on an already sync local time (using the methods above): Enable global vsync, and each Pi will slowly speed up or slow down its HDMI output (so for example 59.99Hz instead of 60Hz) until vsyncs across devices happen at roughly the same time. I’ve seen this working just recently when info-beamer was used to power different parts of a tiled LED wall.

I guess this should have the same effect as modifying the clock rate as linked in the github issue.

1 Like

The main point that the vsyncs of the displays happen ant the same time. NTPing or syncing the Pi won’t help if the video clock is free running (as it sometime is) and not locked to the device clock somehow. If you can tie the Vsync to any sort of clock we can sync those together (maybe to NTP), then it’s just a question of syncing this to an external source. But to start, having Vsync locked across the Pis would help, as we can then visually move the camera to this. You say this has been done?

It should be: If you use the [x] Enable global VSYNC option in the Advanced/Developer settings panel of the device config editor, the info-beamer process will slowly speed up for slow down the vsync interval so it converges to a common point in time across multiple Pis. This is done by calculating a target vsync timestamp across Pis based on the current system time and adjusting the HDMI clock slightly to move the vsync towards those timestamps.

Isnt this only in the hosted version? we use the standalone

Have a look at info-beamer -h. I think it’s INFOBEAMER_GLOBAL_VSYNC=1. The info-beamer version running on hosted is basically the same, so all features are also available in the standalone version.

1 Like