Tegra Multimedia API - only subset of camera settings available?

Hi,

I have been using the tegra multimedia API examples that come with the Jetson to compare different cameras. But it seems that the examples do not expose the full range of camera settings.

E.g. for IMX334 and IMX577 the argus_camera example app (tegra_multimedia_api/argus/apps/camera/ui/camera/) allows the following settings:

Parameter	            IMX334	                               IMX577
Exposure time	            min: 7µs max: 16,6 ms	               min: 16µs max: 2 ms 
Gain	                    min: 1 max: 30	                       min: 1 max: 354
Digital Gain	            min: 1 max: 256	                       min: 1 max: 256
Frame rate	            min: 0,33 max: 60 Hz	               min: 0,684 max: <res dependent> Hz
Sensor mode index	    1 resolution only	                       5 different resolutions

I am suspicious about 2ms maximum exposure time. Also, there are more than 1 supported resolution for the IMX334. For IMX577 the driver documentation lists 6 resolutions, where 3840x2160 pixels are missing in the camera app.

I looked into the source code and I see that the app queries the parameters ranges for example via argus camera api. That made me wonder. Why does the argus camera app only provide a subset of the resoltions and why do I have a larger set of options with nvgstacapture-1.0 or the gstreamer camera blocks? I would have expected they all provide equal options?

Thank you!

Hi,
Is IMX577 from our partners? Please share information about the vendor. Thanks.

Hi DaneLLL,

sorry for the late reply. The imx is from leopard imaging. We were able to look into the driver and could explain the problem with the resolutions. It seems there is actually really only a single resolution defined for IMX334.

Regarding the exposure time. The driver of the IMX577 defines different exposure times for different resolutions using different modes. The argus camera app only offers the minimum exposure time of all the exposure times defined by the driver. Here a simplified output from the driver sources:

mode0 {
						...
						active_w = "4056";
						active_h = "3040";
						...
						min_exp_time = "16.165";
						max_exp_time = "15577";
						...
					};

					mode1 {
						...
						active_w = "3840";
						active_h = "2160";
						...
						min_exp_time = "16.165";
						max_exp_time = "12577";
						...
					};
					mode2 {
						...
						active_w = "1920";
						active_h = "1080";
						...
						min_exp_time = "16.165";
						max_exp_time = "16577";
						...
					};

using this driver and launching the ./argus_camera app, where I modified the source code of the onDeviceIndexChanged(…) function inside
tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp to print the different exposure times offered by the different sensor modes

bool Dispatcher::onDeviceIndexChanged(const Observed &source)
{
    assert(static_cast<const Value<uint32_t>&>(source).get() == m_deviceIndex);
    assert(m_initialized);

    // close the currently open device
    if (m_deviceOpen)
    {
        PROPAGATE_ERROR(m_deviceOpen.set(false));

        PROPAGATE_ERROR(closeSession());

        // reset the current device properties
    }

    // open the new device
    const Argus::ICameraProperties *iCameraProperties =
        Argus::interface_cast<Argus::ICameraProperties>(m_cameraDevices
[m_deviceIndex]);
    if (!iCameraProperties)
        ORIGINATE_ERROR("Failed to get ICameraProperties interface");

...
    // get the sensor modes
    if (iCameraProperties->getAllSensorModes(&m_sensorModes) != Argus::STATUS_OK)
        ORIGINATE_ERROR("Failed to get sensor modes");

    std::vector<ValidatorEnum<uint32_t>::ValueStringPair> valueStringPairs;
    valueStringPairs.resize(m_sensorModes.size());
    for (size_t index = 0; index < m_sensorModes.size(); ++index)
    {
        Argus::ISensorMode *sensorMode =
            Argus::interface_cast<Argus::ISensorMode>(m_sensorModes[index]);

        valueStringPairs[index].value = (uint32_t)index;

        std::ostringstream stream;
        stream << index << ": "
            << sensorMode->getResolution().width() << "x" << sensorMode->getResolution().height();

        Argus::Ext::IPwlWdrSensorMode* pwlMode =
            Argus::interface_cast<Argus::Ext::IPwlWdrSensorMode>(m_sensorModes[index]);

        printf("++++ Resolution:  = %i x %i\n",  sensorMode->getResolution().width(), sensorMode->getResolution().height());
        printf("++++ sensorExposureTimeRange max = %i\n\n", sensorMode->getExposureTimeRange().max());

if (pwlMode)
        {
            stream << " @" << sensorMode->getInputBitDepth() << "bpp -> " <<
                sensorMode->getOutputBitDepth() << "bpp";
        }
        else
        {
            stream << " @" << sensorMode->getOutputBitDepth() << "bpp";
        }
        valueStringPairs[index].string = stream.str();
    }
    // update the validator with the new value/string pairs
    ValidatorEnum<uint32_t> *validator =
        static_cast<ValidatorEnum<uint32_t>*>(m_sensorModeIndex.getValidator());
    PROPAGATE_ERROR(validator->setValidValues(valueStringPairs.data(), valueStringPairs.size()));

    // set the sensor mode index (force notify observer because the sensor modes are different now
    // although the sensor mode index could be the same)
    PROPAGATE_ERROR(m_sensorModeIndex.set(0, true /*forceNotify*/));

    PROPAGATE_ERROR(m_deviceOpen.set(true));

    return true;
}

results in the following output:

++++ Resolution:  = 4056 x 3040
++++ sensorExposureTimeRange max = 12577000

++++ Resolution:  = 3840 x 2160
++++ sensorExposureTimeRange max = 12577000

++++ Resolution:  = 1920 x 1080
++++ sensorExposureTimeRange max = 12577000

Why is the argus library returning always the minimum value? Is there a problem with the driver? Do you observe the same behaviour with different maybe cameras from a different source?

Thanks!

@marvintx
I check the argus_camera for the “exposure time range” by different sensor mode there is no problem to show the different range with different sensor mode declare by device tree.

That is surprising to me. What version of L4T are you using (we use R28.2)? Is the camera also from leopard imaging?

No, I try on the default camera e3326(ov5693)