Logs spammed with kernel messages from the Video Encoder

Hello,

We are seeing the following messages from the video encoder:

[47162.792691] set venc_vb_mmap_bufs error, venc_vb_mmap_num_buffers:768 >= CODEC_MAX_BUFFER:768
[47162.826619] set venc_vb_mmap_bufs error, venc_vb_mmap_num_buffers:768 >= CODEC_MAX_BUFFER:768
[47162.859817] set venc_vb_mmap_bufs error, venc_vb_mmap_num_buffers:768 >= CODEC_MAX_BUFFER:768

How fast they show up is dependent on how many FPS we are recording at:

  • 768 / 60 fps = 12.8s (observed ~12.8s)
  • 768 / 30 fps = 25.6s (observed ~25.6s)
  • 768 / 15 fps = 51.2s (observed ~51.2s)

These messages are reproducible with the following gstreamer command:

gst-launch-1.0 -e videotestsrc is-live=true num-buffers=1200 ! \
  video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
  v4l2h264enc extra-controls="controls,video_bitrate=8000000" ! \
  h264parse ! fakesink sync=false

How do we fix this? Also how in general do we set the verbosity lower for not only this message, but other messages from the encoder as well, when recording or while it’s activated it makes our logs unreadable/unusable.

Thanks.

Version Info:

Component Branch Version / SRCREV
SoC MT8391 (Genio 720)
Linux kernel (linux-mtk) mtk-v6.6 6.6.92
Base DTB mediatek/mt8391-wr720-dvt.dtb
DT overlay video.dtbo (mt8391)
mtk-vcodec-driver-mt8391 mtk-v6.6-mt8391 dee2a3570675145b885a737a13d060d01b3f34fe
mtk-vcu-driver-mt8391 mtk-v6.6-mt8391 f3901d7e0780828f9424ce53a0938befe814348d
mtk-vpud main 2318701a4b2b4531698111c45214062aa85697e3
MediaTek Rity BSP 25.1.1-release

Hi @jjohnson ,

Could you please try the latest VPUD?

Thanks.

Hi @macross.chen,

Thank you for your help. I have updated mtk-vpud and mtk-vcu-driver-mt8391 the error is now gone, but it’s still flooding our journald logs with the following during recording:

Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 33109
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 34680
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 31573
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 33114
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 35034
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 33385
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 34974
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 32725
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 32208
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 31527
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc_CQCmd_returnDone_buf –
Jul 31 21:56:28 genio-720-f4afaa vpud[2184]: venc input timediff 36742

Could you please share the test steps for us to reproduce this internally? Thanks.

Hi @macross.chen I ended up lowering the verbosity of the vpud service with an override in yocto by setting it to warning, this fixed the output, but there are still quite a few kernel messages:

kernel: mtk_vcodec_enc_clock_on 373 smi time 4 ccf time 0

These are logging at a rate of 2-4 message every 1-2 seconds or so rather than the service which was many multiple messages every second so the are more manageable. But the best thing would be if it only logged actual errors or warnings.

Are you not able to repo these with the gstreamer cli I gave you?

gst-launch-1.0 -e videotestsrc is-live=true num-buffers=1200 ! \
  video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
  v4l2h264enc extra-controls="controls,video_bitrate=8000000" ! \
  h264parse ! fakesink sync=false

Execute this on the command line in one terminal, then in another run to see the vpud output:

journalctl -f

and in another run to see the kernel messages:

dmesg -w

Got it, we will check it and reply ASAP.