IMX6ULL - CSI NTSC Interlaced Capture

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

IMX6ULL - CSI NTSC Interlaced Capture

6,823 Views
rick_man
Contributor II

Hi 

We have NTSC video decoder giving BT656 input, we have verified the decoder is outputting correct, 

Following IMX6UL TRM, 

i.mx6ul CSI receive interlace ccir656 video issue   and iMX7D : NTSC Video Capture 

both doesn't answer the conclusion how 

We tried as per the https://community.nxp.com/thread/473846 we even used the patch which was supplied by NXP, however their input was PAL, not NTSC.

Question we have

  1. How to configure Deinterlace stride should it be (720*2/8) ?
  2. How De-interlace stride and FBUF_STRIDE related. We saw CMA size is having effect in the DMA operations.
  3. We want to capture BT656 NTSC 525/60 signal with deinterlaced enabled.

Is there any programming guide we can follow? 

Answer from dh29‌ about this forum, we tried, then we get some output but its garbled. 

Thank you in advance, 

Labels (1)
18 Replies

5,548 Views
rick_man
Contributor II

Hi weidong.sun‌,

We really appreciate your response, but we want answer on below.

Question we have

  1. How to configure Deinterlace stride should it be (720*2/8) ?
  2. How De-interlace stride and FBUF_STRIDE related. We saw CMA size is having effect in the DMA operations.
  3. We want to capture BT656 NTSC 525/60 signal with deinterlaced enabled.
  4. Why when we set FBUF_STRIDE to zero it works? Is there any calculation we need to do?

It would be really helpful if we have some example, with NTSC and PAL both BT656 input, taken as example and walk through the desired configuration with de-interlacer enabled. 

Best Regards, 

-Rick

0 Kudos
Reply

5,547 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi richman,

   Below is reply form i.MX Expert team:

-------------------------------------------------------

ou can reference to followed patch, the CSI module and driver are same for iMX6ULL and IMX6UL, and PAL is more easy than NTSC to support:  https://community.nxp.com/docs/DOC-330092

-------------------------------------------------------

   Document on the link is what I had sent to you before. this is our internal link, probably you couldn't access it. so I had to copy it and send to you.

   After you patch it to your kernel, you can run images, then you will see all configurations for BT.656.

Have a nice day!

Best Regards,

weidong sun

0 Kudos
Reply

5,547 Views
rick_man
Contributor II

Hello weidong.sun

Please provide me access to this document, we are having lots of delay due to this lack of information and our production is delayed due to this. 

Please provide a way to move forward, 

Thanks,

-Rick

0 Kudos
Reply

5,547 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Rick,

    Did you receive those documents ? I remember you sent an email to me, asking for them, and I replied you.

Have a nice day!

NXP TIC weidong

0 Kudos
Reply

5,547 Views
liyu1
Contributor III

This website can't be opened !

0 Kudos
Reply

5,547 Views
liyu1
Contributor III

Hi wei dong:

       I also need this patch file and documentation, thank you!  My email is    542270618@qq.com

0 Kudos
Reply

5,547 Views
pavelbats
Contributor I

Hello Wigro,

Can you provide this patches and other documents for BT656?

Will it work on linux 4.14?

-Pavel

0 Kudos
Reply

5,547 Views
rick_man
Contributor II

Hello Wigro, 

I didn't receive your document. Please provide me access to the document. 

-Rick

0 Kudos
Reply

5,547 Views
rick_man
Contributor II

Hello weidong.sun

I am unable to access the document, it says unauthorized. How to access this document? 

Thanks,

-Harshesh

0 Kudos
Reply

5,547 Views
rick_man
Contributor II

Hello weidong.sun

Sorry for late reply, the document you linked I am unable to access it. Could you please share the details how can I download it? 

Thanks,

-Rick 

0 Kudos
Reply

5,547 Views
rick_man
Contributor II

Any update how I can access the content? Should I send email to you??

0 Kudos
Reply

5,547 Views
rick_man
Contributor II

dh29igorshakirov‌ any comments? 

0 Kudos
Reply

5,547 Views
dh29
Contributor IV

Hi rickman,

I see that you are using an i.MX6, which has an IPU, where I am using an i.MX7 without an IPU. As such the Linux framework used to process the CSI-MIPI is completely different.

I've finally got the i.MX7 working for both PAL and NTSC using the ADV7280 in PROGRESSIVE mode. See my post https://community.nxp.com/thread/480516 which I have just updated with how I got NTSC finally working. Unfortunately I don't think this will help your problem!

0 Kudos
Reply

5,547 Views
rick_man
Contributor II

Hi dh29

No i am using IMX6ULL, and I followed your recent NTSC update hardcodinig the NTSC resolution instead of 480, and now I see some problem, but mostly due to my wrong configuration. 

I think you and I are both in same page and same domain, yours is IMX7D and our platform is IMX6UL. 

Thanks,

-Rick

0 Kudos
Reply

5,547 Views
dh29
Contributor IV

Hi Rick,

Ah, I didn't realize that the i.MX6ULL also doesn't have an IPU. I'm afraid I only have experience of the i.MX7.

For the i.MX7 I used the Linux 'sub-device' framework i.e. /drivers/media/platform/mxc/subdev. I had to write a driver for the ADV7280, which I based on 'ov5647_mipi.c' and 'ov5640_mipi.c'. I also patched file 'mx6s_capture.c':

  • For NTSC, I hard-coded the image size within function csi_set_imagpara() to 720x507. Its 507 because my Composite-Video to MIPI chip (ADV7280) is configured as a PROGRESSIVE output. I'm not sure what you would need for INTERLACED as you would get heights of 253 & 254.
  • I had to add a definition for YUYV-16 (format used by the ADV7280) in 'struct mx6s_fmt'
  • I also had to set both FBUF_STRIDE and DEINTERLACE_STRIDE to zero i.e. Register CSI_CSIFBUF_PARA = 0x00. [This contradicts the i.MX7 manual, which I find very poorly written with regard to the CSI MIPI sections.]

I then also ignored the i.MX V4L2 test applications.[I couldn't get them to work properly, and as I'm not building using YOCTO (I'm using BuildRoot) I kept having to jump back to a YOCTO build-system to re-compile the test-apps.] Instead I used gstreamer-1.0 for testing. The following was used to capture 3 frames to a file:

gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=3 ! 'video/x-raw,format=(string)UYVY,width=(int)720,height=(int)507' ! filesink location=./tmp1

One of the problems I found of getting support on this forum regarding Video-Capture is that you can get 'answers' that are very specific to a particular Linux build / i.MX / capture-Device, which can be very misleading for your own platform. [I include my own answers here!] Hopefully something might help trigger a solution for you.

0 Kudos
Reply

5,548 Views
dh29
Contributor IV

HI Rick,

Just to correct my statement:

  • I had to add a definition for YUYV-16 (format used by the ADV7280) in 'struct mx6s_fmt'

I should have said that I added a definition for UYVY8_2X8 in struct mx6s_fmt as part of module mxc_mipi_csi.c:

static const struct csis_pix_format mipi_csis_formats[] = {
{
   .code = MEDIA_BUS_FMT_YUYV8_2X8,
   .fmt_reg = MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
   .data_alignment = 16,
},
{
   .code = MEDIA_BUS_FMT_VYUY8_2X8,
   .fmt_reg = MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
   .data_alignment = 16,
},
{
   .code = MEDIA_BUS_FMT_UYVY8_2X8,
   .fmt_reg = MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
   .data_alignment = 16,
},
{
   .code = MEDIA_BUS_FMT_SBGGR8_1X8,
   .fmt_reg = MIPI_CSIS_ISPCFG_FMT_RAW8,
   .data_alignment = 8,
}
}; 

0 Kudos
Reply

5,548 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello rickman,

   See below, please!

------------------

pastedImage_1.png

--------------------------------------------------------------

If you don't have files in attachments, you can  submit a case to me via our salesforce system, I will send them to you by email!

You can follow below steps to submit your case:

1. open the link

https://www.nxp.com/support/support:SUPPORTHOME

2.In the middle of web page, under "Support Requests",Press "Go to Tickets"。

3.Log in;or register a new account,log in personal emal to validate information。

4.Log in web via account,Press "Add a folder"

5.after success, Add a new case? to submit a new question

Best Regards,

weidong sun

0 Kudos
Reply

5,548 Views
haifeng_jin
Contributor III

hi  wigros:

               我找不到你的这个关于i.mx6ul porting的网页,上面的下载不到,你能分享一下吗,我的邮箱haifeng.jin@cecport.com

0 Kudos
Reply