Hi
I have an issue with vpudec ... It never work for me ...
I have no idea what is good way for fixing it ...
Traces :
GST_DEBUG=3 gst-launch-1.0 filesrc location=/tmp/a/video/less_small.mp4 ! 'video/quicktime' ! aiurdemux ! 'video/x-h264,weigth=480,height=270' ! vpudec ! glimagesink
Setting pipeline to PAUSED ...
====== VPUDEC: 4.5.1 build on Jul 9 2020 15:00:11. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Jul 9 2020 11:12:16)
vpulib: 1.1.1
firmware: 1.1.1.65535
0:00:00.196885888 4941 0xaaaad469f230 ERROR default gstallocatorphymem.c:149:base_alloc: Allocate phymem 16777232 failed.
0:00:00.196947088 4941 0xaaaad469f230 ERROR default gstvpu.c:90:gst_vpu_allocate_internal_mem: Could not allocate memory using VPU allocator
0:00:00.197042608 4941 0xaaaad469f230 ERROR vpu_dec_object gstvpudecobject.c:338:gst_vpu_dec_object_start:<vpudecobject0> gst_vpu_allocate_internal_mem fail
0:00:00.197073088 4941 0xaaaad469f230 WARN videodecoder gstvideodecoder.c:2533:gst_video_decoder_change_state:<vpudec0> error: Failed to start decoder
ERROR: Pipeline doesn't want to pause.
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayVivFB\)\ gldisplayvivfb0";
ERROR: from element /GstPipeline:pipeline0/GstVpuDec:vpudec0: Could not initialize supporting library.
Additional debug info:
../../../../git/gst-libs/gst/video/gstvideodecoder.c(2533): gst_video_decoder_change_state (): /GstPipeline:pipeline0/GstVpuDec:vpudec0:
Failed to start decoder
Setting pipeline to NULL ...
Freeing pipeline ...
Some information which can help you for helping me :
# uname -a
Linux 4.19.35-sdtv-warrior-conf #1 SMP PREEMPT Mon Sep 21 10:32:38 UTC 2020 aarch64 GNU/Linux
# cat /proc/meminfo | grep Cma
CmaTotal: 983040 kB
CmaFree: 709652 kB
# gst-inspect-1.0 --version
gst-inspect-1.0 version 1.16.0
GStreamer 1.16.0
Unknown package origin
# gst-launch-1.0 --version
gst-launch-1.0 version 1.16.0
GStreamer 1.16.0
Unknown package origin
What can I add ?
Thanks for your help
Best regards,
Cedric T
Solved! Go to Solution.
Hi igorpadykov
Yes with official bsp it is working. My issue come from my integration in my yocto env.
I found the issue and for other user I will try explain my issue.
1 - What was my problem :
VPUdec gstreamer module failed to malloc memory
2 - My fix :
I must to synchronised all these recipes to same bsp version (me i synchronized with warrior version)
linux-imx
inux-imx-headers
imx-vpuwrap
imx-vpu-hantro
And in conf/machine/include/imx-base.inc check var MACHINEOVERRIDES_EXTENDER_mx8mq, imxvpuhantro should be inside it.
3 - Why I met these issues
My yocto env was created for raspberry board, and more later I had support for nxp board.
My reference was poky version thud. But I met an issue with nxp tee with this version so I upgrade kernel, optee-os, optee-client to warrior version for fixed it.
linux-imx and inux-imx-headers was not more synchronised and vpu didnt work anymore
4 - Some line for testing vpu:
This two line is working for me now.
Add package imx-test
/unit_tests/VPU/hantro/hx170dec -Oout /tmp/a/video/15.Papaoutai.avi
With gstreamer
GST_DEBUG=3 gst-launch-1.0 filesrc location=/tmp/a/video/less_small.mp4 ! 'video/quicktime' ! aiurdemux ! 'video/x-h264,weigth=480,height=270' ! vpudec ! glimagesink
Best regards,
Cedric T
Hi,cedric_thamin, I have the same problem with imx8mp custom board and yocto zeus linux.
Could you provide detailed instruction what to do to make it work, How to syncronise versions? do i have to rebuild the image.
i try to follow this instruction to build (because i have solidrun kit).
https://github.com/SolidRun/meta-solidrun-arm-imx8/tree/zeus-imx8mp
Hi
For this package list you should compare version build in you env and in official BSP:
linux-imx
inux-imx-headers
imx-vpuwrap
imx-vpu-hantro
As example for identify build version of imx-vpuwrap i do : ls tmp/work/aarch64-mx8m-poky-linux/imx-vpuwrap
You can compare so output of command bitbake -e package_name in you env and in official bsp for each package.
I don't know your chip, perhaps it is not same vpu ...check if you need of this flag : imxvpuhantro
and check if it is activated:
bitbake -e imx-vpuwrap | grep imxvpuhantro
You should have this list of var with flag imxvpuhantro
MACHINEOVERRIDES="imx:mx8:mx8m:imxdrm:imxvpu:imxvpuhantro:imxgpu:imxgpu3d:mx8mq:imx8mqevk:aarch64"
MACHINEOVERRIDES_EXTENDER="imxdrm:imxvpu:imxvpuhantro:imxgpu:imxgpu3d"
MACHINEOVERRIDES_EXTENDER_mx8mq="imxdrm:imxvpu:imxvpuhantro:imxgpu:imxgpu3d"
OVERRIDES="linux:aarch64:pn-imx-vpuwrap:imx:mx8:mx8m:imxdrm:imxvpu:imxvpuhantro:imxgpu:imxgpu3d:mx8mq:imx8mqevk:aarch64:poky:class-target:libc-glibc:forcevariable"
Good luck
Cedric Thamin
Hi cedric_thamin
one can look at examples on
https://variwiki.com/index.php?title=DART-MX8M_GSTREAMER&release=RELEASE_SUMO_V2.1_DART-MX8M
Try with Demo Images from
Best regards
igor
Hi
Thanks for your attention.
Try with Demo Images from |
I can not. My board is a cutom board and official test image is not working on it.
https://variwiki.com/index.php?title=DART-MX8M_GSTREAMER&release=RELEASE_SUMO_V2.1_DART-MX8M |
I tried two examples chap 5
gst-launch-1.0 playbin uri=file:/tmp/a/video/Big_Buck_Bunny_1080_10s_2MB.mp4
Video was played. In we can see it failed to used vpudec and use avdec_h264
Please see trace playbin.txt
gst-launch-1.0 filesrc location=/run/media/sda1/big_buck_bunny.mp4 typefind=true ! video/quicktime ! aiurdemux ! queue max-size-time=0 ! vpudec ! autovideosink
No video was played.
See trace vpudec.txt
I don't understand why gstallocatorphymem.c:149:base_alloc: Allocate phymem 16777232 failed. it is normal? I can not compare with a working board
Please try Demo Images from below link with NXP i.MX8MQ EVK board
What bsp used in your case, which reference design is based your board.
If it is based on i.MX8MQ EVK board one can rebuild image for custom board using
linux documentation on above link.
Best regards
igor
Hi igorpadykov
Yes with official bsp it is working. My issue come from my integration in my yocto env.
I found the issue and for other user I will try explain my issue.
1 - What was my problem :
VPUdec gstreamer module failed to malloc memory
2 - My fix :
I must to synchronised all these recipes to same bsp version (me i synchronized with warrior version)
linux-imx
inux-imx-headers
imx-vpuwrap
imx-vpu-hantro
And in conf/machine/include/imx-base.inc check var MACHINEOVERRIDES_EXTENDER_mx8mq, imxvpuhantro should be inside it.
3 - Why I met these issues
My yocto env was created for raspberry board, and more later I had support for nxp board.
My reference was poky version thud. But I met an issue with nxp tee with this version so I upgrade kernel, optee-os, optee-client to warrior version for fixed it.
linux-imx and inux-imx-headers was not more synchronised and vpu didnt work anymore
4 - Some line for testing vpu:
This two line is working for me now.
Add package imx-test
/unit_tests/VPU/hantro/hx170dec -Oout /tmp/a/video/15.Papaoutai.avi
With gstreamer
GST_DEBUG=3 gst-launch-1.0 filesrc location=/tmp/a/video/less_small.mp4 ! 'video/quicktime' ! aiurdemux ! 'video/x-h264,weigth=480,height=270' ! vpudec ! glimagesink
Best regards,
Cedric T
I ran into the same error. All necessary packages were in place, but I still got the same error.
GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video2 ! "video/x-raw, format=NV12, wid
th=1920, height=1080, framerate=30/1" ! vpuenc_h264 ! mpegtsmux name=mux ! filesink location=test_1080.t
s
[ 2105.945005] enter isp_mi_stop
Setting pipeline to PAUSED ...
0:00:00.262886750 2019 0xaaab28ff2d20 WARN v4l2 v4l2_calls.c:547:gst_v4l2_subscribe_
event:<v4l2src0> Cannot subscribe V4L2_EVENT_SOURCE_CHANGE or V4L2_EVENT_EOS event for device '/dev/vide
o2'.
====== VPUENC: 4.6.1 build on Aug 12 2021 12:58:31. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Aug 12 2021 12:10:18)
vpulib: 1.1.1
firmware: 1.1.1.43691
0:00:00.263479000 2019 0xaaab28fea2a0 WARN v4l2src gstv4l2src.c:694:gst_v4l2src_query:<
v4l2src0> Can't give latency since framerate isn't fixated !
0:00:00.263520750 2019 0xaaab28fea2a0 WARN aggregator gstaggregator.c:1990:gst_aggregator_
query_latency_unlocked:<mux> Latency query failed
0:00:00.263933000 2019 0xaaab28ff2d20 ERROR default gstallocatorphymem.c:150:base_alloc:
Allocate phymem 10485776 failed.
0:00:00.263961000 2019 0xaaab28ff2d20 ERROR default gstvpu.c:90:gst_vpu_allocate_interna
l_mem: Could not allocate memory using VPU allocator
0:00:00.263985000 2019 0xaaab28ff2d20 ERROR vpuenc gstvpuenc.c:556:gst_vpu_enc_start:<v
puenc_h264-0> gst_vpu_allocate_internal_mem fail
0:00:00.264012000 2019 0xaaab28ff2d20 WARN videoencoder gstvideoencoder.c:1781:gst_video_enc
oder_change_state:<vpuenc_h264-0> error: Failed to start encoder
ERROR: from element /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0: Could not initialize supporting li
brary.
Additional debug info:
../git/gst-libs/gst/video/gstvideoencoder.c(1781): gst_video_encoder_change_state (): /GstPipeline:pipel
ine0/vpuenc_h264:vpuenc_h264-0:
Failed to start encoder
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
I figured out the VPUDEC failure came with the stripped defconfig I used. The VPU in KConfig seems to miss a dependency.
The three neccessary config values are:
CONFIG_ION=y
CONFIG_ION_SYSTEM_HEAP=y
CONFIG_ION_CMA_HEAP=y
Best Regards
Hi ,
After enabling the
CONFIG_ION=y
CONFIG_ION_SYSTEM_HEAP=y
CONFIG_ION_CMA_HEAP=y
The error is gone
default gstvpu.c:90:gst_vpu_allocate_interna l_mem: Could not allocate memory using VPU allocator
But the CPU consumption is very high, around 75% on imx8mm running the demo
GST_DEBUG=3 gst-launch-1.0 videotestsrc ! video/x-raw, format=I420, width=640, height=480 ! vpuenc_h264 ! filesink location=test.mp4
Best Regards,
I ran into this issue - again.
I then figured out, that CONFIG_ION support was removed in Linux 5.11.
The config options making it work for Kernel > 5.11 are now:
CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_HEAPS_SYSTEM=y
CONFIG_DMABUF_HEAPS_CMA=y