Hi everyone,
While developing a PTP slave using the Linux PHC, I noticed, that everytime I call clock_gettime with the PHC ID, the time on the PHC jumps or at least changes by around 200-300ns. I noticed this, because I have implemented an algorithm reading the PHC time ten times in a row to find a best possible assumption of the offset to the system time (as done in Ohly's timecompare). The second before the ten readings, my measured PTP offset is a few ns, while directly after the readings it is around 2.5us. The offset is stable below 200ns when not reading the PHC and leaving the system time unsynchronized.
While trying to find the mistake in my implementation, I found out that the same thing happens if I use linuxptp and phc2sys. As long as phc2sys is not running, linuxptp reports a pretty stable offset below 200ns, but as soon as I start phc2sys, the offset increases to about 1us for a short time and is corrected by linuxptp a few seconds later. Stopping phc2sys again results in the same behaviour, now with -1us offset. From what I have seen in the code of phc2sys, it reads the PHC only five times in a row, which explains that the offset is only 1us, compared to my 2.5us.
My conclusion is, that each call of clock_gettime with the PHC ID, delays the time of the clock by around 200-300ns. Is this a bug or expected behaviour? Or am I doing something wrong?
Thanks in advance for your help!
--
Mit freundlichen Grüßen / With kind regards
Thomas Behn (mobile)
Software Development
MEINBERG Funkuhren GmbH & Co. KG
Lange Wand 9
D-31812 Bad Pyrmont, Germany
Phone: +49 (0)5281 9309-438
Fax: +49 (0)5281 9309-230
Amtsgericht Hannover 17HRA 100322
Managing Directors: Günter Meinberg, Werner Meinberg, Andre Hartmann, Heiko Gerstung
Email: thomas.b...@meinberg.de
Check out our free PTP capturing and analysis tool PTP Track Hound:
MEINBERG - Solutions for Time and Frequency Synchronization
_______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel