glTexDirectVIVMap memory leak issue in imx6-imx_3.0.35_4.1.0

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

glTexDirectVIVMap memory leak issue in imx6-imx_3.0.35_4.1.0

1,297 Views
jasonchenchen
Contributor I

Hi All,

RT.

In our project, we used glTexDirectVIVMap to reduce CPU load, but we found it caused memory leak issue,

how to fix it?  is there the existed patch to fix it?

Source code as follow:

=============================================

v4l2_buffer    v4l2buf;

/* v4l2 setup: MMAP memory mode */

if (ioctl(fd_v4l, VIDIOC_DQBUF, &v4l2buf) < 0)
{
printf("line=%d, fd_v4l, VIDIOC_DQBUF error!!!\n", __LINE__);
return -1;
}

GLuint physical = ~0U;

/* m_pvirtualaddr: mmap(xxx) from V4L2 DMA address, just do mmap one time when v4l2 setup */

glTexDirectVIVMap(GL_TEXTURE_2D, g_cap_width, g_cap_height,
                                          GL_VIV_UYVY, (GLvoid**)&(m_pvirtualaddr), &physical); 

=============================================

Labels (2)
0 Kudos
2 Replies

713 Views
thomasmcguire
Contributor II

I can confirm this memory leak on Kernel 4.1.15-1.1.0.

We stumbled upon the problem when displaying analog camera video with QtGStreamer. The workaround is to pass the actual physical address to glTexDirectVIVMap(), instead of ~0U. I've created a patch for QtGStreamer here: Bug 730863 – qtvideosink: add i.MX6 zero-copy rendering implementation .

Note that this is just a workaround, and seems to work fine - however the real issue is clearly a Kernel bug, since the memory isn't even freed when the process exits.

0 Kudos

713 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jason

L3.0.35_4.1.0 has memory leak issues as answered by experts on

Long running vpu task with memory leak bug on imx6 

one can try L3.0.101

http://www.nxp.com/webapp/Download?colCode=L3.0.101_4.1.1_SOURCE_BSP&appType=license&location=null&P... 

however highly recommended to migrate to new kernels where this is fixed.

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

0 Kudos