Multiple CSI cameras show same module string

Hi,
I’m using a Xavier NX production module with JetPack 4.6, with 3 IMX219 cameras connected via a leeptop A205 carrier board; with the device-tree updated to be correct for this carrier board.

All three cameras work fine using “nvgstcapture” with “–sensor_id” set to 0, 1 or 2.

I’m now developing C++ code to access the cameras with LibArgus.
The following code is meant to simply enumerate the cameras, and show the module-string for each camera:

#include <vector>
#include <stdio.h>
#include <Argus/Argus.h>

using namespace Argus;

int main() {
  UniqueObj<CameraProvider> cam_prov(CameraProvider::create());
  printf("\n");
  ICameraProvider* i_cam_prov = interface_cast<ICameraProvider>(cam_prov);
  std::vector<CameraDevice*> devices;
  i_cam_prov->getCameraDevices(&devices);
  devices.erase(devices.begin());
  for (CameraDevice* device : devices) {
    ICameraProperties* camera_props = interface_cast<ICameraProperties>(device);
    printf("Module string: %s\n", camera_props->getModuleString().c_str());
  }
}

This almost works, but prints out the same Module String for all three cameras: “jakku_bottomleft_RBP194”.

However, if I change to code to print out just one camera’s module string, and then run it three times for cameras 0, 1 and 2 separately, then it does indeed print out the correct, different, module strings: “jakku_bottomleft_RBP194”, “jakku_bottomright_RBP194”, and “jakku_centerleft_RBP194”.

Please could you help me understand why the original code (as shown above) doesn’t show the three different module strings as I would expect?

Many thanks,
Chris

Have referencing to jetson_multimedia_api/argus/samples/multiSensor to create three ICameraProperties instead using for loop to try.

Do you mind sharing your device-tree files or ? I recently got the A205 carrier board, have not figured out how to bringup it with 3-6 IMX219 cameras.

Hi air23zj,
I don’t have the files to hand right now, but I emailed leetop@leetop.top asking for the resources to get this working, and they replied very quickly with the device-tree file, so I expect you can just ask them directly for it.
They also sent a kernel, but I found that the device-tree worked with the most recent jetpack.
Hope this helps,
Chris

Hi ShaneCCC,

Thank you for your reply. Do you mean sample “13_multi_camera” - I don’t seem to have a sample named “multiSensor”.

This sample does use a for-loop to iterate through multiple cameras, in a very similar way to my code posted above. This is done in lines 393 to 409 in main.cpp of the sample code I have on my device.
This sample does not use getModuleString(), so will not demonstrate the issue.

I have changed my code to not use a for-loop, as you suggest, but I still see the problem:

int main() {
  UniqueObj<CameraProvider> cam_prov(CameraProvider::create());
  printf("\n");
  ICameraProvider* i_cam_prov = interface_cast<ICameraProvider>(cam_prov);
  std::vector<CameraDevice*> devices;
  i_cam_prov->getCameraDevices(&devices);
  ICameraProperties* camera_props_0 = interface_cast<ICameraProperties>(devices[0]);
  printf("Module string 0: %s\n", camera_props_0->getModuleString().c_str());
  ICameraProperties* camera_props_1 = interface_cast<ICameraProperties>(devices[1]);
  printf("Module string 1: %s\n", camera_props_1->getModuleString().c_str());
  ICameraProperties* camera_props_2 = interface_cast<ICameraProperties>(devices[2]);
  printf("Module string 2: %s\n", camera_props_2->getModuleString().c_str());
}

Generates output:

Module string 0: jakku_bottomleft_RBP194
Module string 1: jakku_bottomleft_RBP194
Module string 2: jakku_bottomleft_RBP194

When I would expect it to show a different module string for each camera.
If I run the code to show each camera by itself, then the output is as expected, showing the correct module name for each camera.

And if I change the order in which the camera device getModuleString() methods are called, then every camera device will show the module string for the first camera device requested.

Please can you advise what I am doing wrong?
If you run this code on a multi-camera system, do you see the module strings shown correctly?

Many thanks,
Chris

The path as /usr/src/jetson_multimedia_api/argus/samples/multiSensor

Hi ShaneCCC,
Thank you, I have found the multiSensor sample.

This sample does not appear to directly address the issue I’m seeing, which is incorrect module strings.
And as far as I can see the code I posted above is creating and using the CameraProvider and ICameraProperties the same way as in the sample.

Do you see any error in the code I’ve posted?
Or are you perhaps able to run the code, and see whether this error is reproducible?

Thank you,
Chris

Looks like this API have problem. Need take time to do further debug.
Could you use iCameraProperties->getSensorPlacement().getName() for temp solution.

Hi ShaneCCC,
Thank you for confirming there is likely an API problem.
I will use a workaround.
Chris

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