QtMediaplayer Qt-5.12.4 play movies physical memory leak

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

QtMediaplayer Qt-5.12.4 play movies physical memory leak

1,393 Views
liqun_wei
Contributor III

Yocto-4.14.78

Kernel version: 4.14.78

Qt version: 5.12.4

We are using QtMeidiaPlayer to play movies, such as avi, mp4, mkv, h264 and so.

It's about one hour after we start playing moveis, some log occurs as the following:

[  603.278905] cma: cma_alloc: alloc failed, req-size: 338 pages, ret: -12

[  603.285713] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!

[  603.292248] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!

[  603.302766] cma: cma_alloc: alloc failed, req-size: 338 pages, ret: -12

[  603.309873] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!

[  603.316795] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!

Our board's configuration is:

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.78 (jenkins@buildhost) (gcc version 7.3.0 (GCC)) #1 PREEMPT Thu Aug 15 09:45:28 CST 2019
[ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Freescale i.MX6 DualLite SABRE Smart Device Board
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Reserved memory: created CMA memory pool at 0x3c000000, size 320 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm/kernel/devtree.c:157 arm_dt_init_cpu_maps+0x114/0x16c
[ 0.000000] DT /cpu 2 nodes greater than max cores 1, capping them
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.14.78 #1
[ 0.000000] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)

[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 260096
[ 0.000000] Kernel command line: console=ttymxc0,115200 consoleblank=0 display=video=mxcfb0:dev=lcd,1024x600@60,if=RGB24,bpp=32 gpumemsize=128 GPU3DMinClk=8 ldo-mode-activate=1 fec_mac=80:7A:7F:02:97:5D logoType=1 ubi.mtd=9 root=ubi0:rootfs ro rootfstype=ubifs rootflags=sync mtdparts=gpmi-nand:8m(boot),1m(mac),1m(parameter),8m(kernel),1m(dtb),25m(minimal_system),1m(tmpdata_partition),140m(user_partition),35m(sys_config_partition),500m(rootfs),-(update) hardwareID=0x36
[ 0.000000] logoType_setup enter s=1 logoType = 1
[ 0.000000] hardwareID_setup enter str=0x36
[ 0.000000] Genway: HGI16 project, phase 2.0.
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 697856K/1048576K available (8192K kernel code, 431K rwdata, 2576K rodata, 1024K init, 413K bss, 23040K reserved, 327680K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc0800000 - 0xff800000 (1008 MB)
[ 0.000000] lowmem : 0x80000000 - 0xc0000000 (1024 MB)
[ 0.000000] pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
[ 0.000000] modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
[ 0.000000] .text : 0x80008000 - 0x80900000 (9184 kB)
[ 0.000000] .init : 0x80c00000 - 0x80d00000 (1024 kB)
[ 0.000000] .data : 0x80d00000 - 0x80d6bea0 ( 432 kB)
[ 0.000000] .bss : 0x80d6d000 - 0x80dd44d4 ( 414 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Tasks RCU enabled.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16

And here is some advice from QT technical support:

it might be related to iMX6 kernel issues, would it be possible to know the version of linux kernel? or disk caches to fix,

      for n in 1 2 3 ; do echo $n > /proc/sys/vm/drop_caches ; done 

Also if there is reproducible leak, need to create as simple as possible application, make a bug report and provide the example to us.

Try the following tips from NXP:

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.nxp.com%2Fthread%2F48505...

We have tried these advices,but we still failed to play after the kernel shows the same error log.

That's all information about this issue, how could it be and how can I fix it?

It there any solution?

Any help would be appriciated.

Thank you!

0 Kudos
2 Replies

1,145 Views
liqun_wei
Contributor III

https://community.nxp.com/thread/316510
Does 3.14.52 fix this problem ? How about 4.14.78 ?

https://community.nxp.com/thread/304368
https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2Fwandboard-org%2Flinux%2F...
Does this patch work for kernel 4.14.78 ?

I have tried many times, when these logs occur

20190820_11:19:25[ 938.505514] cma: cma_alloc: alloc failed, req-size: 765 pages, ret: -12
20190820_11:19:25[ 938.512150] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!
20190820_11:19:25[ 938.520212] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!
20190820_11:19:25[ 938.529687] cma: cma_alloc: alloc failed, req-size: 765 pages, ret: -12
20190820_11:19:25[ 938.536879] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!
20190820_11:19:25[ 938.543416] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!

Use command:

for n in 1 2 3 ; do echo $n > /proc/sys/vm/drop_caches ; done

will never solve the problem. before we execute the command, 

20190820_11:19:44root@imx6solosabresd:/tmp/runnn# free -h
20190820_11:19:44 total used free shared buff/cache available
20190820_11:19:44Mem: 1.0G 474M 204M 5.2M 323M 511M
20190820_11:19:44Swap: 0B 0B 0B

After execute the command,

20190820_11:19:52[ 965.838359] sh (858): drop_caches: 1
20190820_11:19:52[ 965.871851] sh (858): drop_caches: 2
20190820_11:19:52[ 965.890224] sh (858): drop_caches: 3
20190820_11:19:54[ 965.890224]abresd:/tmp/runnn# free -h
20190820_11:19:55root@imx6solosabresd:/tmp/runnn# free -h
20190820_11:19:55 total used free shared buff/cache available
20190820_11:19:55Mem: 1.0G 472M 476M 2.0M 53M 517M
20190820_11:19:55Swap: 0B 0B 0B

We can see the cache has been released, but we still failed to allocate physical memory,and if we try to play again, the same message we get as the following,

20190820_11:20:00[ 974.003600] cma: cma_alloc: alloc failed, req-size: 149 pages, ret: -12
20190820_11:20:00[ 974.010234] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!
20190820_11:20:00[ 974.020861] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!
20190820_11:20:00[ 974.030328] cma: cma_alloc: alloc failed, req-size: 149 pages, ret: -12
20190820_11:20:00[ 974.037348] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!
20190820_11:20:00[ 974.044350] mxc_vpu 2040000.vpu_fsl: Physical memory allocation error!

So, anyone can help?

0 Kudos

1,145 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

Just to say that I am reviewing this.

Best regards,

Diego.

0 Kudos