"VPU blocking: timeout" randomly happening

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

"VPU blocking: timeout" randomly happening

4,948 Views
oliviersingla
Contributor I

I am using the H.264 encoder on the i.MX6Q (1080P30).

Randomly, the BIT processor seems to be hanging ("mxc_vpu 2040000.vpu: VPU blocking: timeout." from the driver).

I have to reset it to continue encoding. This is not happening often, and it seems to be completely random.

I could encode fine for hours before not seeing it.

Or that can happens just a few minutes before I started encoding.

Is-it a known issue ?

VPU firmware version: 3.1.1_r46056

VPU library version: 5.4.23

kernel 3.10.17

I am doing nothing than encoding, and CPU idle is high (~95%) when the VPU blocks...

I have tried many different H.264 encoding settings, and I am always seeing this issue.

Is there a newer version of the VPU firmware, and if yes, where could I grab it ?

TIA!

Olivier

Labels (3)
Tags (2)
0 Kudos
9 Replies

1,880 Views
matthewtsai
Contributor I

I got the same problem, I  encoding the h264 for 720x480 resolution and randomly get VPU blocking timeout issue, I have looked for many blogs as well and do not get any solution, Is there anyone get solution about the VPU blocking issue, Please give me a hint, very appreciate.

VPU firmware version: 3.1.1_r46056
VPU library version: 5.4.23

B.R. Matthew.

0 Kudos

1,880 Views
danielgarbanzoh
Contributor I

Hi !

I am having troubles with a random "VPU blocking: timeout" error. The error occurs after hours (> 3 hours) of successfully running the test gstreamer pipeline. The gstreamer pipeline consists in receive a TS stream (udpsrc) -> tsdemux-> decode -> change color-space -> encode -> mpegtsmux -> Send TS stream (udpsink)

My test pipeline is as follows:

gst-launch-1.0 -v udpsrc name=udpsrc_element port=5004 address=localhost ! queue ! tsdemux ! queue ! h264parse ! imxvpudec ! queue ! imxg2dvideotransform ! capsfilter caps=video/x-raw,width=640,height=480,format=RGBA ! identity ! imxipuvideotransform input-crop=false ! capsfilter caps=video/x-raw,width=640,height=480,format=NV12 ! videoparse format=nv12 width=640 height=480 ! queue ! imxvpuenc_h264 name=encoder bitrate=12000 gop-size=15 idr-interval=1 ! capsfilter caps=video/x-h264 ! mpegtsmux name=mux ! queue ! rndbuffersize min=1316 max=1316 ! udpsink name=udpsink_fwd sync=false host=<PC_IP> port=5012

Following you will find the error log:

#############################################################################################

mxc_vpu 2040000.vpu: VPU blocking: timeout.
mxc_vpu 2040000.vpu: VPU blocking: timeout.
mxc_vpu 2040000.vpu: VPU blocking: timeout.
mxc_vpu 2040000.vpu: VPU blocking: timeout.
6:55:17.051282637 353 0x1b9e090 ERROR imxvpuencoderbase encoder_base.c:681:gst_imx_vpu_encoder_base_handle_frame:<encoder> failed to encode frame: timeout
mxc_vpu 2040000.vpu: VPU blocking: timeout.
mxc_vpu 2040000.vpu: VPU blocking: timeout.
mxc_vpu 2040000.vpu: VPU blocking: timeout.
mxc_vpu 2040000.vpu: VPU blocking: timeout.
[ERR] fatal: VPU is busy in vpu_DecGetOutputInfo
6:55:19.051890971 353 0x1b9e000 ERROR imxvpudecoder decoder.c:560:gst_imx_vpu_decoder_handle_frame:<imxvpudecoder0> failed to decode: timeout

#############################################################################################

The VPU blocking: timeout error occurs both in the encoder and decoder. When it occurs the pipeline freezes.

 

I has the following system characteristics:

  • Kernel 3.15.52 version
  • imx-vpu-lib-5.4.32
  • imx-gpu-viv-5.0.11.p4-r1
  • libfslvpuwrap-1.0.68
  • libimxvpuapi-0.10.1
  • firmware-imx-5.2
  • gst1.0-fsl-plugins-4.1.4

 

I have tried all the suggested actions in this blog, but always got the same result. I has the DRM_IMX_IPUV3_CORE Kernel Config flag setted off and CONFIG_MX6_VPU_352M Kernel Config flag setted off.

 

I will appreciate any help related with this issue

Best regards,

Daniel

0 Kudos

1,880 Views
edison_fernande
Contributor III

Hi,

I'm writing here hoping that maybe someone already found the solution for this issue.

In my case, the data flow is as follows:

1080p30 capture -> vpuenc (h264) -> tsmux -> udpsink

For this tests I'm using gstreamer 1.0:

kernel 3.14.28

firmware: 3.1.1.46063

vpu lib: 5.4.28

I'm testing with both versions of gstreamer plugins (gstreamer-imx and gst1.0-fsl-plugins) and when I started I noticed that vpuenc (from gst1.0-fsl-plugins) was not giving me the timeout but after digging into both plugins versions I realized that the difference was that vpuenc was not generating AUDs (avc_audEnable = 0). After setting audEnable to 1 I started getting the timeout with vpuenc as well.

My problem is that I need the AUDs to be generated as some of the decoders don't work if they are not included in the stream.

My worst case scenario would be 1080p30 but I'm getting the timeout at other resolutions and I also noticed that if I overclock the VPU the timeout appears very often but it still happens without overclocking.

Any help will be appreciated.

Regards,

Edison

0 Kudos

1,880 Views
tommitykkala
Contributor I

Hi,

I'm experiencing random VPU timeout problems when decoding a simple h264 video stream.

An example what happens when executing libimxvpuapi example "decode-example" :

./imxvpuapi/imxvpuapi_vpulib.c:1807 (imx_vpu_dec_decode)   log: input info: 6214 byte

../imxvpuapi/imxvpuapi_vpulib.c:1846 (imx_vpu_dec_decode)   log: pushing main frame data with 6214 byte

../imxvpuapi/imxvpuapi_vpulib.c:1691 (imx_vpu_dec_push_input_data)   log: bitstream buffer status:  read ptr 0x44c37090  write ptr 0x44c37093  num free bytes 3143676

../imxvpuapi/imxvpuapi_vpulib.c:2063 (imx_vpu_dec_decode)   log: waiting for decoding completion

../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode)   info: timeout after waiting 500 ms for frame completion

../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode)   info: timeout after waiting 500 ms for frame completion

../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode)   info: timeout after waiting 500 ms for frame completion

../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode)   info: timeout after waiting 500 ms for frame completion

[ERR] fatal: VPU is busy in vpu_DecGetOutputInfo

imx_vpu_dec_decode() failed: timeout

../imxvpuapi/imxvpuapi_vpulib.c:1104 (imx_vpu_dec_close)   debug: closing decoder

Any ideas what might cause this? MJPEG decoding works normally.

The Best,

Tommi

0 Kudos

1,880 Views
tommitykkala
Contributor I

We found the reason for this timeout problem.

Seems to be due to our kernel configuration:
CONFIG_IMX_IPUV3_CORE flag seems to cause
problems for VPU decoding.

-T

0 Kudos

1,880 Views
Yuri
NXP Employee
NXP Employee

As for "VPU blocking: timeout" :

  "If the bitrate is set (CBR), perhaps the resolution vs. bitrate relation is

causing the VPU to block sometimes (when not getting enough information to

process a frame).

The VPU blocking timeout is safe to be ingnored if this does not have a big

impact on video performance, it's normal that VPU can block some times but it

must not affect your performance.

Please try setting the bitrate a bit greater (if possible), are you setting QP?

please try modifying QP too if set."

~Yuri.

0 Kudos

1,880 Views
igorpadykov
NXP Employee
NXP Employee

Hi Olivier

newer version VPU firmware one can find on new community linux releases

and kernel 3.10.31.

FSL Community BSP Release Notes 1.7 documentation

http://freescale.github.io/doc/release-notes/1.7/index.html

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,880 Views
oliviersingla
Contributor I

Hi Igor,

I downloaded the latest using Yocto (development branch), just to get the latest things (for our application,

I am actually using buildroot instead of yocto).

First I tried a newer firmware image (3.1.1_r46060): that seemed to help a little, I was seeing less "VPU blocking: timeout",

but that is still happening from time to time (it seems to happen more in the first 5 to 10 minutes I start the device).

Then I disabled asking for the Motion Vectors (ENC_SET_REPORT_MVINFO), and since then I have not seen the VPU blocking issue.

This said, I need to have access to the MV... And at this point, I am not even sure what is the real root cause of the VPU blocking issue.

I'd love to try the 3.10.31 kernel (vs. 3.10.17), and using Yocto, I think I have the source for it (although I could simply use git to get it),

but I did not find the source for the IPU and VPU libraries. With 3.10.17, I am using imx-lib-3.10.17-1.0.0 (VPU library 5.4.23),

would-you mind to tell me where I could download the latest IPU and VPU libraries ? Or where I could find it within the Yocto

built directory (I did not found it...)?

Thank you!

Olivier

0 Kudos

1,880 Views
igorpadykov
NXP Employee
NXP Employee

Hi Olivier

please look at FSL Community BSP Release Notes 1.7 documentation

http://freescale.github.io/doc/release-notes/1.7/index.html

Best regards

igor

0 Kudos