Solved. Argus library createCaptureSession status=2

Hi, my setup Jetson Agx, jp4.6.1, Leopard Imaging 6x imx577 with sync.
LibArgus, c++, ubuntu 18.

Before i used only 3 cameras. All works fine.

Now i have installed 6 cameras.
All 6 cameras works with argus_camera --device=X in separate windows at the same time.

But from my code it failed now with more than 4 cameras with status 2 when createCaptureSession was called.
Please help to understand why?

Here is code:

    Argus::Status status;
    m_cameraProvider = Argus::UniqueObj< Argus::CameraProvider >( Argus::CameraProvider::create( & status ) );
    if( status != 0 ) PROPAGATE_ERROR( "Failed to create CameraProvider!" );

    Argus::ICameraProvider * iCameraProvider{ Argus::interface_cast< Argus::ICameraProvider >( m_cameraProvider ) };
    if( not iCameraProvider ) PROPAGATE_ERROR( "Failed to create iCameraProvider!" );
    std::cout << "Argus Version: " << iCameraProvider->getVersion() << std::endl;

    // Get the camera devices.
    iCameraProvider->getCameraDevices( & m_cameraDevices );

    if( m_cameraDevices.size() < m_camerasNum ) PROPAGATE_ERROR( std::string{ "Not enough cameras! [" + std::to_string( m_cameraDevices.size() ) + "]" }.c_str() );
    std::cout << "Cameras:  " << m_cameraDevices.size() << " " << m_camerasNum << std::endl;
    m_sensorMode = ArgusSamples::ArgusHelpers::getSensorMode( m_cameraDevices.at( 0 ), 0 );
    m_iSensorMode = Argus::interface_cast< Argus::ISensorMode >( m_sensorMode );
    if( not m_iSensorMode ) PROPAGATE_ERROR( "Failed to get sensor mode interface!" );

    // Get the camera devices.
    std::vector < Argus::CameraDevice * > cameras;
    for( size_t cameraId{}; cameraId < m_camerasNum; ++ cameraId )
        cameras.push_back( m_cameraDevices.at( cameraId ) ); // (the 1st camera will be used for AC)

    m_captureSession = Argus::UniqueObj< Argus::CaptureSession >{ iCameraProvider->createCaptureSession( cameras, & status ) };
    m_iCaptureSession = Argus::interface_cast< Argus::ICaptureSession >( m_captureSession );
    if( not m_iCaptureSession ) PROPAGATE_ERROR( "Failed to get ICaptureSession interface!" );

Best regards, Viktor.

Please reference to argus_camera to figure it out due to argus_camera working without problem.

Thanks

I asked Nvidia developers, why this code works for <=4 cams and does not for 5-6?

And it is very different modes: 6 individual instances and sessions vs single session with all cameras.

I can run 6 individual sessions from c++, but for sync frames i need single session with 6 cameras.

Can you help me?

OK, looks like you need the fixed from below topic.

https://forums.developer.nvidia.com/t/xavier-nx-use-argus-sample-syncsensor-capture-6-camera-error/199994/11

Thank you.
I’ve replaced so and it runs for 5 sensors.
But for 6 i got status 3 now.
Can you recompile libs for 6 sensors?

The libs from the link already modify to 6 cameras and verified. Do you use r32.6.1?

Could you check the argus_camera -i to confirm if able list all of 6 cameras.

Check like below.

./argus_camera -i
Executing Argus Sample Application (argus_camera)
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module2
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module3
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module4
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module5
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: virtual device driver node not found in proc device-tree: /proc/device-tree/tegra-virtual-camera-platform/modules/module0/drivernode1
OFParserGetVirtualDevice: virtual device driver node not found in proc device-tree: /proc/device-tree/tegra-virtual-camera-platform/modules/module1/drivernode0
---- imager: No override file found. ----
---- imager: No override file found. ----
---- imager: No override file found. ----
---- imager: No override file found. ----
---- imager: No override file found. ----
---- imager: No override file found. ----
Argus Version: 0.98.3 (single-process)
Argus extensions:
  BayerSharpnessMap: supported
  DebugCaptureSession: supported
  DeFog: supported
  FaceDetect: not supported
  InternalFrameCount: supported
  SensorPrivateMetadata: supported
Number of camera devices: 6
Device: 0
  Max AE Regions: 64
  Max AWB Regions: 64
  Focus Position Range: 0 - 0
  Aperture Position Range: 0 - 0
  Aperture Motor Speed Range: 1 - 1
  Lens Aperture Available values: 2.4,
  Isp Digital Gain Range: 1 - 256
  Number of sensor modes: 3
  Sensor mode: 0
    Resolution: 2592x1944
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 1
    Resolution: 2592x1458
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 2
    Resolution: 1280x720
    Exposure time range: 22000 - 358733000 ns
    Frame duration range: 8333333 - 550486208 ns
    Framerate range: 1.81658 - 120 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

Device: 1
  Max AE Regions: 64
  Max AWB Regions: 64
  Focus Position Range: 0 - 0
  Aperture Position Range: 0 - 0
  Aperture Motor Speed Range: 1 - 1
  Lens Aperture Available values: 2.4,
  Isp Digital Gain Range: 1 - 256
  Number of sensor modes: 3
  Sensor mode: 0
    Resolution: 2592x1944
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 1
    Resolution: 2592x1458
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 2
    Resolution: 1280x720
    Exposure time range: 22000 - 358733000 ns
    Frame duration range: 8333333 - 550486208 ns
    Framerate range: 1.81658 - 120 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

Device: 2
  Max AE Regions: 64
  Max AWB Regions: 64
  Focus Position Range: 0 - 0
  Aperture Position Range: 0 - 0
  Aperture Motor Speed Range: 1 - 1
  Lens Aperture Available values: 2.4,
  Isp Digital Gain Range: 1 - 256
  Number of sensor modes: 3
  Sensor mode: 0
    Resolution: 2592x1944
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 1
    Resolution: 2592x1458
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 2
    Resolution: 1280x720
    Exposure time range: 22000 - 358733000 ns
    Frame duration range: 8333333 - 550486208 ns
    Framerate range: 1.81658 - 120 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

Device: 3
  Max AE Regions: 64
  Max AWB Regions: 64
  Focus Position Range: 0 - 0
  Aperture Position Range: 0 - 0
  Aperture Motor Speed Range: 1 - 1
  Lens Aperture Available values: 2.4,
  Isp Digital Gain Range: 1 - 256
  Number of sensor modes: 3
  Sensor mode: 0
    Resolution: 2592x1944
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 1
    Resolution: 2592x1458
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 2
    Resolution: 1280x720
    Exposure time range: 22000 - 358733000 ns
    Frame duration range: 8333333 - 550486208 ns
    Framerate range: 1.81658 - 120 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

Device: 4
  Max AE Regions: 64
  Max AWB Regions: 64
  Focus Position Range: 0 - 0
  Aperture Position Range: 0 - 0
  Aperture Motor Speed Range: 1 - 1
  Lens Aperture Available values: 2.4,
  Isp Digital Gain Range: 1 - 256
  Number of sensor modes: 3
  Sensor mode: 0
    Resolution: 2592x1944
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 1
    Resolution: 2592x1458
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 2
    Resolution: 1280x720
    Exposure time range: 22000 - 358733000 ns
    Frame duration range: 8333333 - 550486208 ns
    Framerate range: 1.81658 - 120 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

Device: 5
  Max AE Regions: 64
  Max AWB Regions: 64
  Focus Position Range: 0 - 0
  Aperture Position Range: 0 - 0
  Aperture Motor Speed Range: 1 - 1
  Lens Aperture Available values: 2.4,
  Isp Digital Gain Range: 1 - 256
  Number of sensor modes: 3
  Sensor mode: 0
    Resolution: 2592x1944
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 1
    Resolution: 2592x1458
    Exposure time range: 34000 - 550385000 ns
    Frame duration range: 33333334 - 550486208 ns
    Framerate range: 1.81658 - 30 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

  Sensor mode: 2
    Resolution: 1280x720
    Exposure time range: 22000 - 358733000 ns
    Frame duration range: 8333333 - 550486208 ns
    Framerate range: 1.81658 - 120 fps
    InputBitDepth:  10
    OutputBitDepth: 10
    Analog gain range: 1 - 16
    SensorModeType: SENSOR_MODE_TYPE_BAYER

What i should check? -i said 6 cameras. Did you see it?

I saw difference between 0-4 and 5:

Is it the answer?
Is it bsp issue or argus libs issue?

Why the 5 cameras different? It’s different sensor?
Suppose the syncSensor only support the same sensors.

No, they are strongly the same.

Here are running sensors 0 and 5.

You think they are hardware different or it is bsp settings?

I can’t tell if it’s HW different or not. But the exposure/frame rate is different.
What’s the v4l2-ctl --list?
If it’s the same then you may need to modify the device tree and sensor driver to report the same exposure/frame rate … to verify.

Here is v4l2-ctl --all output:

v.txt (17.2 KB)

I wrote to Leopard Imaging too.

Can you request them to release driver update?
They are authorized partner of Nvidia?

You can dump the device tree by below command to check and modify then recompile it to dtb to apply it to try.

sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree