Libargus give different timestamps after setting up timesync

I am using jetson xavier AGX with 2 cameras and using libargus (with ISP) to get the frames from cameras. This is the code snippet I use to get the sensortimestamp for those frames.

+ UniqueObj<EGLStream::MetadataContainer> container(MetadataContainer::create(<replace EGLDisplay>, <replace EGLStream>);
+ IArgusCaptureMetadata *iArgusMeta = interface_cast<IArgusCaptureMetadata>(container.get());
+ if (!iArgusMeta)
+    ORIGINATE_ERROR("Failed to create Metadata Container");
+ CaptureMetadata *metadata = iArgusMeta->getMetadata();
+ ICaptureMetadata *iCaptureMeta = interface_cast<ICaptureMetadata>(metadata);
+ if (!iCaptureMeta)
+    ORIGINATE_ERROR("Unable to get Capture Metadata from frame");
+ uint64_t sensorTimeStamp = iCaptureMeta->getSensorTimestamp();

// On the first frame, print the information contained in the CUDA EGL frame structure.
if (frameID == 0)

I am using multiple xaviers to create my platform and all of those xaviers are time synced with ptp. I am seeing some strange issues in sensor timestamps with this.

  • Before I setup the ptp, this getSensorTimestamp() function gives me the monotonic time in seconds.

  • After setting up ptp, the same function starts giving me the uptime (which I can see at /proc/uptime).

I don’t exactly understand where does libargus gets the time from or which clock does it use. I have no idea how can I debug this also. I saw some other issues where people are talking about the not synced RTOS and system time also, which would be the next step I believe (after I resolve this). What can I do to debug this or set this thing correctly?

I already came across these things. My major question is how all of sudden it started giving me the process time instead of system time ?

Could be the configure cause the get time API change.