How to get camera EOF timestamp with ptp time domain on Drive Thor?

DRIVE OS Version: 7.0.3.0-0010
HW Board Variate: p3960-10-sw03
Issue Description:
testing nvsipl_camera example

1.when capture CLOCK_MONOTONIC timestamp on event “NOTIF_INFO_ICP_PROCESSING_DONE”, the timestamp is 8~9 seconds earlier than oNotificationData.frameCaptureTSC, how is this possible? where come this 8~9 seconds gap?

CODE:

LOG:

nvsipl_camera: Pipeline: 10, NOTIF_INFO_ICP_PROCESSING_DONE at OnEvent():550
sensor[10] ICP TS:277294272412-277285835174
nvsipl_camera: Pipeline: 10, NOTIF_INFO_ICP_PROCESSING_DONE at OnEvent():550
sensor[10] ICP TS:277294305724-277285868476
nvsipl_camera: Pipeline: 10, NOTIF_INFO_ICP_PROCESSING_DONE at OnEvent():550
sensor[10] ICP TS:277294339058-277285901814
nvsipl_camera: Pipeline: 10, NOTIF_INFO_ICP_PROCESSING_DONE at OnEvent():550
sensor[10] ICP TS:277294372391-277285935143

2.when testing with nvsipl_camera example, I can only get frameCaptureTSC in TSC time domain in image metadata, even when ptp4l is already synced with grand master, how can I get frame timestamp in PTP time domain?

Dear @snow.yin ,
The observed 8–9 second gap between CLOCK_MONOTONIC and frameCaptureTSC timestamps in DRIVE AGX Thor testing is due to these clocks originating from different domains. The monotonic clock starts counting from kernel initialization, while the TSC (Time Stamp Counter) used by frameCaptureTSC starts from SoC power-on, resulting in a stable offset

nvsipl_camera supports TSC timestamps . The ptp timestamp can be obtained using nvpps with CTL_ID:GETTIMESTAMP.(Tegra Time Sync — NVIDIA DriveOS 7.0.3 Linux SDK Developer Guide)

Thanks a lot for your help.
could you please clarify two more doubt,

  1. how do I get current time of TSC CLOCK?
    -I tried all 11 clocks defined by time.h, no one close to the TSC.
    -how do I check latency ? for example compare the “frameCaptureTSC” captured by NVSIPL and my event notification captured timestamp?
    -when SIPL buffer shared to 2D/ENC, different type of consumer can not easily check their latency by fetching INvSIPLClient::ImageMetaData::frameCaptureTSC

2.I can in user space APP get the current PTP time from “/dev/ptpX”, how do I convert the TSC frameCaptureTSC to an accurate PTP timestamp?
-I can capture one base on the ICP event, but the concern is this may not be accurate since it’s on ARM and affected by Linux scheduling and CPU-loading.
-will the NVSIPL support PTP time in future like ORIN? like it mentioned in here: What is the relationship between TSC and PTP timestamp - #2 by SivaRamaKrishnaNV

To get TSC clock, Could you check NvpGetTimeMark, NvpConvertTimeMarkToNsec Functions — NVIDIA DriveOS 7.0.3 Linux SDK Developer Guide.
Also, could you take ca look at nvpps_test sample code to compare tsc, ptp timestamp.

You can find the offset between TSC timestamp and PTP and apply the offset to each timestamp to PTP timestamp.