Unable to Set Exposure and Gain via argus_camera on Jetpak 6.2

Hardware Platform: Jetson AGX Orin
Jetpak Version: Jetpak 6.2 (R36.4.3)

Issue Description:
We are developing a camera driver on Jetpak 6.2 for the Jetson AGX Orin platform. The camera can be successfully bring up using argus_camera. However, when attempting to modify the “Exposure Time Range” and “Gain Range” parameters in the argus_camera interface, the corresponding driver functions, sensor_set_gain and sensor_set_exposure, are not being invoked.

Driver Code:

static const u32 ctrl_cid_list[] = {
    TEGRA_CAMERA_CID_GAIN,
    TEGRA_CAMERA_CID_EXPOSURE,
    TEGRA_CAMERA_CID_EXPOSURE_SHORT,
    TEGRA_CAMERA_CID_FRAME_RATE,
    TEGRA_CAMERA_CID_HDR_EN,
    TEGRA_CAMERA_CID_SENSOR_MODE_ID,
};

static struct tegracam_ctrl_ops sensor_ctrl_ops = {
    .numctrls = ARRAY_SIZE(ctrl_cid_list),
    .ctrl_cid_list = ctrl_cid_list,
    .set_gain = sensor_set_gain,
    .set_exposure = sensor_set_exposure,
    .set_exposure_short = sensor_set_exposure,
    .set_frame_rate = sensor_set_frame_rate,
    .set_group_hold = sensor_set_group_hold,
};

static int sensor_probe(struct i2c_client *client,
    const struct i2c_device_id *id)
{
    struct device *dev = &client->dev;
    struct device_node *node = dev->of_node;
    struct tegracam_device *tc_dev;
    struct cam_str *priv;
    int err;

    if (!IS_ENABLED(CONFIG_OF) || !node)
        return -EINVAL;

    priv = devm_kzalloc(dev, sizeof(struct cam_str), GFP_KERNEL);
    if (!priv) {
        dev_err(dev, "unable to allocate memory!\n");
        return -ENOMEM;
    }
    tc_dev = devm_kzalloc(dev,
        sizeof(struct tegracam_device), GFP_KERNEL);
    if (!tc_dev)
    {
        devm_kfree(dev, priv);
        return -ENOMEM;
    }

    priv->i2c_client = tc_dev->client = client;
    priv->id = id;
    tc_dev->dev = dev;
    strncpy(tc_dev->name, id->name, sizeof(tc_dev->name));
    tc_dev->dev_regmap_config = &sensor_regmap_config;
    tc_dev->sensor_ops = &sensor_common_ops;
    tc_dev->v4l2sd_internal_ops = &sensor_subdev_internal_ops;
    tc_dev->tcctrl_ops = &sensor_ctrl_ops;

    err = tegracam_device_register(tc_dev);
    if (err) {
        dev_err(dev, "tegra camera driver registration failed\n");
        return err;
    }

    priv->tc_dev = tc_dev;
    priv->s_data = tc_dev->s_data;
    priv->subdev = &tc_dev->s_data->subdev;

    tegracam_set_privdata(tc_dev, (void *)priv);

    err = sensor_board_setup(priv);
    if (err) {
        tegracam_device_unregister(tc_dev);
        dev_err(dev, "board setup failed\n");
        return err;
    }
    ......
}

We are wondering why the sensor_set_gain and sensor_set_exposure functions are not being called when we adjust the Exposure Time and Gain parameters in argus_camera.

The gain/exposure range is a range. If the AE is stable in this range it would involve the sensor to change the gain/exposure. However, you can set the gain range to [7 - 7] to force to set it to 7.

Hello ShaneCCC,

The sensor_set_gain and sensor_set_exposure functions are only called when argus_camera is started. No matter how I set the gain/exposure range in the argus_camer interface, they are not called. This problem did not occur in previous jetpak versions. Is there anything I need to pay attention to in jetpak 6.2?


No, I don’t see the problem by reference imx219 sensor.
I can see the preview change by set the gain range [1 -1], [3 -3], [7 - 7], [11 -11], [15 -15]

The issue has been resolved.

static int sensor_power_on(struct camera_common_data *s_data)
{
......

	pw->state = SWITCH_ON;

......
}

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