How to covert TSC SOF to UTC time

Continuing the discussion from Correct way to correlate TSC to PTP to convert TSC SOF to UTC time:

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.10.0
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
2.1.0
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Issue Description
Hi i’m still wondering is there any other way to convert TSC SOF to UTC time, thanks!

Dear @zhaoming.ge,
Is it like you want to sync camera timestamp and system time?

Hi @SivaRamaKrishnaNV
Thanks for your fast reply, you’re right, that’s what i wanted.

You can look at the problems I raised, it seems that there are bugs, can not be solved.

You can add wechat communication: 18667105980

1 Like

hi @SivaRamaKrishnaNV is there any update? thanks!

I notice some issues when trying to sync TSC to system time. I am investigating it and update you.

Hi @SivaRamaKrishnaNV Thanks for your reply, please @ me if there’s any update.

Dear @zhaoming.ge ,
Could you share the date command output?
Also, please share below values your sample.

dwImageTimestamps imageTimestamps{};
dwSensorCamera_getImageTimestamps(&imageTimestamps, frame[i]);
                dwTime_t TSCEOFtime = imageTimestamps.tscEofTimestampUs;
dwContext_getCurrentTime(&dw_ts, m_context);
clock_gettime(CLOCK_REALTIME, &sys_ts);
int64_t sys_time = static_cast<int64_t>(sys_ts.tv_sec * 1000000 + sys_ts.tv_nsec / 1000);

 std::cout << " dwContextTimestamp : " << dw_ts << " sys-realclok : "<<sys_time << dwSensorCamera_getImageTimestamps.EOFtime "<< EOFtime >> std::endl;

Hi @SivaRamaKrishnaNV , i’m really appreciate your reply, but i’m not using dw API, i’m using nvsipl_camera and imageMetaData API to get FrameTimestamp, i’m figuring out how to convert frameCaptureTSC and frameCaptureStartTSC to system time with a reliable way, is ther any methods to do it ? thanks !

hi @SivaRamaKrishnaNV , is there any update? thanks ~

Hi @zhaoming.ge ,
Direct conversion to system time is not possible in nvsipl_camera.
How about getting TSC timestamp currently and system timestamp and then map with difference to every TSC timestamp obtained from nvsipl_camera. You can use nvpGetTimeMark to get TSC timestamp. Please see

Hi @SivaRamaKrishnaNV
thanks for your reply and solution, it worked on my machine. thank you so much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.