Freescale / libimxvpuapi

i.MX VPU API Library
GNU Lesser General Public License v2.1
88 stars 54 forks source link

imxvpudec_h264 fails to initialize DWL instance #46

Closed ds-hw-consultant closed 3 years ago

ds-hw-consultant commented 3 years ago

I've built libimxdmabuffer with ION allocator support enable and DWL allocator disabled. I subsequently built libimxvpuapi, gstreamer, and gstreamer-imx successfully. However, when I attempt to use imxvpudec_h264 it produces:

Setting pipeline to PAUSED ... Pipeline is PREROLLING ... 0:00:00.099679567 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed 0:00:00.099828485 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error 0:00:00.104743128 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed 0:00:00.104801567 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error 0:00:00.109546533 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed 0:00:00.109603052 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error 0:00:00.114272300 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed 0:00:00.114326179 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error 0:00:00.119770854 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed 0:00:00.119871892 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error 0:00:00.124694257 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed 0:00:00.124748016 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error ERROR: from element /GstPipeline:pipeline0/GstQTDemux:demux: Internal data stream error. Additional debug info: ../subprojects/gst-plugins-good/gst/isomp4/qtdemux.c(6545): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:demux: streaming stopped, reason not-negotiated (-4) ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... ERROR: from element /GstPipeline:pipeline0/GstQueue:queue1: Internal data stream error. Additional debug info: ../subprojects/gstreamer/plugins/elements/gstqueue.c(990): gst_queue_handle_sink_event (): /GstPipeline:pipeline0/GstQueue:queue1: streaming stopped, reason not-negotiated (-4) ERROR: pipeline doesn't want to preroll. Freeing pipeline ...

swapping in avdec_h264 works just fine--but of course no Hantro VPU hw acceleration.

ds-hw-consultant commented 3 years ago

After adding more debugging I get the following output:

... ION allocator created dma buffers just fine ... 0:00:00.104295304 21549 0xaaaaef23c0c0 DEBUG imxvpudec gstimxvpudec.c:336:gst_imx_vpu_dec_set_format: setting decoder format 0:00:00.104364663 21549 0xaaaaef23c0c0 DEBUG imxvpudec gstimxvpudec.c:340:gst_imx_vpu_dec_set_format: draining remaining frames from decoder 0:00:00.106082090 21549 0xaaaaef23c0c0 DEBUG imxvpudec gstimxvpudec.c:492:gst_imx_vpu_dec_set_format: format NV12_10LE40 detected in list of supported srccaps formats; enabling 10-bit decoding 0:00:00.106122770 21549 0xaaaaef23c0c0 DEBUG imxvpudec gstimxvpudec.c:519:gst_imx_vpu_dec_set_format: decoder only supports semi planar formats 0:00:00.106145210 21549 0xaaaaef23c0c0 DEBUG imxvpudec gstimxvpudec.c:548:gst_imx_vpu_dec_set_format: (re)opening decoder 0:00:00.106258369 21549 0xaaaaef23c0c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed 0:00:00.106286209 21549 0xaaaaef23c0c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error 0:00:00.106315369 21549 0xaaaaef23c0c0 WARN videodecoder gstvideodecoder.c:811:gst_video_decoder_setcaps: Subclass refused caps

again, swapping in avdec_h264 works perfectly with the same pipeline.

Is this a libimxvpuapi issue or a gstreamer-imx issue?

ds-hw-consultant commented 3 years ago

Turns out "could not open decoder: error" really means: could not open /dev/mxc_hantro device node file. A better error message could be useful.