IMX6Q Interlaced TVIN bt656

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX6Q Interlaced TVIN bt656

4,631 Views
matthewreynolds
Contributor III

Greetings,

I am working with a custom board based on the IMX6Q SaberSD.  Our board uses the 8-bit bt656 parallel input (without external HS/VS) and 8-bit bt656 output with interlaced NTSC video.   I got the output working from the patch (Patch to Support BT656 and BT1120 Output For i.MX6 BSP) but, am struggling with the parallel input.  I used the adv7180 driver as a reference and made a few modification to configure parallel mode and interlaced.  In the function ioctl_g_ifparm I set the "p->u.bt656.bt_sync_correct = 0;" to use internal syncs and set "p->u.bt656.clock_curr = 0;" so mxc_v4l2_capture.c will use IPU_CSI_CLK_MODE_CCIR656_INTERLACED.

Testing the video capture and preview with " /unit_tests/mxc_v4l2_tvin.out -ow 720 -oh 480 -ot 1 -ol 1 -f UYVY" there are a few issues with the video.

- It is continuously rolling vertically

- Colours are incorrect.  It looks like it is drawing in the wrong color space?

//My output device tree entry

bt656@0 {

        compatible = "fsl,bt656";

        ipu_id = <0>;

        disp_id = <0>;

        default_ifmt = "BT656";

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_ipu1_1>;

        status = "okay";

    };

//My input device tree entry

    bt656In {

        compatible = "fsl,bt656in";

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_ipu1_2>;

        clocks = <&clks 201>;

        clock-names = "csi_mclk";

        csi_id = <0>;

        mclk = <27000000>;

        mclk_source = <0>;

    };

Is there a problem with this configuration?  The only warning message printed is "imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001".  Below is the log of the mxc_v4l2_tvin.out test.

Sincerely,

Matthew

/unit_tests/mxc_v4l2_tvin.out -ow 720 -oh 480 -ot 0 -ol 1 -f UYVY
TV decoder chip is bt656_tvinIn mxc_v4l2_s_std b000

In mxc_v4l2_s_std b000
driver=mxc_vout, card=DISP3 FG, bus=, version=0x00030a11, capabilities=0x04000002
fmt RGB565: fourcc = 0x50424752
fmt BGR24: fourcc = 0x33524742
fmt RGB24: fourcc = 0x33424752
fmt RGB32: fourcc = 0x34424752
fmt BGR32: fourcc = 0x34524742
fmt NV12: fourcc = 0x3231564e
fmt UYVY: fourcc = 0x59565955
fmt YUYV: fourcc = 0x56595559
fmt YUV422 planar: fourcc = 0x50323234
fmt YUV444: fourcc = 0x34343459
fmt YUV420: fourcc = 0x32315559
fmt YVU420: fourcc = 0x32315659
fmt TILED NV12P: fourcc = 0x50564e54
fmt TILED NV12F: fourcc = 0x46564e54
fmt YUV444 planar: fourcc = 0x50343434
start time = 1398310913 s, 967905 us
imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001
imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001


Edit

On further investigation I don't believe the foreground buffer, fb1 is initialized correctly.

# cat /sys/class/graphics/fb1/name

DISP3 FG

# cat /sys/class/graphics/fb1/mode

<empty.>

# cat /sys/class/graphics/fb1/modes

U:712x480p-13
U:240x320p-60

In the device tree I had set disp_dev = "off"; to mxcfb2, mxcfb3 and mxcfb3.  I am going to try to re-enable the hdmi device on mxcfb2.  Hopefully,  that will initialize the buffer and correct the video preview.

Edit 2:

A colour space conversion from the UYVY foreground layer to the bt656 RGB565 output seems to be the problem.  I got the foreground layer to display with correct colours by changing the fbpix format from RGB565 to UYVY16 using u-boot variables.  However, as a consequence the background layer does not draw correct, since it needs to be RGB565. 

In u-boot I changed the video variable from

video=mxcfb0:dev=bt656,BT656-NTSC,if=BT656,fbpix=RGB565

to

video=mxcfb0:dev=bt656,BT656-NTSC,if=BT656,fbpix=UYVY16


I am still not sure how to configure the system so the background and overlay display correct.

Tags (3)
4 Replies

253 Views
YixingKong
Senior Contributor IV

Mattew

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 Kudos

253 Views
matthewreynolds
Contributor III

Yixing,

Yes, I was able to work it out.

Thank You,

Matthew

0 Kudos

253 Views
matthewreynolds
Contributor III

I was able to fix the vertical video scrolling by changing  active _top = 13 to  active_top = 3 in the mxc_v4l2_capture.c driver.  This was mentioned as a work around in a few other discussion.

I still could use some help with configuring the foreground and background displays.   Both layers will be used in our application.

253 Views
matthewreynolds
Contributor III

Instead of focusing on the drivers and the mxc_v4l2_tvin.out test utility, I was to solve the color problem by configuring the framebuffer for RGB565 and using the gstreamer plugin mfw_ipucsc in our application to perform the color space conversion.


Here is a test pipeline

gst-launch tvsrc ! 'video/x-raw-yuv,width=720,height=480,framerate=30/1' ! mfw_ipucsc ! 'video/x-raw-rgb,bpp=16,width=720,height=480,framerate=30/1' ! mfw_v4lsink disp-width=720 disp-height=480 device=/dev/video17