TDA4VM: TDA4VM ISP Tuning EE question

Part Number: TDA4VM

Tool/software:

HI experts,

My EE plugin shows obvious effects on the DCC, but it still doesn't work on the TDA4 development board.
The file system I flashed is linux - edgeai, the tisdk-edgeai-image-j721e-evm.wic of version 09.02.00.05 (Apr 8, 2024).
I'm not using an RTOS system. There is no "ee_mode" in /opt/edgeai - tiovx - modules/src/tiovx_viss_module.c.
However, I've made the following modification in 
/opt/edgeai - gst - plugins/ext/tiovx/gsttiovxisp.c:
static const guint default_ee_mode = TIVX_VPAC_VISS_EE_MODE_OFF->TIVX_VPAC_VISS_EE_MODE_Y8;
then./scripts/install_gst_plugins.sh.
And 
/opt/edgeai-tiovx-apps/modules/src/tiovx_viss_module.c
node_cfg->viss_params.fcp[0].ee_mode = TIVX_VPAC_VISS_EE_MODE_OFF->TIVX_VPAC_VISS_EE_MODE_Y8;
But it seems that there is no real effect. It just makes the overall image a bit brighter. Here are the effect diagrams before and after my debugging. I've tried all the methods I found on the forum.
Thanks!
  • Hi Ying,

    but it still doesn't work on the TDA4 development board.

    I am not aware of any existing issue of EE in edgeai.

    Which TDA4 development board are you using?

    The file system I flashed is linux - edgeai, the tisdk-edgeai-image-j721e-evm.wic of version 09.02.00.05 (Apr 8, 2024).

    This version should be fine if I recall correctly.
    Copying my friend for her comments.

  • Hi Gang,

    The TDA4 development board is TDA4VM.

    Do you think there is a difference in the effect of EE between the two pictures above?

  • Hi Ying,

    The TDA4 development board is TDA4VM.

    Do you mean this SK-TDA4VM board in the link below?

    https://www.ti.com/tool/SK-TDA4VM?keyMatch=SK-TDA4vm&tisearch=universal_search

    Do you think there is a difference in the effect of EE between the two pictures above?

    No, there is no real difference.
    EE is probably not enabled in gstreamer at your side.
    In that case, even if you use extreme EE parameter, you won't see any difference.

  • Hi Gang,

    My development board is the J721E-EVM. All right, I've already used the extreme EE parameter. Then shall I try changing to a different SDK version?

  • Hi Gang,

    I've already found the cause of the problem. It's due to this file system, the tisdk - edgeai - image - j721e - evm.wic of version 09.02.00.05 (Apr 8, 2024). And, I tried rolling back the version to 09.00.00.08, and I could clearly see the effect of EE.

  • Hi Ying,

    I've already found the cause of the problem. It's due to this file system, the tisdk - edgeai - image - j721e - evm.wic of version 09.02.00.05 (Apr 8, 2024). And, I tried rolling back the version to 09.00.00.08, and I could clearly see the effect of EE.

    Thanks for the update!

    I am waiting for Chau's confirmation on enabling EE settings on SK-TDA4VM.
    I suppose the issue is caused by some edgeai s/w changes.

    My development board is the J721E-EVM.

    edgeai SK does not support J721E-EVM officially and therefore it is not tested on our side.
    Does it work on your EVM out of box without any changes?

  • Hi Ying,

    Can you run `gst-inspect-1.0 tiovxisp` and confirm the default ee_mode? Below is an example log:

    root@am62axx-evm:/opt/edgeai-gst-apps# gst-inspect-1.0 tiovxisp
      ee-mode             : Flag to set Edge Enhancement mode.
                            flags: readable, writable, controllable, changeable only in NULL or READY state
                            Enum "GstTIOVXISPEEModes" Default: 0, "EE_MODE_OFF"
                               (0): EE_MODE_OFF      - EE mode off
                               (1): EE_MODE_Y12      - Edge Enhancer is enabled on Y12 output (output0)
                               (2): EE_MODE_Y8       - Edge Enhancer is enabled on Y8 output (output2) 

    In 9.1, we enable EE manually by modifying the code, but in 9.2, EE is enabled through GStreamer. For example,

    gst-launch-1.0 -v v4l2src device=/dev/video4 io-mode=dmabuf-import ! \
    video/x-bayer, width=2592, height=1944, framerate=30/1, format=bggi10 ! queue ! \
    tiovxisp sink_0::pool-size=4 sink_0::device=/dev/v4l-subdev2 sensor-name="SENSOR_OX05B1S" \
    ee-mode=EE_MODE_Y8 dcc-isp-file=./dcc_viss_ee.bin sink_0::dcc-2a-file=/opt/imaging/ox05b1s/linear/dcc_2a.bin format-msb=9 ! queue ! \
    tiovxldc dcc-file=/opt/imaging/ox05b1s/linear/dcc_ldc.bin sensor-name=SENSOR_OX05B1S ! \
    video/x-raw, format=NV12, width=2592, height=1944 ! queue ! \
    tiovxmultiscaler src_0::pool-size=4 target=1 ! video/x-raw, format=NV12, width=1920, height=1080 ! queue ! \
    tiperfoverlay location=perf_logs num-dumps=10 ! queue ! kmssink driver-name=tidss force-modesetting=true sync=false 

    Best,

    Chau

  • Hi Chau,

    Thank you for your help. 

     ee-mode             : Flag to set Edge Enhancement mode.
                            flags: readable, writable, controllable, changeable only in NULL or READY state
                            Enum "GstTIOVXISPEEModes" Default: 2, "EE_MODE_Y8"
                               (0): EE_MODE_OFF      - EE mode off
                               (1): EE_MODE_Y12      - Edge Enhancer is enabled on Y12 output (output0)
                               (2): EE_MODE_Y8       - Edge Enhancer is enabled on Y8 output (output2)

    My current version is 9.2. I don't know how to generate the dcc_viss_ee.bin file. Could you tell me how you generate it? Could it be that my "imaging" is not the latest version?

    Thanks!

  • Hi Ying,

    My current version is 9.2. I don't know how to generate the dcc_viss_ee.bin file.

    You don't need a separate bin file for just EE.

    There is only one bin file for all VISS settings.
    You may use the same VISS bin file you have for 9.0.

  • Hi Gang,
    In that case, it really seems that there is no EE effect.
    This is the command I used.
    gst-launch-1.0 \
    v4l2src device=/dev/video-ox03c10-cam0 io-mode=dmabuf-import ! \
    video/x-bayer, width=1920, height=1280, format=bggr12 ! \
    tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name=SENSOR_SONY_OX03C10_UB953_D3 \
    ee-mode=EE_MODE_Y8 dcc-isp-file=/opt/imaging/ox03c10/wdr/dcc_viss_wdr.bin \
    sink_0::dcc-2a-file=/opt/imaging/ox03c10/wdr/dcc_2a_wdr.bin format-msb=11 ! \
    video/x-raw, format=NV12, width=1920, height=1280 ! \
    kmssink driver-name=tidss sync=false
  • Hi Ying,

    "dcc_viss_wdr.bin" shall include EE parameters.

    I am not familiar with gstreamer details.
    may help to confirm if there is anything missing.

  • Hi Gang,

    Thank you for your help.
    In addition,I'd like to ask why there is no change in the image when I manually set the AE.
  • Whether I increase or decrease the parameters, there is no effect on the image. In addition, I also executed the command ./scripts/install_gst_plugins.sh.

  • Hi Ying,

    In addition,I'd like to ask why there is no change in the image when I manually set the AE.

    Tuning tool only sends the value to EVM.
    That depends on your sensor driver for programming the sensor gain.

  • Whether I increase or decrease the parameters, there is no effect on the image. In addition, I also executed the command ./scripts/install_gst_plugins.sh.

    Why are the min and max values all 0s?

  • Hi,

    Because these are the parameters I used for testing. I tried increasing or decreasing these parameters, but AE did not improve. May I ask why this is happening?

    Thanks.

  • Because these are the parameters I used for testing. I tried increasing or decreasing these parameters, but AE did not improve. May I ask why this is happening?

    0s are not valid values.
    Please follow these FAQ links below.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1262114/faq-setting-up-auto-exposure-ae-for-your-image-sensor-with-tda4-am6xa-isp-vpac

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1303303/faq-am62a7-how-to-set-the-minimum-maximum-exposure-time-and-analog-gain-for-2a-algorithm

    You may have to check your sensor driver first by looking at the captured raw images from sensor to make sure that exposure time and gain changes are effective.

  • Hi Ying, 

    To use the live tuning feature of the tuning tool to set the AE at runtime, there are a couple steps you must follow.

    Please refer to this tuning guide to enable live tuning: https://www.ti.com/lit/an/sprad86a/sprad86a.pdf?ts=1742911969679#page=28&zoom=100,0,70 

    Best,

    Chau

  • Thanks Chau!
    I assumed that live tuning was already working for Ying.
    It is good to confirm that first.

  • Hi Gang,

    May I ask if the AE value calculated by the 2A algorithm is ultimately written into the sensor register? How is this implemented through code? Which function or file is used to control the sensor? I want to check the reasons why the AE has no effect.

    After testing, it has been confirmed that the ISP side is indeed calculating the AE value in real time without any issues. When directly writing to the sensor's registers, there are also visible changes in the image effect, indicating no problems here. Therefore, there might be an issue with the communication between the ISP side and the sensor.

  • Hi Ying,

    May I ask if the AE value calculated by the 2A algorithm is ultimately written into the sensor register? How is this implemented through code? Which function or file is used to control the sensor? I want to check the reasons why the AE has no effect.

    You may take a look at your driver for programming sensor exposure and gain.

    e.g., this link below is for IMX728

    git.ti.com/.../iss_sensor_imx728.c

  • Sorry, I thought that you were working with RTOS drivers.

    For gstreamer and Linux sensor drivers, you may check the end of this link below regarding "gst_tiovx_isp_map_2A_values".

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1303303/faq-am62a7-how-to-set-the-minimum-maximum-exposure-time-and-analog-gain-for-2a-algorithm

  • I won't consider the details of the maximum and minimum exposure calculations for now. Currently, I can see that the AE values are being calculated and changing, as shown in Figure 1. However, the register values of the sensor remain unchanged, which proves that the calculated AE values haven't been successfully written into the registers, as shown in Figure 2. I noticed that the exposure function in the driver was only called once during initialization. So, could you tell me which function in the driver is called by the ISP side to continuously control the exposure?

  • So, could you tell me which function in the driver is called by the ISP side to continuously control the exposure?

    Exposure change is sent to the sensor right after map 2A values.

  • Hi Gang,

    Thank you very much for your help. I have already found out the cause of the problem, "Unable to call exposure ioctl: -1", but I haven't fixed it yet. Why is it that I set the subdev_id as "v4l-ox03c10-subdev0", but the node for "open video_dev" is actually "/dev/v4l-subdev2"? Is there something that I haven't configured successfully yet?

  • Hi Ying,

    That looks like an issue in your Linux driver.
    Please check with your v4l2 driver developer.

    We don't have anyone familiar with Linux drivers in the team.

  • Hi Gang,

    Thanks a lot for your assistance. I have already solved the AE problem. Recently, I need to summarize my tuning experience into a technical document and share it with my colleagues in the department. So I have some detailed questions to consult you.

    1. What do the horizontal and vertical coordinates of these three graphs represent? Why is it divided into four grayscale levels? I consulted the documentation, but it didn't elaborate much, and I still don't understand. I asked you this question before, and you said it was to assist in dtuning the AWB. However, my leader said that we must clarify all the details.

    2.What interpolation algorithm is used in the CFA? What do these bandwidths represent respectively? Could you check if my understanding is correct? Also, could you tell me the meaning of the parameters of the last picture? There is no explanation in the document.

    3.In addition, there is someone in the forum who has the same question as mine. However, I don't know him, and we are not working on the same project.

  • Hi Ying,

    What do the horizontal and vertical coordinates of these three graphs represent?

    That is Cb and Cr as in the plot.

    Why is it divided into four grayscale levels? I

    I suppose by four grayscale levels you mean you 4 lines.
    Those are for the gray patches in the color chart.

    What interpolation algorithm is used in the CFA?

    You may refer to the TRM for the CFAI details.

    What do these bandwidths represent respectively?

    This is explained in the plugin guide.

    Also, could you tell me the meaning of the parameters of the last picture?

    Which parameter is this?

    However, I don't know him, and we are not working on the same project.

    Thanks for the confirmation!

  • Hi Gang,

    1. What do the parameters "RC, GC, BC, 0R, 0G, 0B" in the manual debugging of Color Correction represent?

    2. How much should the threshold values for each pixel in the DPC module be filled? Are there any reference values? It's not written in the document.

    Thanks!

  • Hi Ying,

    1. What do the parameters "RC, GC, BC, 0R, 0G, 0B" in the manual debugging of Color Correction represent?

    I suppose you are talking about the color correction matrix.

    Those are just the matrix elements.
    Please refer to TRM for details.

    2. How much should the threshold values for each pixel in the DPC module be filled? Are there any reference values? It's not written in the document.

    That is a tuning issue.
    You may have to try it out on your sensor for detecting and correcting bad pixels.