This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: How to apply pre-gain AWB in TDA4 with 0820 sensor?

Part Number: TDA4VM

Hello, Mayank,


I'm doing ISP work on sdk 7.03 with 0820 sensor (wdr mode), In the question "TDA4VM: Absence of 0820 SetAWB code" you have mentioned that the default WB mode is processed in the ISP. But I found in this mode an obvious motion color artifact can be observed, therefore, I wanna apply the AWB gain to the sensor before HDR meerge.

To apply this, I followed the example of AR0233 driver to add "Set_AwbParams" function in 0820 driver, and the gains calculated by AWB algorithm can be successfully wirriten into sensor registors.

However, the image displayed through DP deosn't have correct color, which looks greenish. I found that the gain values calculated by AWB algorithm is not correct.

Do I need to do any futher steps if applying the pre-gain AWB mode? And how can I get correct gains?

looking forward to your reply.
Jianxiong Hua

  • Hi Jianxiong,

    Are the colors correct if WB gains are applied in ISP (i.e. pre_gain = 0)?

    Regards,

    Mayank

  • Hi Mayank, 

    Yes, when I set pre_gain = 0 in sensor drive, the color becomes corect. 

    I'm not sure why pre-gain setting results in incorrect color. 

    Regards, 

    Jianxiong

  • In that case it may be a case of sensor configuration. The gains must be scaled appropriately to to sensor expected values. Please review the settings with your sensor vendor.

  • Hi, Mayank,

    I tested the gain values calculated by AWB algorithm, and found that the calculated gain values in ISP AWB mode (pre_gain = 0) and sensor AWB mode (pre_gain = 1) are different. Please see the attached table.

     

    Furthermore, I think the codes of  AWB_TI_process() in vx_aewb_target.c for pre-gain mode have some problems.

          First, in the if switch (if (1==sensor_pre_gain)), the rGain_prev, gGain_prev and bGain_prev are always 512 even though the pre-gains are successfully written into sensor register.

          Second, in the for loop of pre-gain division, the h3a_paxel_data is a variable not a pointer, therefore I think when calling the function TI_AWB_do(), the input data p_awb_params still remains the value before pre-gain division. 

    Please help to check the above issues, thank you. 

    Regards, 

    Jianxiong

  • Hello Jianxiong,

    There was a bug fixed in SDK release 8.1. Please find it attached. You are on a very old release so I am not sure if the patch will apply. Recommend you switching to the latest release.

    Regards,

    Mayank

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0002_2D00_Bug_2D00_fixes_2D00_for_2D00_in_2D00_sensor_2D00_pre_2D00_AWB_2D00_ISS_2D00_241_2D00_ADASVISION_2D00_5.patch

  • This code works, thanks!