从Surface编码时,Adreno GPU上的编码器崩溃 [英] Encoder crash on Adreno GPU while encoding from Surface

查看:150
本文介绍了从Surface编码时,Adreno GPU上的编码器崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力解决这个问题超过一个星期,并且很可能是 Qualcomm GPU/硬件视频编码器中的错误.由于我们被迫发布该应用程序,并且他们的开发人员论坛也未提供任何反馈,因此我也将其发布在这里,希望有人能够提供一些线索,甚至更好的解决方法,以使编码器中的错误得以解决.没有触发.

I've been struggling with this issue for more than a week, and most likely it is a bug in the Qualcomm GPU/hardware video encoder. Since we are pressed to release the application, and their developer forums did not provide any feedback, I am posting it here too, hoping that someone is able to provide some clues, or even better, a workaround so that the bug in the encoder is not triggered.

应用程序从Surface进行编码.当某些图像渲染到表面时,编码器在同一位置(当前正在编码的帧是关键帧)失败(100%).崩溃时编码器的Logcat输出为(最后几行的重复率很高):

The application encodes from a Surface. When certain images are rendered to the surface, the encoder fails (100%) in the same place (when the frame currently being encoded is a key frame). The Logcat output from the encoder at the point of the crash is(with the last lines repeated at a very high rate):

11-26 11:41:33.312: E/OMX-VENC-720p(25949): ERROR: async_msg_process() - Error statuscode = 1
11-26 11:41:33.312: E/ACodec(29317): [OMX.qcom.video.encoder.avc] ERROR(0x80001009)
11-26 11:41:33.312: E/MediaCodec(29317): Codec reported an error. (omx error 0x80001009, internalError -2147483648)
11-26 11:41:33.362: E/OMX-VENC-720p(25949): ERROR: venc_use_buf:set input buffer failed 
11-26 11:41:33.362: E/OMX-VENC-720p(25949): ERROR: in dev_use_buf
11-26 11:41:33.362: E/OMX-VENC-720p(25949): ERROR: empty_buffer_done() failed!
11-26 11:41:33.372: E/OMX-VENC-720p(25949): m_fbd_count at o/p flush = 306
11-26 11:41:33.372: E/OMX-VENC-720p(25949): m_etb_count at i/p flush = 313
11-26 11:41:33.372: E/OMX-VENC-720p(25949): ERROR: ioctl VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER failed
11-26 11:41:33.372: E/OMX-VENC-720p(25949): ERROR: dev_fill_buf() Failed
11-26 11:41:33.372: E/OMX-VENC-720p(25949): ERROR: FTBProxy() failed!

我也可以在 Grafika 上进行复制,只需替换为 Record GL应用程序绘制两种几何形式,并以横向模式绘制有问题的图像之一(全屏),并将比特率更改为更高的值(7Mbps). 对于更大的比特率,编码器的崩溃会更快发生.

I can replicate it also on Grafika by simply replacing in the Record GL app the drawing of two geometric forms with drawing one of the problematic images, full screen, in landscape mode, and changing the bitrate to a higher value (7Mbps). The crash of the encoder happens sooner for larger bitrate.

这里有一张图片,它似乎很容易破解,这里是

Here is one image that seems to break it easily and here is RecordFBOActivity.java with the required changes.

我使用Grafika进行了测试,编码器在三星S4(国际版)和原始Nexus 4上均崩溃.使用比渲染普通图像稍微复杂一点的软件,它仍然在两者上崩溃.没有在任何其他Adreno设备上进行测试.在具有Mali 400 GPU的Samsung S3上,它可以正常工作.

With Grafika, I tested and the encoder crashes on both Samsung S4, international version, and on the original Nexus 4. With our software, which is a little more complex than rendering the plain image, it still crashes on both. Did not test on any other Adreno devices. On Samsung S3, with a Mali 400 GPU, it works fine.

在4Mbps的速度下,我们应用程序中的编码器仍然在S4和N4上均崩溃,但后来又崩溃了. Grafika在同一地点的N4上崩溃,但在S4上没有崩溃.

At 4Mbps, the encoder in our application still crashes on both S4 and N4, but later. Grafika crashes on N4 in the same place, but not on S4.

根据下面的评论,当从缓冲区编码相同的图像时,也可以将其复制.各种测试似乎都缩小了在以下条件下再现它的条件:高通设备上的h264 hw编码器,对许多帧进行静止图像编码(由于相似的帧,这决定了编码器中的比特率非常低),对关键帧进行编码时出现错误(仅当对某些图像进行编码时才会出现错误,这些图像似乎更详细,即需要很多位进行帧内编码.

According to comments bellow, it can be reproduced also when encoding the same image from the buffer. Various tests seem to narrow the conditions to reproduce it at: h264 hw encoder on Qualcomm devices, encoding a still image for many frames (this determines very low bitrates in the encoder due to similar frames), error appearing while encoding a key frame (the error appears only when encoding certain images, which seem to have more detail, i.e. need many bits for intra coding).

推荐答案

这似乎是一个错误,如上所述.

It seems to be a bug as previously stated above.

这篇关于从Surface编码时,Adreno GPU上的编码器崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆