On Wed, Sep 13, 2023 at 05:09:04PM +0000, Maciek Machnikowski wrote: > Implement auto mode for frequency setting. In this mode the tool > will measure the frequency difference between PHC and CLOCK_REALTIME > and apply the correction to the PHC to match the system clock.
... > + /* Try sysoff first */ > + method = sysoff_probe(fd, N_SAMPLES); > + if (method >= 0) { > + if (sysoff_measure(fd, method, N_SAMPLES, > + &t1_sys_offset, > + &t1_sys_ts, &t1_delay)) { > + return -1; > + } > + > + sleep(1); This measurement interval is WAY too short. The time stamp error will spoil the syntonization. > + if (sysoff_measure(fd, method, N_SAMPLES, > + &t2_sys_offset, > + &t2_sys_ts, &t2_delay)) { > + return -1; > + } > + > + sys_diff = t2_sys_ts - t1_sys_ts; > + clk_diff = t2_sys_offset - t1_sys_offset; > + ppb += (1e9 - ppb) * ((double)clk_diff / > (double)sys_diff); Thanks, Richard _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel