If I set min & max gain in argus_camera, the gain in v4l2 driver show ~720 ==> it is correct.
I just wonder how 0 - 720 gain range in driver can translate into 0 - 3981 in argus? And the map between v4l2 gain range and argus gain range is not linear. Is there any formula to translate between argus’s gain range and v4l2 gain range?
0-16 in argus = 0 - 240 in v4l2 driver.
16-3981 in argus = 241 - 720 in v4l2 driver.
please follow below to enable Argus daemon LOGs,
there’s commands, enableCamCoreLogs=5 to enable the debug logs of camera stack, you should expect lots of messages will populate to your terminal, please gather all of them as single text file and attach them to the forum thread for reference,
thanks
Here is nvargus-daemon log with core level = 5.
I just start argus_camera, then change cam mode from 0 → 3, then set ISP digital gain range to 1-1, and finally close the argus_camera app.
BTW, did you configure use_decibel_gain="true" in the device tree property?
if yes, the driver returns analog gain in decibels (dB), according to the formula, dB = 20 * log (Analog Gain)
the gain range shown in argus_camera isn’t represent with decibels (dB).
there’s debug messages, you may check log2(Gain) for confirmation.
for example, NvIspAeGetEVTableIndex: Gain = 1.206781, log2(Gain) = 0.271163
it looks correct to me you’re having 0dB (20 * log(1)) ~ 72dB (20 * log(3981)) gain range.
thanks
low-level camera driver side use AnalogGain for calculation.
here’s formula of the debug messages, Log2Gain = log(Gain) / log(2.f);
it’s covert as log2 scale is for better readability of debug logs.
for example, NvIspAeGetEVTableIndex: Gain = 100.999985, log2(Gain) = 6.658211
it means… when sensor analog gain = 100.999985; log2(Gain) = (log100.999985/log2) = 6.658211
BTW,
did you see any unexpected gain settings behaviors in the use-case?
I just don’t know the argus stack is using “Voltage Ratio Gain” instead of analog gain.
Now I knew the fomular:
argus gain value = 10^(gain_dB / 20)
which gain_dB is the actual analog gain in sensor.