Hi all,
We're using the VPU for video decoding and discovered an interesting problem(s).
Let's say we have an App1 and App2, both are using libimxvpuapi to decode video frames. Consider the following scenario:
After some time the App2 will fail to allocate memory to decode frames with the following messages:
mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!
After a quick look at the VPU driver source code (drivers/mxc/mxc_vpu.c) we figured that this happens because all the allocated memory is freed only when there're no references to the /dev/mxc_vpu file (basically on the last call to vpu_release()). This means that when the App2 crashes - the memory, that was allocated for it, isn't released. Hence we have a memory leak.
Therefore I've got a couple of questions:
Hardware used:
A custom i.MX6DP-based board.
Software used:
imx-vpu 5.4.38
Linux Kernel 4.9.11
The latest BSP that is based on 4.14.98 Linux Kernel has the same vpu_release() code, so I don't expect this issue to be addressed there.
Hi Rostyslav
libimxvpuapi is community project not supported by nxp, issue may be
posted on Issues · Freescale/libimxvpuapi · GitHub
Alternatvely one can try with nxp gstreamer "imx-gst1.0-plugins", usage
is described in Linux Guide included in Linux 4.19.35_1.1.0 Documentation
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
Thank you for reaching back.
However, as you may see from my post it is the driver that leaks memory, not the library being used. In particular, the vpu_release(), which is called every time a descriptor for /dev/mxc_vpu is closed. I don't see how trying Gstreamer plugins would help here.
Hi Rostyslav
please try to reproduce issue with official nxp gstreamer "imx-gst1.0-plugins", usage
is described in Linux Guide included in Linux 4.19.35_1.1.0 Documentation
Best regards
igor