I am looking for the value of the offset of the RT Clock used by the camera subsystem to assign the SoF and EoF timestamps. In Jetpack <= 5, it was in /sys/devices/system/clocksource/clocksources0/offset_n but in Jetpack 6, it is not longer there.
Another reason is that subtracting the SoF by the offset_ns is greater than the CLOCK_MONOTONIC_RAW of the system.
I am getting the SoF from consumerFrameInfo->frameSoFTime in the consumer_thread in gstnvarguscamerasrc.cpp. I am getting the CLOCK_MONOTONIC_RAW using clock_gettime (CLOCK_MONOTONIC_RAW, &vs_time);
To the best of my knowledge, to get the SoF relative to CLOCK_MONOTONIC_RAW, we need to apply the following equation:
SoF = sof_tsc - offset_ns
Is it possible I am misinterpreting something?
Thanks for your kindness and I appreciate your support.
For JP5 , the offset_ns in sysnode is calculated during system boot , After calculation, it is a fixed value. you can check the code in kernel-5.10/kernel/time/timekeeping.c
For JP6 , The API provided in last comment is calculated dynamically.
I have tested that the dynamic range is not very large: