Venus Encoder Crash When Switching Resolutions

Hi. We are see a crash when we switch h264 encoder resolutions sometimes. It seems to happen more frequently when the scene is of a higher frequency or activity. This is the output we see:

root@sla-alip:~# [ 96.377003] arm-smmu d40000.arm,smmu-venus: Unhandled context fault: fsr=0x402, iova=0xddbf9000, fsynr=0x33, cb=0
[ 96.377088] arm-smmu d40000.arm,smmu-venus: Unhandled context fault: fsr=0x402, iova=0xddbf9200, fsynr=0x33, cb=0
[ 96.377105] qcom-venus no valid instance(pkt session_id:ff, pkt:21001)
[ 96.396509] qcom-venus-decoder dec: event session error 0
[ 96.404675] qcom-venus-encoder enc: event session error 0
[ 96.412978] qcom-venus SFR message from FW: CPUSS WD Timeout or Unknown Exception
[ 96.515154] qcom-venus system error has occurred, starting recovery

The output is similar to this capture ticket where it is suggested to increase the buffer size, but I don’t know if that helps or not: What do Unhandled context fault messages mean when doing Mipi Capture

Any suggestions would be appreciated.


Are you ‘live’ switching the resolution? any way to reproduce easily with e.g. gstreamer?

Hi Loic,

Thanks for the response. Yes, we are live switching resolutions. We were able to determine that we mostly saw the issue switching between 320x240 to 640x480 with a higher frequency image. Almost every time. What we think might be the cause is that for the last buffer of the previous resolution we set the flag V4L2_BUF_FLAG_LAST and then call VIDIOC_QBUF with the new resolution buffer. If we save off the previous resolution size buffer and then call VIDIOC_QBUF with the previous resolution size (with V4L2_BUF_FLAG_LAST) it seems to mostly work. We think we are ok for the customer that was having the issue. We are using V4L2_MEMORY_DMABUF buffers and think maybe that is part of why we see this, but not sure.

I’m not an expert of gstreamer but if it’s possible to switch resolutions on the fly, maybe this would show up?