For systems with Ethernet adapters that do not support PTP (Precision Time Protocol), Chrony offers a practical alternative for clock synchronization. This method ensures consistent time alignment across systems required by the software genlock feature.
However, it is important to note that Chrony-based synchronization may not achieve the same level of accuracy as hardware-assisted PTP, as it relies entirely on software. Its precision can be affected by factors such as network latency, interface speed, and overall system load. For applications requiring tight synchronization margins, PTP remains the preferred option when supported.
-
Install Chrony:
sudo apt install chrony
-
Edit the configuration file /etc/chrony/chrony.conf:
# Allow clients from the subnet 192.168.1.0 allow 192.168.1.0/24 # # (Optional) Bind to a specific network interface binddevice <ethernet_interface> hwtimestamp <ethernet_interface> local stratum 8 # Make sure primary Chrony doesn't sync with any external pool/server. Disable/remove all of them # pool pool.ntp.org iburst # server corp.intel.com iburst -
Restart the Chrony service:
sudo systemctl restart chrony
-
(If a firewall is active) Allow NTP traffic:
sudo ufw allow 123/udp
-
Install Chrony:
sudo apt install chrony
-
Edit the configuration file /etc/chrony/chrony.conf: Replace any existing pool or server entries with:
server <primary_system_IP> iburst minpoll 1 maxpoll 1 binddevice <ethernet_interface> hwtimestamp <ethernet_interface> -
Restart the Chrony service:
sudo systemctl restart chrony
-
(If a firewall is active) Allow NTP traffic:
sudo ufw allow 123/udp
Use the following commands to verify synchronization status:
$ chronyc tracking
Reference ID : 7F7F0101 ()
Stratum : 8
$ chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
The reference ID in the () should be blank and sources list should be empty.
The output should list the primary system as the time source (Assuming secondary system address is 192.168.1.100):
$ chronyc tracking
Reference ID : C0A80A02 (192.168.1.4)
Stratum : 9
$ chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 192.168.1.4 8 9 377 354 +7943ns[+7967ns] +/- 45usThe reference ID in the () should point to primary IP address and sources list should only have primary IP entry. The ^* symbol indicates that synchronization is active and successful.
Chrony should be run with real-time scheduling policy (SCHED_FIFO) and high priority. On both primary and secondary run
$ sudo systemctl edit chronyAdd the following:
### Editing /etc/systemd/system/chrony.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
[Service]
Nice=-20
CPUSchedulingPolicy=FIFO
### Lines below this comment will be discarded
Then reload and restart:
$ sudo systemctl daemon-reexec
$ sudo systemctl restart chrony