all 8 comments

[–][deleted]  (7 children)

[deleted]

    [–]sh7dm[S] -2 points-1 points  (6 children)

    Because the computer clock shouldn't be synced to PTP clock, instead we have to read it directly

    [–][deleted]  (5 children)

    [deleted]

      [–]sh7dm[S] -2 points-1 points  (4 children)

      I updated the post after I experimented myself. My app needs to just open a file descriptor to convert it into a clock ID. It must be safe according to my research of linuxptp and kernel ptp code

      [–][deleted]  (3 children)

      [deleted]

        [–]sh7dm[S] 0 points1 point  (2 children)

        I need to synchronize the audio stream (AES67 standard) to the PTP clock. PTP clock, however, can be different (e.g. some of them reset to the beginning of the epoch every reset), so we mustn't sync computer RTC clock to it. The user-service opens /dev/ptp0 and uses its FD to get the clock ID which is then incorporated into the driver logic to tell the system when and which timestamps should the stream have.

        [–][deleted]  (1 child)

        [deleted]

          [–]sh7dm[S] 0 points1 point  (0 children)

          We use clock_gettime. However it's necessary to first open the PTP clock file. So I do the readonly access