Error Running Multiple Cameras Sample

Please provide the following info (check/uncheck the boxes after creating this topic):
Software Version
DRIVE OS Linux 5.2.6
DRIVE OS Linux 5.2.6 and DriveWorks 4.0
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other

Target Operating System
Linux
QNX
other

Hardware Platform
NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
1.7.1.8928
other

Host Machine Version
native Ubuntu 18.04
other

Hello,

we want to run the multiple camera sample. We connected three ar0231-rccb-bae-sf3325 cameras to the camera group A and four ar0231-rccb-bae-sf3324 cameras to camera group B.

However, when we run the following command
./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3325 --type-c=ar0231-rccb-bae-sf3324 --selector-mask=11101111
we get the following error:

Can you please help us resolve this issue?

Thank you very much in advance!

Dear @kn10,
Could you just connect 3 cameras to port A and check if there is any issue. Looks like camera port A is used by another process. Please restart the target and confirm.

Dear @SivaRamaKrishnaNV,

as you suggested I only connected 4 cameras to port A and tried it again. The following error still occurs:

I also restarted the target but it did not help with the issue.

How can I solve this problem?

Dear @kn10,
Could you confirm if you disconnected power supply to the board and restarted both Tegra A and Tegra B? Could you double check if any process is holding /dev/isc-mgr.0.a ? Do you see this issue with single camera as well? Also, please check connecting on other ports to see if the issue is specific to port A?

Dear @kn10,
Could you please attach the error logs in text format to be available in search for the community.

Hello,

I tried the solutions you suggested, but it did not work:

Yes, I disconnected the power supply and restarted both Tegra A and Tegra B. I did not help.

I still get the following errors:

When I connect three cameras and execute the following command, I get these errors:

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1110

When I connect the four cameras and execute the following, I also get errors:

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1111

However, when I connect two cameras and execute the following command, it works:

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1100

It seems like, that it only works when two cameras are connected. As soon as I connect more than two cameras, it does not work. Can you please help us with this issue, since it is urgent and we need the cameras to work?

Regarding the error logs:

How do I exactly attach the error logs?

How do I check this regarding /dev/isc-mgr.0.a?

No, I do not see this issue with a single camera. I also do not see this issue with two cameras. This issue only appears with three, four or more cameras.

Thank you in advance for your help.

I also connected the cameras to port, but we still have the same issue:

Hi @kn10

Please write application output to a file and copy it to your host system. Then you can upload or paste it onto the forum.

Please refer to Tegra A crashes, when using multiple cameras - #6 by AndrewKr. The developer verified that 9 cameras worked well with the sample application and the same version.

Please take three cameras and make sure each one works well sole. Then provide us the complete logs of both running with two works and running with three fails for our analysis.

Hi @VickNV

How do I write the application output to a file?
Does a tutorial for this exist?

Dear @kn10,
Please post the application logs(terminal output) as text message instead of images to be able to search by community.
As I understand, you do not see no issue when running 2 cameras on port A and connecting third camera is causing issue. Please confirm if you have connected to Green, red, blue wires when connecting 3 cameras?

Also, please check connecting two cameras to port A and other two cameras to port B and confirm if it works?

Hi @SivaRamaKrishnaNV,

Yes, that is true. With two cameras, the sample works fine. As soon as I connect the third camera, the sample fails.

Yes, I connected the three cameras to the green, red and blue wires.

Yes, I did. All cameras work fine.

The terminal output for the multiple camera sample with two cameras (this works!):

nvidia@tegra-ubuntu:/usr/local/driveworks/bin$ ./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1100
[23-05-2022 13:45:34] Platform: Detected DDPX - Tegra A
[23-05-2022 13:45:34] TimeSource: monotonic epoch time offset is 1653311597025532
[23-05-2022 13:45:34] PTP Time is available from NVPPS Driver
[23-05-2022 13:45:34] Platform: number of GPU devices detected 2
[23-05-2022 13:45:34] Platform: currently selected GPU device discrete ID 0
[23-05-2022 13:45:34] SDK: Resources mounted from .././data/
[23-05-2022 13:45:34] SDK: Create NvMediaDevice
[23-05-2022 13:45:34] SDK: use EGL display as provided
[23-05-2022 13:45:34] TimeSource: monotonic epoch time offset is 1653311597025532
[23-05-2022 13:45:34] PTP Time is available from NVPPS Driver
[23-05-2022 13:45:34] Initialize DriveWorks SDK v2.2.3136
[23-05-2022 13:45:34] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[23-05-2022 13:45:34] SensorFactory::createSensor() -> camera.gmsl, camera-group=a,camera-type=ar0231-rccb-bae-sf3324,camera-count=4,camera-mask=1100,slave=0
[23-05-2022 13:45:34] CameraGMSL: Couldn't set CameraGMSL setup thread sched params!
[23-05-2022 13:45:34] CameraGMSL: Create NvMediaIPPManager
[23-05-2022 13:45:34] CameraGMSL: required FPS = 30, resolution = 1920x1208
nvmedia isc: GetCameraPowerControlLevel: 936: Camera power control library: NVCCP
Max96712 Rev 2 detected!
MAX96712: Enable periodic AEQ on Link 0
MAX96712: Enable periodic AEQ on Link 1
MAX96705: Pre-emphasis set to 0xaa
Sensor AR0231 RCCB Rev7 detected!
Sensor AR0231 RCCB Rev7 detected!
[23-05-2022 13:45:35] CameraGMSL: default IPP event callback function set
Successfully initialized 2 cameras of type ar0231-rccb-bae-sf3324 in port a with resolution of 1920x1208 at framerate of 30.000000 FPS
Successfully started cameras in port a
[23-05-2022 13:45:35] Initialize DriveWorks VisualizationSDK v2.2.3136
[23-05-2022 13:45:35] Initialize DriveWorksGL SDK v2.2.3136
Total cameras 2
[23-05-2022 13:45:36] StreamConsumerGL: successfully initialized
window resized to 1200x800
[23-05-2022 13:45:36] CameraGMSL: Frame: 13 CaptureTimestamp: 1653313536192018 - ICP DROP in camera 1
[23-05-2022 13:45:36] CameraGMSL: Frame: 13 CaptureTimestamp: 1653313536192018 - ICP DROP in camera 0

The terminal output for the multiple camera sample with three cameras (gives error!):

nvidia@tegra-ubuntu:/usr/local/driveworks/bin$ ./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1110
[23-05-2022 13:50:50] Platform: Detected DDPX - Tegra A
[23-05-2022 13:50:50] TimeSource: monotonic epoch time offset is 1653313713014407
[23-05-2022 13:50:50] PTP Time is available from NVPPS Driver
[23-05-2022 13:50:50] Platform: number of GPU devices detected 2
[23-05-2022 13:50:50] Platform: currently selected GPU device discrete ID 0
[23-05-2022 13:50:50] SDK: Resources mounted from .././data/
[23-05-2022 13:50:50] SDK: Create NvMediaDevice
[23-05-2022 13:50:50] SDK: use EGL display as provided
[23-05-2022 13:50:50] TimeSource: monotonic epoch time offset is 1653313713014406
[23-05-2022 13:50:50] PTP Time is available from NVPPS Driver
[23-05-2022 13:50:50] Initialize DriveWorks SDK v2.2.3136
[23-05-2022 13:50:50] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[23-05-2022 13:50:50] SensorFactory::createSensor() -> camera.gmsl, camera-group=a,camera-type=ar0231-rccb-bae-sf3324,camera-count=4,camera-mask=1110,slave=0
[23-05-2022 13:50:50] CameraGMSL: Couldn't set CameraGMSL setup thread sched params!
[23-05-2022 13:50:50] CameraGMSL: Create NvMediaIPPManager
[23-05-2022 13:50:50] CameraGMSL: required FPS = 30, resolution = 1920x1208
iscRootDevOpen: can't open /dev/isc-mgr.0.a - Device or resource busy
NvMediaISCRootDeviceCreate: Unable to open root device
nvmedia: ERROR: Init: Failed to create NvMedia ISC root device
[23-05-2022 13:50:50] Driveworks exception thrown: DW_SAL_CANNOT_CREATE_SENSOR: CameraGMSL: cannot connect to camera

terminate called after throwing an instance of 'std::runtime_error'
  what():  [2022-05-23 13:50:50] DW Error DW_SAL_CANNOT_CREATE_SENSOR executing DW function:
 dwSAL_createSensor(&m_camera[portID], params, m_sal)
 at /dvs/git/dirty/gitlab-master_av/dw/sdk/samples/sensors/camera/camera_multiple_gmsl/main.cpp:147
Aborted (core dumped)

Did I correctly start the sample with the followng command or am I missing something? (I used three ar0231-rccb-bae-sf3324 cameras connected to the green, red and blue wires):

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1110

Your help would be appreciated, since we need a working setup with multiple cameras.

Dear @kn10,
As asked, could you check connecting 2 cameras to port A and 2 cameras to port B. Does that work for your use case?

Also, please check killing DRIVE Hub as well (/usr/local/service-framework/scripts/kill.sh) .

Please refer to the below from the document and try with --selector-mask=0111.
But I have no idea why your two-camera command works.

@kn10 did you solve the problem?

Dear @VickNV,

I am still dealing with the problem and it is getting quite frustrating.

No, this does not work. I executed the following command:

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --type-b=ar0231-rccb-bae-sf3324 --selector-mask=11001100

I got these errors:

nvidia@tegra-ubuntu:/usr/local/driveworks/bin$ ./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --type-b=ar0231-rccb-bae-sf3324 --selector-mask=11001100
[31-05-2022 14:41:24] Platform: Detected DDPX - Tegra A
[31-05-2022 14:41:24] TimeSource: monotonic epoch time offset is 1653997871046816
[31-05-2022 14:41:24] PTP Time is available from NVPPS Driver
[31-05-2022 14:41:24] Platform: number of GPU devices detected 2
[31-05-2022 14:41:24] Platform: currently selected GPU device discrete ID 0
[31-05-2022 14:41:24] SDK: Resources mounted from .././data/
[31-05-2022 14:41:24] SDK: Create NvMediaDevice
[31-05-2022 14:41:24] SDK: use EGL display as provided
[31-05-2022 14:41:24] TimeSource: monotonic epoch time offset is 1653997871046816
[31-05-2022 14:41:24] PTP Time is available from NVPPS Driver
[31-05-2022 14:41:24] Initialize DriveWorks SDK v2.2.3136
[31-05-2022 14:41:24] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[31-05-2022 14:41:24] SensorFactory::createSensor() -> camera.gmsl, camera-group=a,camera-type=ar0231-rccb-bae-sf3324,camera-count=4,camera-mask=1100,slave=0
[31-05-2022 14:41:24] CameraGMSL: Couldn't set CameraGMSL setup thread sched params!
[31-05-2022 14:41:24] CameraGMSL: Create NvMediaIPPManager
[31-05-2022 14:41:24] CameraGMSL: required FPS = 30, resolution = 1920x1208
nvmedia isc: GetCameraPowerControlLevel: 936: Camera power control library: NVCCP
Max96712 Rev 2 detected!
MAX96712: Enable periodic AEQ on Link 0
MAX96712: Enable periodic AEQ on Link 1
MAX96705: Pre-emphasis set to 0xaa
Sensor AR0231 RCCB Rev7 detected!
Sensor AR0231 RCCB Rev7 detected!
[31-05-2022 14:41:25] CameraGMSL: default IPP event callback function set
Successfully initialized 2 cameras of type ar0231-rccb-bae-sf3324 in port a with resolution of 1920x1208 at framerate of 30.000000 FPS
[31-05-2022 14:41:25] SensorFactory::createSensor() -> camera.gmsl, camera-group=b,camera-type=ar0231-rccb-bae-sf3324,camera-count=4,camera-mask=1100,slave=0
[31-05-2022 14:41:25] CameraGMSL: Couldn't set CameraGMSL setup thread sched params!
[31-05-2022 14:41:25] CameraGMSL: Create NvMediaIPPManager
[31-05-2022 14:41:25] CameraGMSL: required FPS = 30, resolution = 1920x1208
iscRootDevOpen: can't open /dev/isc-mgr.2.c - Device or resource busy
NvMediaISCRootDeviceCreate: Unable to open root device
nvmedia: ERROR: Init: Failed to create NvMedia ISC root device
[31-05-2022 14:41:25] Driveworks exception thrown: DW_SAL_CANNOT_CREATE_SENSOR: CameraGMSL: cannot connect to camera

terminate called after throwing an instance of 'std::runtime_error'
  what():  [2022-05-31 14:41:25] DW Error DW_SAL_CANNOT_CREATE_SENSOR executing DW function:
 dwSAL_createSensor(&m_camera[portID], params, m_sal)
 at /dvs/git/dirty/gitlab-master_av/dw/sdk/samples/sensors/camera/camera_multiple_gmsl/main.cpp:147
Aborted (core dumped)

Why is it not possible to access more than two cameras?

Did you try “–selector-mask” option for cameras from right to left? Connecting green, red and blue of port A should use --selector-mask=0111.

Dear @VickNV,

I should also notet hat the sample works for two cameras even when I choose a random selector mask.

For example, when I connect two cameras to port A with the green and red cables, it does not matter which selector mask I use.

Both, the command

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1100

and the command

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=1010

work for two cameras with the same cable connection (green and red). The other selector masks, such as 1001, 0110, 0101, 0011, also work.

Dear @VickNV,

Yes, I tried the following command:

./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=0111

I get the following terminal output and errors:

nvidia@tegra-ubuntu:/usr/local/driveworks/bin$ ./sample_camera_multiple_gmsl --type-a=ar0231-rccb-bae-sf3324 --selector-mask=0111
[31-05-2022 15:45:25] Platform: Detected DDPX - Tegra A
[31-05-2022 15:45:25] TimeSource: monotonic epoch time offset is 1654011630962233
[31-05-2022 15:45:25] PTP Time is available from NVPPS Driver
[31-05-2022 15:45:25] Platform: number of GPU devices detected 2
[31-05-2022 15:45:25] Platform: currently selected GPU device discrete ID 0
[31-05-2022 15:45:25] SDK: Resources mounted from .././data/
[31-05-2022 15:45:25] SDK: Create NvMediaDevice
[31-05-2022 15:45:25] SDK: use EGL display as provided
[31-05-2022 15:45:25] TimeSource: monotonic epoch time offset is 1654011630962233
[31-05-2022 15:45:25] PTP Time is available from NVPPS Driver
[31-05-2022 15:45:25] Initialize DriveWorks SDK v2.2.3136
[31-05-2022 15:45:25] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[31-05-2022 15:45:25] SensorFactory::createSensor() -> camera.gmsl, camera-group=a,camera-type=ar0231-rccb-bae-sf3324,camera-count=4,camera-mask=0111,slave=0
[31-05-2022 15:45:25] CameraGMSL: Couldn't set CameraGMSL setup thread sched params!
[31-05-2022 15:45:25] CameraGMSL: Create NvMediaIPPManager
[31-05-2022 15:45:25] CameraGMSL: required FPS = 30, resolution = 1920x1208
iscRootDevOpen: can't open /dev/isc-mgr.0.a - Device or resource busy
NvMediaISCRootDeviceCreate: Unable to open root device
nvmedia: ERROR: Init: Failed to create NvMedia ISC root device
[31-05-2022 15:45:25] Driveworks exception thrown: DW_SAL_CANNOT_CREATE_SENSOR: CameraGMSL: cannot connect to camera

terminate called after throwing an instance of 'std::runtime_error'
  what():  [2022-05-31 15:45:25] DW Error DW_SAL_CANNOT_CREATE_SENSOR executing DW function:
 dwSAL_createSensor(&m_camera[portID], params, m_sal)
 at /dvs/git/dirty/gitlab-master_av/dw/sdk/samples/sensors/camera/camera_multiple_gmsl/main.cpp:147
Aborted (core dumped)

I also tried selector masks --selector-mask=1011 and --selector-mask=1101 but it also did not work.

Have you tried this? Please also refer to Running GMSL Sample.

This solved the problem.

What does kill.sh do?