I have tried multiple variations and can not get ptp to keep offset from periodically spiking.
Today I tried this and got significantly higher offsets; but I’m going through a router and switch between the 2 computers.
Configuring PTP orin as source.
On source Orin
sudo ptp4l -i eno1 -m -4 -f /etc/linuxptp/ptp4l.conf
On sink
sudo ptp4l -i enp6s0f1 -m -s -4 -f /etc/linuxptp/ptp4l.conf
Synchronize System Times of Source and Sink
On source Orin
sudo phc2sys -s CLOCK_REALTIME -c enpo1 -m –w
On sink
sudo phc2sys -s enp6s0f1 -c CLOCK_REALTIME -m -w
Here are things I tried yesterday. Better results but still offset spikes
sudo phc2sys -s /dev/ptp0 -c eno1 -m -R 1000
sudo phc2sys -s CLOCK_REALTIME -c eno1 -O 0 -m -S 0.001 -f /etc/linuxptp/phc2sys.conf -R 1000
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -O 0 -m -S 0.001 -f /etc/linuxptp/phc2sys.conf -R 1
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME --step_threshold 0 --first_step_threshold 0 -m -w -R 1
37 s (ahead) expressed with a minus sign because we want the PHC time
subtracted before it is compared with CLOCK_REALTIME
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME
-O -37 \ # compensate TAI->UTC
–step_threshold 0
–first_step_threshold 1
-m -w -R 1
sudo systemctl disable --now chronyd ntpd systemd-timesyncd gpsd
sudo ptp4l -2 -i eno1 -m -f /etc/linuxptp/ptp4l.conf
in /etc/linuxptp/ptp4l.conf
[global]
priority1 10
clockClass 6
utc_offset 37
network_transport L2
time_stamping hardware
tsproc_mode filter
delay_filter running_median
delay_filter_length 5
sudo ptp4l -2 -i MGBE -m -l 6 -f /etc/linuxptp/ptp4l.conf
2. Start phc2sys AFTER ptp4l reports “MASTER”
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME --first_step_threshold 1 --step_threshold 0.0002 -m -w -R 1
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME --first_step_threshold 1 --step_threshold 0.0002 -m -w -R 1
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME --first_step_threshold 1 --step_threshold 0.0001 -m -w -R 1
=====================================
sudo ptp4l -2 -i eno1 -m -f /etc/linuxptp/ptp4l.conf
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME --first_step_threshold 1 --step_threshold 0.0002 -m -w -R 1
Synchronizing the System Clock
The System clock synchronization step is mandatory only for those systems where applications rely on system clock to schedule traffic or present data (such as AVTP plugins from ALSA and GStreamer frameworks).
PHC time is set in TAI coordinate [1] while System clock time is set in UTC coordinate [2]. To ensure System clocks (CLOCK_REALTIME and CLOCK_TAI) are properly set, configure the UTC-TAI offset in the system. This is done by a run-time option from ptp4l that is set via pmc utility tool as shown below.
sudo pmc -u -b 0 -t 1 “SET GRANDMASTER_SETTINGS_NP clockClass 248
clockAccuracy 0xfe offsetScaledLogVariance 0xffff
currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1
ptpTimescale 1 timeTraceable 1 frequencyTraceable 0
timeSource 0xa0”
sudo ptp4l -2 -i eno1 -m -f /usr/share/doc/linuxptp/configs/gPTP.cfg
sudo phc2sys -s eno1 -c CLOCK_REALTIME --step_threshold=1 --transportSpecific=1 -w -m
sudo phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -O 0 -q -m -S 1000 --first_step_threshold 1 --step_threshold 0.0001 -R 1 -E linreg
Download, compile and run https://tsn.readthedocs.io/_downloads/f329e8dec804247b1dbb5835bd949e6f/check_clocks.c
gcc -o check_clocks check_clocks.c
sudo ./check_clocks -d eno1 -v