BT656 output on ADV7391 using imx6 quad

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

BT656 output on ADV7391 using imx6 quad

Jump to solution
19,126 Views
meflo
Contributor II

Hi,

I am trying to use the adv7391 encoder to output using cvbs with am imx6 quad board. I am using the patches from https://community.freescale.com/docs/DOC-94019 (specifically the patch L3.0.35_4.1.0_GA_bt656_output_patch_2013-09-30.zip which seems to be the latest). The encoder is setup on IPU number 2 and Display 0.

The scenario is with ldb and cvbs output on a monitor connected to the encoder.

When android boots up, I get the normal image on the ldb and on the cvbs output I get the same image but with flickering scrambled image, greenish. So really bad coloring etc.

When I try to use mxc_v4l2_output, I get the following warnings:

imx-ipuv3 imx-ipuv3.1: IPU Warning - IPU_INT_STAT_5 = 0x00800000

imx-ipuv3 imx-ipuv3.1: IPU Warning - IPU_INT_STAT_10 = 0x00080000

The uboot related line is:

video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=UYVY16 video=mxcfb1:dev=ldb,800x480M@60,if=RGB24,bpp=32 video=mxcfb2:off

Any suggestion is welcome.

Thanks!

Labels (4)
1 Solution
13,335 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think the color issue should be related with your setting "imx-fbdev.legacyfb_deph=32", you can use the 32bpp setting for BT656 too:

video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=BGR32

By the way, in Android OS, the file "mxc_ipuv3_fb.c", function mxcfb_set_par(), the followed line should be un-masked, it is because Android can only support RGB frame buffer.

mxc_fbi->fb_pix_fmt = bpp_to_pixfmt(fbi->var.bits_per_pixel);  // If the OS(such as Android) can only support RGB framebuffer, un-mask this line.

View solution in original post

0 Kudos
59 Replies
6,386 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

When there is error messages "IPU_INT_STAT_5 = 0x00800000", that means IPU is not working correctly, the BT656 ouput will flick.

For Android, I think the followed two video modes should be work:

video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=RGB565 video=mxcfb1:dev=ldb,800x480M@60,if=RGB24,bpp=32

video=mxcfb0:dev=ldb,800x480M@60,if=RGB24,bpp=32 video=mxcfb1:dev=adv739x,BT656-NTSC,if=BT656,fbpix=RGB565

Can you attach the followed soucre code files:

arch\arm\mach-mx6\clock.c
arch/arm/mach-mx6/my_imx6q_board.c

drivers/mxc/ipu3/ipu_disp.c

drivers/video/mxc/mxc_ipuv3_fb.c

drivers/video/mxc/mxcfb_adv739x.c

0 Kudos
6,386 Views
meflo
Contributor II

Qiang, by any chance did you try with the data pins on DI0 to DI7?

0 Kudos
6,386 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Yes, DI0 to DI7 pins are tested, I had also tested IPU2 for BT656 interface, there should be no "IPU_INT_STAT_5 = 0x00800000" errors.

0 Kudos
6,384 Views
meflo
Contributor II

I am attaching the requested files.

Thank you

0 Kudos
6,384 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

In your ipu_disp.c, line 2429, you had lost the followed code:
  ipu_dc_write(ipu, (width - 1), DC_UGDE_3(disp));

Based on your code, I had attached the correct ipu_disp.c. you can have a try.

6,384 Views
meflo
Contributor II

! !Thanks for pointing that out, it slipped me somehow. Now, with that change you highlighted, I can use mxc_v4l2_output to display on the external monitor some video I previously captured using mxc_v4l2_capture , and it works all right. But in android I still see wrong colors, but now I don't get flickery output. I am attaching a sample video to see how it looks like now.

The cmdline I used is:

console=ttymxc1,115200 init=/init video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=RGB565 video=mxcfb1:dev=ldb,800x480M@60,if=RGB24,bpp=32 video=mxcfb2:off video=mxcfb3:off fbmem=10M vmalloc=400M androidboot.hardware=freescale rootwait imx-fbdev.legacyfb_deph=32 consoleblank=0

Video is: Dropbox - 2014-03-10 17.05.02.mp4

And by the way, can I specify the bpp for fbpix RGB565? Because I get the almost the same scrambled output on ldb aswell unless I have the bpp=32 like above for ldb (this is not related to the adv).

Thank you for your time and support.

0 Kudos
13,336 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think the color issue should be related with your setting "imx-fbdev.legacyfb_deph=32", you can use the 32bpp setting for BT656 too:

video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=BGR32

By the way, in Android OS, the file "mxc_ipuv3_fb.c", function mxcfb_set_par(), the followed line should be un-masked, it is because Android can only support RGB frame buffer.

mxc_fbi->fb_pix_fmt = bpp_to_pixfmt(fbi->var.bits_per_pixel);  // If the OS(such as Android) can only support RGB framebuffer, un-mask this line.

0 Kudos
6,384 Views
meflo
Contributor II

You are correct, BGR32 makes it display the image like expected.

There are 2 remaining issues: the resolution seems not to be the one expected (not the entire android screen is mirrored on the cvbs monitor, there is a small portion in every margin that is not shown, the image looks to be zoomed-in) although the monitor reports the input as being 480i SD; second, if I play some video using mxc_v4l2_output it plays fine but when that exits the android is no longer mirrored on the screen, it just displays garbage output all over the screen, no matter what.

Uncommenting the line like you suggested above does not change anything in regard to the 2 remaining issues.

Thank you.

0 Kudos
6,384 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For issue 1, you should check the Android overscan setting.

For issue 2, the v4l2_output will enable overlay, which will cover the background Android mirror UI; after finished v4l2_output, you should disable the overlay to make background UI appear.

0 Kudos
6,384 Views
meflo
Contributor II

Ater playing the video, I think the overlay is automatically disabled. I also try to blank fb1 just in case, using:

echo 1 > /sys/class/graphics/fb1/blank

but still same effect. It just looks like in this video I just made: Dropbox - 2014-03-11 07.46.10.mp4

0 Kudos
6,384 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

If CVBS is second display, fb1 is not its overlay.

0 Kudos
6,384 Views
meflo
Contributor II

In my case, I booted the adv on mxcfb0, so I get fb1 the overlay for my external monitor

0 Kudos
6,384 Views
meflo
Contributor II

Unfortunately, I still get the kernel hang when adv is on mxcfb1 and ldb on mxcfb0

0 Kudos
6,384 Views
meflo
Contributor II

Additional question: can the adv be used in a scenario where there would be the ldb, hdmi and the adv739x used at the same time?

0 Kudos
6,384 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The dual display with adv739x support was already verified in https://community.freescale.com/docs/DOC-94019. V4l2 output was also verified in that release.

So I don't know why you will get such already verified work issues. By the way, when I review your code, I found you had modified some code in "mxc_ipuv3_fb.c", maybe you can recover to freescale original code and try.

0 Kudos
6,384 Views
meflo
Contributor II

It turns out that setting the framebuffer structure in my board file for the adv and modifying to ".late_init = true" makes it work when adv is set to something else than fb0.

About the triple display scenario, would that work?

Thank you

0 Kudos
6,384 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The OTT TVBox board can't support triple display, but we had verified dual display on iMX6DL board with CVBS supported, so I think on iMX6DQ which has two IPUs, triple display should work too.

0 Kudos
6,384 Views
meflo
Contributor II

I am trying now the same patch on a imx6 solo board. I am getting the following behavior. When I boot with this cmdline:

console=ttymxc1,115200 init=/init video=mxcfb2:dev=adv739x,BT656-NTSC,if=BT656,fbpix=BGR32 video=mxcfb0:dev=ldb,800x480M@60,if=BGR24
video=mxcfb1:off video=mxcfb3:off fbmem=10M vmalloc=400M androidboot.hardware=freescale rootwait imx-fbdev.legacyfb_deph=32 consoleblank=0

I do not get any output on my lvds. I get the following errors:

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_5 = 0x10000000

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000

mxc_sdc_fb mxc_sdc_fb.2: IPU Warning - enable ipu 0, di 0 failed, retry.

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: timeout when waiting for flip irq

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

stmxc_sdc_fb mxc_sdc_fb.0: timeout when waiting for flip irq

omxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

pmxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

mxc_sdc_fb mxc_sdc_fb.0: MXCFB_WAIT_FOR_VSYNC: timeout 0

If I use this cmdline:

console=ttymxc1,115200 init=/init video=mxcfb1:dev=ldb,800x480M@60,if=BGR24 video=mxcfb0:off video=mxcfb3:off vmalloc=400M androidboot.hardware=freescale rootwait imx-fbdev.legacyfb_deph=32 consoleblank=0

I get output on my lvds as expected.

My ipuv3_fb_platform_data {BOARD}_fb_data structure is as follows:

<------>{ /*fb0*/

<------>.disp_dev = "ldb",

<------>.interface_pix_fmt = IPU_PIX_FMT_RGB24,

<------>.mode_str = "800x480M@60",

<------>.default_bpp = 32,

<------>.int_clk = false,

<------>.late_init = false,

<------>}, {

<------>.disp_dev = "hdmi",

<------>.interface_pix_fmt = IPU_PIX_FMT_RGB24,

<------>.mode_str = "1280x720M@60",

<------>.default_bpp = 32,

<------>.int_clk = false,

<------>.late_init = false,

<------>}, {

<------>.disp_dev = "adv739x",

<------>.fb_pix_fmt = IPU_PIX_FMT_RGB32,

<------>.interface_pix_fmt = IPU_PIX_FMT_BT656,

<------>.mode_str = "BT656-NTSC",

<------>.default_bpp = 32,

<------>.int_clk = false,

<------>.late_init = true,

<------>},

Any idea as to why this is happening?

I mention that I am applying this patch on the jb4.2.2_1.1.0-ga branch. Do you happen to have a patch for this particular branch? Or has this patch been tested only on the imx-android-13.4.1 branch?

Thank you for your support.

0 Kudos
6,384 Views
jayaramks
Contributor III

Hi,

we have a similar issue:

We are interfacing ADV7393 on IPU1 DI0, HDMI on IPU1 DI1 and LDB on IPU2 of imx6q.

1.while using boot args:

video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=RGB565 video=mxcfb2:dev=hdmi,1280x720M@60,if=RGB24 video=mxcfb1:dev=ldb,LDB-XGA,if=RGB24,bpp=24 ldb=dul0 video=mxcfb3:off

Linux works fine and we could access 3 displays.

2.but we need LDB on mxcfb0. While using boot args:

video=mxcfb1:dev=adv739x,BT656-NTSC,if=BT656,fbpix=RGB565 video=mxcfb2:dev=hdmi,1280x720M@60,if=RGB24 video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=24 ldb=dul0 video=mxcfb3:off

Linux hangs showing:

mxc_sdc_fb mxc_sdc_fb.0: register mxc display driver ldb

_regulator_get: get() with no identifier

mxc_sdc_fb mxc_sdc_fb.1: register mxc display driver adv739x

3.We tried to change .late_init = true, but kernel crashes :

mxc_sdc_fb mxc_sdc_fb.0: register mxc display driver adv739x

mxc_adv739x_setmode #1

Console: switching to colour frame buffer device 90x30

mxc_sdc_fb mxc_sdc_fb.1: register mxc display driver hdmi

mxc_hdmi mxc_hdmi: Detected HDMI controller 0x13:0xa:0xa0:0xc1

fbcvt: 1280x720@60: CVT Name - .921M9

Unable to handle kernel NULL pointer dereference at virtual address 00000000

pgd = 80004000

[00000000] *pgd=00000000

Internal error: Oops: 805 [#1] PREEMPT SMP

Modules linked in:

CPU: 0    Not tainted  (3.0.35-ts-armv7l #17)

Please help.

Regards,

Jayaram

0 Kudos
6,384 Views
frankchenmh
Contributor III

Hi jayaramks

I have the same issue as you when set LVDS as fb0 and adv7391 as fb1. The kernel hangs at:

mxc_sdc_fb mxc_sdc_fb.0: register mxc display driver ldb

_regulator_get: get() with no identifier

mxc_sdc_fb mxc_sdc_fb.1: register mxc display driver adv739x

Do you have resolved this issue?

0 Kudos
6,384 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Run BT656 and other display on same IPU, such as iMX6S or iMX6DL, there is a know issue like your debug messages.

The workround had already been released in patch "0003-Enhance-dual-display-support-for-BT656-output.patch", by the way, since you are using Android BSP, you'd better reference to r13.4.1 BSP patch. There is some special code in mxc_ipuv3_fb.c for Android only.

0 Kudos