Hello, Is it possible to set values for exposure and gain of the sensor OV5640?
I have seen that there is a ioctl_s_ctrl in ov5640_mipi.c but does not implement the V4L2_CID_EXPOSURE nor V4L2_CID_GAIN. But it is defined the OV5640_set_gain16 (int gain16) and OV5640_set_shutter (int shutter)
Can someone tell me how to modify those values?
Best regards.
Solved! Go to Solution.
Hi,
I am not an expert in this field but may want to try to use the OV5640_set_gain16 function in the V4L2_CID_GAIN case. And use the vc-value as parameter for this function.
Something like this:
case V4L2_CID_GAIN:
OV5640_set_gain16( (__s32)vc->value);
break;
Please let me know how it goes.
/Alejandro
Hi Juan,
I am trying to set the exposure values based on the Android API on Ov5640 MIPI on IMX6 board and I did changes based on the response from Alejandro (as below)
case V4L2_CID_GAIN:
OV5640_set_gain16( (__s32)vc->value);
break;
but seems there is no impact on the camera exposure when I change values using Android API. I posted the issue in the Freescale communities and received below response, could you please assist me in implementing the Camera Exposure?
OV5640 MIPI camera on a iMX6 set exposure and gain
Thanks,
Sreekanth
Hi Sreekanth , you should comment the line "OV5640_turn_on_AE_AG (1);" in the "ov5640_change_mode_direct" because it calculates auto exposure.
Regards.
Thanks Juan.
Hi,
I am not an expert in this field but may want to try to use the OV5640_set_gain16 function in the V4L2_CID_GAIN case. And use the vc-value as parameter for this function.
Something like this:
case V4L2_CID_GAIN:
OV5640_set_gain16( (__s32)vc->value);
break;
Please let me know how it goes.
/Alejandro
Thanks for the reply, I had already done this and it worked.
Best regards.