When V4L2 output "width = 1280, height = 720", camera screen is splitted in the vertical middle of screen

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

When V4L2 output "width = 1280, height = 720", camera screen is splitted in the vertical middle of screen

3,228 Views
YoufuHu
Senior Contributor I

[Background]

The LCD resolution is 1280x720, so we need capture Camera video as 1280x720 via V4L2 interface.When we capture the camera, find the warning messages "imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned" scroll on serial console frequently, the camera screen is splitted in the vertical middle of screen, detailed see attached files.

BTW,another LCD resolution is 800x480,  there is no warning message and the camera screen is normal.

[Question]

How to show the normal camera screen via V4L2 on LCD resolutin of 1280x720

[Related code]

If ((fd_output_v4l = open("video17", O_RDWR, 0)) < 0)

{

ERROR("Unable to open %s\n", EARLY_RVC_DEV_VD_OUPTPUT);

return -1;

}

crop.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;

crop.c.top = top;

crop.c.left = left;

crop.c.width = width;

crop.c.height = height;

if (ioctl(fd_output_v4l, VIDIOC_S_CROP, &crop) < 0)

{

ERROR("set crop failed\n");

return -1;

Tags (1)
0 Kudos
Reply
9 Replies

2,211 Views
igorpadykov
NXP Employee
NXP Employee

Hi Youfu

please recheck that lcd is correctly integrated using examples below

https://community.freescale.com/thread/355690

https://community.freescale.com/thread/373763

Best regards

igor

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

Note: If this post answers your question, please click the Correct Answer button. Thank you!

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

0 Kudos
Reply

2,211 Views
YoufuHu
Senior Contributor I

Thank you igor for your reply my question

We use kernel version on 3.0.35.

Our LCD Panel via LDB interface show the correct  1280x720 resolution when not show camera.

The warning message “imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned” only show when capture camera  on v4l2 overlay.

It may be concerned with the non-aligned accesses

Best regards

youhu hu

0 Kudos
Reply

2,211 Views
igorpadykov
NXP Employee
NXP Employee

I believe one can try to check sources csi_v4l2_overlay.c

Index of /buildsources/i/imx-test/imx-test-3.0.35-4.0.0

Best regards

igor

0 Kudos
Reply

2,211 Views
YoufuHu
Senior Contributor I

we have describe the issues as the "V4l2_TestCode_Issue.xlsx" ,Pls help us how to fix it

0 Kudos
Reply

2,211 Views
davidfincher
Contributor II

hi,Youfu Hu

            Are u solve the problem?

0 Kudos
Reply

2,211 Views
YoufuHu
Senior Contributor I

Thanks igor for your suggestion。

Our product don't use overlay mode, but use output mode,Some as Index of /buildsources/i/imx-test/imx-test-3.0.35-4.0.0  imx-test-3.0.35-4.0.0\test\mxc_v4l2_testmxc_v4l2_output.c

We compile this mxc_v4l2_testmxc_v4l2_output.c soucecode with gcc, but it failed when

1-1. cropcap.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 

    if (ioctl(fd_v4l, VIDIOC_CROPCAP, &cropcap) < 0)

    {

            printf("get crop capability failed\n");

            retval = TFAIL;

            goto err1;

    }

We checked our kernel 3.0.35 mxc_v4l2_capture.c, the cropcap.type =  V4L2_BUF_TYPE_VIDEO_OUTPUT  is not supported

,So delete it

case VIDIOC_CROPCAP: {

  struct v4l2_cropcap *cap = arg;

  pr_debug("   case VIDIOC_CROPCAP\n");

  if (cap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE &&

     cap->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) {

  retval = -EINVAL;

  break;

  }

  cap->bounds = cam->crop_bounds;

  cap->defrect = cam->crop_defrect;

  break;

  }

1-2. Also we have deleted this code because our yuv raw file dont have header.

if (g_bmp_header) {

   fseek(in, 0x36, SEEK_CUR);

  }

1-3. Change the default fmt to UYVY

uint32_t g_in_fmt = V4L2_PIX_FMT_UYVY;

Detailed see the mxc_v4l2_output.c which I will post.

2.Execute command

./mxc_v4l2_output -d /dev/video17 -iw 720 -ih 480 -ow 1280 -oh 720 -ot 0 -ol 0 -l 10000 /udisk1/f3.yuv

find the warning messages "imx-ipuv3 imx-ipuv3.0: IDMAC12's EBA0 is not 8-byte aligned" scroll on serial console frequently, the yuv content screen is splitted in the vertical middle of screen, detailed see attached files show_result1.jpg、show_result2.jpg 。

So How to fix it

0 Kudos
Reply

2,210 Views
igorpadykov
NXP Employee
NXP Employee

one can try to arrange buffer with 8-byte alignment, also please check

RM Table 37-14. Channel Parameters for some alignment

requirements.

~igor

0 Kudos
Reply

2,210 Views
YoufuHu
Senior Contributor I

It's urgent,

Could you have strategy to fix it 。

0 Kudos
Reply

2,210 Views
YoufuHu
Senior Contributor I

Hi igor,

we use the mxc_v4l2_testmxc_v4l2_output.c sourcecode from Index of /buildsources/i/imx-test/imx-test-3.0.35-4.0.0  .which Channel Parmeters are not 8-byte alignment

0 Kudos
Reply