On Sat, Sep 12, 2020 at 05:28:46PM +0530, Jairaj Solanki wrote:
> Hello Vladimir,
>
> In this log as you said :
>
> "
> ts2phc[47236.294]: /dev/ptp1 extts index 0 at 1597801627.000000005 corr 0
> src 1597801627.124054367 diff 5
> ts2phc[47236.294]: /dev/ptp1 master offset          5 s2 freq   +1527
> ts2phc[47237.233]: /dev/ptp1 extts index 0 at 1597801628.000000008 corr 0
> src 1597801628.62638535 diff 8
> ts2phc[47237.233]: /dev/ptp1 master offset          8 s2 freq   +1532
> ts2phc[47238.704]: /dev/ptp1 extts index 0 at 1597801629.000000006 corr 0
> src 1597801630.534159628 diff -999999994
> ts2phc[47238.704]: /dev/ptp1 master offset -999999994 s2 freq -32767999
> ts2phc[47239.243]: /dev/ptp1 extts index 0 at 1597801630.015516222 corr 0
> src 1597801630.72969671 diff 15516222
> ts2phc[47239.243]: /dev/ptp1 master offset   15516222 s2 freq +15517748
> ts2phc[47240.230]: /dev/ptp1 extts index 0 at 1597801631.002506410 corr 0
> src 1597801631.59684682 diff 2506410
> ts2phc[47240.230]: /dev/ptp1 master offset    2506410 s2 freq +7162803
>
> The CLOCK_MONOTONIC in the output of ts2phc increments normally.
> The extts events increment normally.
> The source timestamp jumps 1.907774278 seconds, then 0.195537082
> seconds. That is the problem. "
>
> In the function  " ts2phc_slave_offset" in ts2phc_slave.c :
> below lines are probably causing this issue.
>
>       if (source_ts.tv_nsec > 500000000) {
>               source_ts.tv_sec++;
>       }
>
> What is your view on this?

No, I don't think those lines are _causing_ the issue. That is "garbage
in, garbage out" type of code. It is an approximation written with a
certain assumption in mind, which clearly does not hold true in this
case.

You see, the problem seems to be that your use case isn't adequate for
the generic PPS master (which, maybe, instead of "generic" should have
been called "last resort master"). The "source" timestamps are supposed
to be representative of the PPS emmiter device's clock, at the time of
the pulses. However, in the case of a "generic" master, those source
timestamps are taken from the local system clock. So that is a huge
assumption right there, that the system clock is already in sync with
the very source of time that we're trying to synchronize the system to.
I am not completely certain what is the use case for a generic PPS
master code, but if you are able to parse NMEA from the GPS, please try
to do so.

Thanks,
-Vladimir


_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to