About error message from V4L2 capture in i.MX6DQ.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

About error message from V4L2 capture in i.MX6DQ.

跳至解决方案
1,520 次查看
keitanagashima
Senior Contributor I

Dear All,

Hello. I have a question about the error message from V4L2 capture in i.MX6DQ.

Could you confirm this question?

[Overview]

The LCD resolution is 1280x720, so we need capture Camera video as 1280x720 via V4L2 interface.

When we capture the video, find the warning messages scroll on serial console frequently, but the capture result is OK.

Although the function seems OK, but what does the warning message means?

If width = 800,  height = 480, there is no warning "imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned".

If width = 1280, height = 720, there is warning "imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned".

[Question]

When width = 1280, height = 720, how to eliminate the warning?

[Related code (BSP: L3.0.35_4.1.0)]

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;

}

Best Regards,

Keita

标签 (3)
0 项奖励
回复
1 解答
1,127 次查看
Yuri
NXP Employee
NXP Employee

Hello,

  Yes, the visual effect observed ("width = 1280, height = 720") may be concerned

with the non-aligned accesses. As has been discussed, the issue relate to Linux

memory allocation mechanism, therefore to solve it please apply to professional

service.

NXP Professional Services|NXP

Regards,

Yuri.

在原帖中查看解决方案

8 回复数
1,127 次查看
Yuri
NXP Employee
NXP Employee

Hello,

    According to i.MX6 RM (say, Table 37-14. Channel Parameters Memory for non-interleaved) :
The actual physical address value (of EPBA) is divided by 8 (i.e. only bits [31:3] of the actual

address are used).

  So, parameter “width” x “bytes_per_pixel” should be divisible by 8,

in order to get aligned addresses of the frame buffers. 

Have a great day,
Yuri

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

0 项奖励
回复
1,127 次查看
keitanagashima
Senior Contributor I

Hi Yuri,

Sorry for my delay response.

When "width = 1280, height = 720", the actual physical address value (of EPBA) is not divided by 8.

However, the way we apply the memory is as follows:

struct v4l2_requestbuffers buf_req;

buf_req.count = 4;

buf_req.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;

buf_req.memory = V4L2_MEMORY_MMAP;

ioctl(fd_output_v4l, VIDIOC_REQBUFS, &buf_req);

Debugg  information is as follows :

[    5.386728] imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned. addr0=403703204

[    5.557222] imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned. addr0=404751780

[    5.730014] imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned. addr0=405800356

[    6.107377] imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned. addr0=406848932

So, I don't know how to intervene the memory address allocation can be divisible by 8.

And what to do to eliminate the warning message.

Best Regards,

Keita

0 项奖励
回复
1,127 次查看
Yuri
NXP Employee
NXP Employee

Hello,

    since standard Linux malloc() function does not provide aligned memory address,

it is needed to apply own / manual memory allocation for frame buffers.

http://stackoverflow.com/questions/1919183/how-to-allocate-and-free-aligned-memory-in-c

Regards,

Yuri.

0 项奖励
回复
1,127 次查看
keitanagashima
Senior Contributor I

Hi Yuri,

I could not find the source code which allocates these memory, please help me confirm it, and how to modify the code to make the memory can be divisible by 8?

Best Regards,

Keita

0 项奖励
回复
1,127 次查看
Yuri
NXP Employee
NXP Employee

Hello,

Perhaps, the simplest way is to comment warning in sources, assuming

there are no visible issues on the screen.

The message is located in file

  

/drivers/mxc/ipu3/ipu_param_mem.h

Regards,

Yuri.

0 项奖励
回复
1,127 次查看
keitanagashima
Senior Contributor I

Dear Yuri,

Please re-open for this topic.

When V4L2 output "width = 1280, height = 720", camera screen is splitted in the vertical middle of screen, detailed see attached files.

When "width = 800, height = 480", camera screen is normal.

So I think It's a relationship with this warning message "imx-ipuv3 imx-ipuv3.0: IDMAC9's EBA0 is not 8-byte aligned".

Please confirm this new found issue.

Best Regards,

Keita

0 项奖励
回复
1,128 次查看
Yuri
NXP Employee
NXP Employee

Hello,

  Yes, the visual effect observed ("width = 1280, height = 720") may be concerned

with the non-aligned accesses. As has been discussed, the issue relate to Linux

memory allocation mechanism, therefore to solve it please apply to professional

service.

NXP Professional Services|NXP

Regards,

Yuri.

1,127 次查看
Yuri
NXP Employee
NXP Employee

Hello,

this is general Linux issue.
I created request 00073230 for working with it.

Regards,

Yuri.

0 项奖励
回复