iMX6 HW decimator not working when capturing interlaced video over mipi

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6 HW decimator not working when capturing interlaced video over mipi

1,513 Views
edison_fernande
Contributor III

Hi,

I've been working on adding support to capture 1080i60 video from the MIPI interface on an iMX6 board. For this I'm using the Toshiba TC358743 and I'm able to properly capture and deinterlace the video, this by setting params.csi_mem.interlaced properly in true so the IMDAC channel gets properly configured for interlaced video.

I need to be able to reduce the framerate and for this purpose I'm using the hardware decimator so I just drop frames right from the capture. I'm doing so by  using the IPUx_CSI0_SKIP register. I can conform it works as expected when I'm capturing any progressive resolution, however, when capturing 1080i, the IDMA channel doesn't get any data so I end up with dqueue timeout error. I also tested the decimator capturing 1080i60 but with a GS2971 which uses the parallel interface and it works with no problem so my guess is that the issue could be related to the mipi interface when capturing interlaced video. 

The weird part is that I checked the error registers and they don't report any error.

Has anyone seen such behaviour before? To me it looks like all the frames are being dropped.

Any help would be really appreciated.

Regards,

Edison

Labels (3)
0 Kudos
7 Replies

1,109 Views
joanxie
NXP TechSupport
NXP TechSupport

pls refer to the application note as below:
https://community.nxp.com/docs/DOC-332679

0 Kudos

1,109 Views
edison_fernande
Contributor III

Hi Joan Xie,

Thanks for the info. I had already followed the TVIN application notes and it helped me to get the 1080i60 mipi capture working, I'm able to properly capture (using the CSI -> SMFC -> MEM path) and then deinterlace the video. However, when I try to use the IPUx_CSI0_SKIP register to reduce the framerate, not a single frame gets to MEM (no matter the number of frames I want to drop) and I get a timeout error. It looks like all the frames are being dropped. I tested dropping frames when capturing progressive video and it works fine, the issue only happens when the input video is interlaced over MIPI and as I don't see any error message I have no idea about what could be happening.

Thanks for your help.

Regards,

Edison

0 Kudos

1,109 Views
tengri
Contributor IV

Dear edison.fernandez

Can you kindly share the changes required to support 1080i mode for kernel 4.1.x ? I am also struggeling to get it work from an HDMI encoder. Thanks 

0 Kudos

1,109 Views
edison_fernande
Contributor III

Hi Anuradha,

Unfortunately I can't share my code but I can give you some hints. 

  • The application note Joan Xie shared in a previous message is pretty useful.
  • Make sure the CSI interface is configured for non-gated clock mode.
  • Make sure the IDMA channel is configured for interlaced scan order (params.csi_mem.interlaced=true).

Hope this helps

Regards,

Edison

0 Kudos

1,109 Views
tengri
Contributor IV

Thanks alot for your reply edison.fernandez‌,

But I have a question regarding ipu_capture.c settings. There is another clock mode for interlace mode called, IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_SDR. This has been used in the capturing hardware driver as the clock mode. By further digging to this, I notice that, the only difference between above mode and the non-gated clock mode you suggest is, _ipu_csi_ccir_err_detection mechanism. In non-gated mode I see this error correction has been disabled. 

} else if ((cfg_param.clk_mode == IPU_CSI_CLK_MODE_GATED_CLK) ||
(cfg_param.clk_mode == IPU_CSI_CLK_MODE_NONGATED_CLK)) {
       ipu_csi_write(ipu, csi, (6 << 3) | (4 << 16), CSI_CCIR_CODE_1);
      _ipu_csi_ccir_err_detection_disable(ipu, csi);
}

Q1. Is the CSI_CCIR_CODE_1 correct for 1080i format ?

Q2. Why this capturing does  not work with error detection enabled ?

Thanks in Advance

Anuradha

0 Kudos

1,109 Views
edison_fernande
Contributor III

Hi Anuradha,

I'll be glad to try to help you with your issue but I think it's better if you create a new thread so we don't change the topic of this  one. Maybe you can create it and give me the link.

Now, going back to the original topic, does anyone have any advice on the hardware decimator issue I'm having when capturing interlaced video over MIPI?

Has anyone ever used this configuration before? Capturing 1080i (or just interlaced) video over mipi and then try to drop frames using the hardware decimator?

Any help would be appreciated.

Regards,

Edison

0 Kudos

1,109 Views
tengri
Contributor IV

Sorry edison.fernandez !‌, thought this was an 'assumed answer' post ! 

0 Kudos