Requesting details about how auto exposure works for nvarguscamerasrc

Hello. We are using a Jetson TX2 (on a Spacely carrier board by Connect Tech) and we are using a LI-IMX274-MIPI-M12 camera from Leopard Imaging. We are using GStreamer and nvarguscamerasrc to interface the camera.

nvarguscamerasrc takes in ranges (min and max values) for exposure time, gain and ISP digital gain, and it seems an auto exposure algorithm is implemented that sets the actual values for exposure time, gain and ISP based on the brightness of the image.

Can you provide me with details about how this auto exposure algorithm works and how it prioritizes between exposure time, gain and ISP digital gain? Where exactly is this auto exposure algorithm implemented? Do you have links to the relevant source code?

Is there any way we can query the camera for the actual values used for exposure time, gain and ISP digital gain for each frame in the video stream?

hello Oystein1,

you may check Jetson Linux API Reference: Libargus Camera API | NVIDIA Docs
there’re APIs to obtain the settings, such as Argus::ISourceSettings::getExposureTimeRange, and Argus::ISourceSettings::getGainRange.

I know how to get and set the exposure time range and the gain range. I am looking for more information on how the auto exposure algorithm works, i.e. how the exposure time, gain etc. is calculated based on the image and the given min/max values.

hello Oystein1,

you may enable Argus daemon LOGs as follow to obtain more details.
for example,

$ sudo su 
# pkill nvargus-daemon
# export enableCamCoreLogs=5
# nvargus-daemon
or.. # nvargus-daemon 2>&1 | tee argus-output.log

it’ll enable lots of camera stack debug messages,
you may also pay attentions to runBreakDownAlgorithm for the AE settings applied to each capture frames.
for example,
runBreakDownAlgorithm output ---: convergenceStatus: 1, framerate 30.00000, requiredCain 0.01330 totalAchievedCGains 0.01330 with AA 0.17361 {step 0, f-Number 2.40000}, ET 0.03333, AG 2.29763, ISPDG 1.00000
furthermore, for the convergenceStatus, 1=Searching, 2=Converged.

Thank you. I was able to get this debug output as you suggested.

It also seems that I am able to get the exposure time and gain by running v4l2-ctl, e.g. v4l2-ctl --get-ctrl exposure and v4l2-ctl --get-ctrl gain:

# v4l2-ctl --get-ctrl exposure
exposure: 6326

# v4l2-ctl --get-ctrl gain
gain: 16000000

I see that I can also get some more information by querying for sensor_control_properties, sensor_signal_properties and sensor_image_properties.

# v4l2-ctl --get-ctrl sensor_control_properties
Sensor Control Properties[0]: 1000000, 1000000,      1, 1000000, 44400000,      1,      1, 1500000, 60000000,      0,     44,      0, 478696,      0,      1,      1, 1000000,      0,      1,      0, 1000000, 60000000,  16667,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0

# v4l2-ctl --get-ctrl sensor_signal_properties
Sensor Signal Properties[0]:     90,      4,  24000,      0, 576000000,      0,      0,      1,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0

# v4l2-ctl --get-ctrl sensor_image_properties
Sensor Image Properties[0]:   3840,   2160,   4208, 808535890,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0

As you can see, three arrays of numbers are returned. Do you have information about what the different values in these arrays mean? I am looking for sensor sensitivity (ISO value), analog and digital gain, white balance, saturation, exposure compensation etc.

hello Oystein1,

it reads from device tree when you using v4l2 standard controls to pares these sensor properties.
you would like to know the sensor settings while auto-exposure is active, right? please look into Argus daemon LOGs with enableCamCoreLogs.

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