Multi camera sync solution of multi Orin-X EVB

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
<Please provide details about your query/application pipeline/usecase/pictures here >

Error String
< Please provide just the error messages here >

Logs
Provide logs in text box instead of image

Please paste the complete application log here. If there are multiple logs, please use multiple text box

I answer the solution how I can synchronize multi camera between multi Orin-X EVB (for 2 orin-X EVB).

I know the multi camera are synchronized in single Orin-X EVB. I just guess the HW wire should be connected between 2 Orin-X EVB for FSYNC PWM.

Dear @chobr84,
How about syncing timestamps of two devkit via external grand master?

Dear @SivaRamaKrishnaNV,

We are using PTP to synchronize timestamp between 2 Orin-X EVB (p3710-010 SKU).

But this is for synchronization of system time. The point is synchronization of camera capture time. This synchronization is controlled by PWM in Soc as I know.

I am curious how I can connect sync of camera capture between 2(or multiple) Orin-X EVB.

Best Regards
Bongrae Cho

This require opening of devkit which voids warranty and need some additional info and support out of forum support.

You want to sync the camera timestamps of different orin devkit or make cameras to capture at same time?

Dear @SivaRamaKrishnaNV

I wanna make cameras to capture at same time exactly between different Orin-X EVB.

The timestamp was synchronized using PTP between 2 orin-X EVB. But I can’t control to capture at same time of different Orin-X.

Best Regards
Bongrae Cho

It is not possible to control triggering the control . Synchronizing the camera timestamps across the orin devkit is the recommended way to go.

Dear @SivaRamaKrishnaNV

I found the Camera Frame Synchronization of Camera Device Driver in SDK document.

I don’t know that will solve my problem exactly yet. I will try to apply this solution.

Best Regards
Bongrae Cho

@SivaRamaKrishnaNV

I got the solution to use API “cam_fsync_program_abs_start_value”. This API needs 2 parameters, one is camera group (0~3) and other is time of TSC clock as I know.

But It seems that doesn’t work correctly.

I got the PTP time(nanoseconds) and TSC clock and nanoseconds(to use API “NvpConvertTimeMarkToNsec”). Then I calculated offset between PTP time(current real time) and TSC time of nanoseconds.

Then start Time which is added 10 seconds from current PTP time removed under nanoseconds. It is easy to understand if you see the following codes.

uint64_t delayTime = 5000000000LU; // after 5s
uint64_t ptpTime{Time::CurrentTimeNanoSeconds()};
uint64_t tscClock = NvpGetTimeMark();
uint64_t tscTime = NvpConvertTimeMarkToNsec(tscClock);
int64_t offset = ptpTime - tscTime;

uint64_t startTime = ptpTime + delayTime - (ptpTime % 1000000000);
uint64_t startTSCClock = (startTime - offset) >> 5;

for (uint8_t n = 0; n < mvCameraGroupList.size(); n++)
{
    if (mvCameraGroupList.at(n)->mbEnableGroup == true)
    {
        cam_fsync_program_abs_start_value(n, startTSCClock);

.
.
.
.

I expected the first frame of camera will be fit to absolute time that I configured. But it didn’t.

Is any restricted condition for this feature?

Best Regards
Bongrae Cho

@SivaRamaKrishnaNV

I checked the state. The return value is CAM_FSYNC_GROUP_NOT_FOUND.
I thought the group ID means 0~ 3 (for four quad fakra connector). But reference annotation shows from MIN_GROUP_ID_DEFINED_IN_DT to MAX_GROUP_ID_DEFINED_IN_DT.

What is valid parameter for group ID for this API?

Best Regards
Bongrae Cho

I solved this issue from
The usage of cam_fsync_program_abs_start_value API to control camera fsync - DRIVE AGX Orin / DRIVE AGX Orin General - NVIDIA Developer Forums