Multiple GMSL camera connection order for driveworks samples

Hi,

I run sample_lane_detection and sample_drivenet among driveworks samples in drive px2 with gmsl camera.

The camera type is ar0231-rccb-bae-sf3324 and it is two.

I connected the camera to the 0,1 index of A group and successfully executed sample_drivenetNcamera and sample_camera_multiple_gmsl.

However, it was not possible to execute sample_lane_detection and sample_drivenet with each camera.

The command is:

-./sample_lane_detection --input-type = camera --camera-index = 0
-./sample_drivenet --input-type = camera --camera-index = 1

Error is as follows.

nvidia@tegra-ubuntu:/usr/local/driveworks/bin$ ./sample_drivenet --input-type=camera --camera-index=1

[18-3-2020 20:9:10] Initialize DriveWorks SDK v1.2.400

[18-3-2020 20:9:10] Release build with GNU 4.9.4 from v1.2.0-rc11-0-ga7f5475 against Vibrante PDK v5.0.10.3

[18-3-2020 20:9:10] Platform: Detected Drive PX2 - Tegra A

[18-3-2020 20:9:10] TimeSource: monotonic epoch time offset is 1584529615544665

[18-3-2020 20:9:10] TimeSource: PTP ioctl returned error. Synchronized time will not be available.

[18-3-2020 20:9:10] TimeSource: Could not detect valid PTP time source at ‘eth0’. Fallback to CLOCK_MONOTONIC.

[18-3-2020 20:9:10] Platform: number of GPU devices detected 2

[18-3-2020 20:9:10] Platform: currently selected GPU device discrete ID 0

[18-3-2020 20:9:10] SDK: Resources mounted from …/./data/resources

[18-3-2020 20:9:10] SDK: Create NvMediaDevice

[18-3-2020 20:9:10] SDK: Create NvMediaIPPManager

[18-3-2020 20:9:10] SDK: use EGL display as provided

[18-3-2020 20:9:10] SensorFactory::createSensor() -> camera.gmsl, camera-type=ar0231-rccb-bae-sf3324,csi-port=a,slave=0,serialize=false,output-format=raw,camera-count=4,camera-mask=0010

[18-3-2020 20:9:10] CameraGMSL: required FPS = 30, resolution = 1920x1208

iscRootDevOpen: can’t open /dev/isc-mgr.7.a - Device or resource busy

NvMediaISCRootDeviceCreate: Unable to open root device

nvmedia: ERROR: Init: Failed to create NvMedia ISC root device

[18-3-2020 20:9:10] Driveworks exception thrown: DW_SAL_CANNOT_CREATE_SENSOR: CameraGMSL: cannot connect to camera

terminate called after throwing an instance of ‘std::runtime_error’

what(): [2020-03-18 20:09:10] DW Error DW_SAL_CANNOT_CREATE_SENSOR executing DW function:

dwSAL_createSensor(&m_sensor, params, m_sal)

at /builds/driveav/dw/sdk/samples/framework/SimpleCamera.cpp:51

Aborted (core dumped)

The same error occurs when changing the camera index.
However, if the camera is connected to A group 0 index and B group 0 index, it works well.

I refer to https://docs.nvidia.com/drive/active/5.0.10.3L/nvvib_docs/index.html#page/NVIDIA%20DRIVE%20Linux%20SDK%20Development%20Guide%2FConfiguration%2Fcamera_setup_dpx.html%23wwpID0E0YD0HA , 2 cameras are connected to A group 0 and 1 index. (A group 0,1,2,3 order)

I would like to know in what order to connect the camera to drive px2.

Dear @763k357,
The camera connection order in each port is 0->1->2->3. It is a known issue with camera-index value in DW samples. If the sample uses single camera, it reads frames from index =0 irrespective of any index value you mention. So please connect camera to index 0 and use right port value in the sample parameter.
In your case, sample_drivenet is expected to fail as it reads frames from index 0 even though you mention camera-index=1.

Hi,

But when I connected the camera to the 0,1 index of A group, and executed a sample using a single camera (e.g sample_lane_detection) using camera-index = 1, it worked fine. (Then, when running another sample using index 0, the above error appeared)

Then, when running dw samples using a single camera, is it necessary to connect to the 0 indices of A, B, and C groups?

Dear @763k357,
Yes. You need to connect camera to 0 index for single camera.
Did you run the applications one by one or in parallel?

Hi,

one by one
And when I connected the camera to index 1 instead of index 0, the sample using a single camera (e.g sample_lane_detection) worked well.

The command I executed is as follows

$ ./sample_lane_detection --input-type = camera --camera-index = 1