GNOME Bugzilla – Bug 797087
vaapih264enc: error message occurs during encoding avc/cqp with lowpower mode.
Last modified: 2018-10-16 11:29:24 UTC
System Environment ======= platform: KBL kernel: 4.14.0-rc1 libva-intel-driver: master branch d805098c739a9dfffacb2591ad8906b70376216e gst-vaapi: master branch 148d75c8af116e4128858e75dc393b7f0086cff8 guc: kbl_guc_ver9_14.bin huc: kbl_huc_ver02_00_1810.bin Regression? ======= No Bug detailed description ======= when do avc cqp vdenc, the cmd failed and error message occurs, but it can pass with cbr/vbr mode. Reproduce Steps ============== 1. gst-launch-1.0 filesrc location=/media/encoderbitstreams//1080p_blue_sky.yuv ! videoparse format=i420 width=1920 height=1080 framerate=30 ! vaapih264enc rate-control=cqp tune=3 ! video/x-h264,profile=main ! h264parse ! filesink location=./test_lowp.h264 2. error info Got context from element 'vaapiencodeh264-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"(GstVaapiDisplayX11)\ vaapidisplayx11-0"; 0:00:00.059712283 15517 0x12472d0 ERROR vaapi gstvaapicontext.c:323:config_create: Mismatched ROI support: number of regions supported: 3 ROI delta QP: 0 0:00:00.059735632 15517 0x12472d0 ERROR vaapi gstvaapiencoder.c:997:gst_vaapi_encoder_reconfigure_internal: failed to update VA context ERROR: from element /GstPipeline:pipeline0/GstVideoParse:videoparse0/GstRawVideoParse:inner_rawvideoparse: Internal data stream error. Additional debug info: gstbaseparse.c(3656): gst_base_parse_loop (): /GstPipeline:pipeline0/GstVideoParse:videoparse0/GstRawVideoParse:inner_rawvideoparse: streaming stopped, reason not-negotiated (-4) Expected Result ============= avc vdenc cmd can run successfully with cqp mode, and the encoded file has no problem. Actual Result =========== error message occurs when do avc cqp vdenc
it seems to me a driver issue for that configuration
Same issue to Intel's media-driver too.
Please check your HuC status first $> sudo cat /sys/kernel/debug/dri/0/i915_huc_load_status Both fetch & load status should be SUCCESS
the status is OK, and it can pass with cbr/vbr mode.
Created attachment 373902 [details] [review] patch
Hi @Victor, it should not be a driver issue. There is a unreasonable place in gst-vaapi which will lead this issue. Please help to review my patch. Thanks.
Comment on attachment 373902 [details] [review] patch You may simply replace && with ||.
Created attachment 373903 [details] [review] patch
(In reply to haihao.xiang from comment #7) > Comment on attachment 373902 [details] [review] [review] > patch > > You may simply replace && with ||. Yes, make sense. Thanks.
Right. In gstreamer-vaapi ROI by priority is not implemented, only by delta. With this I understand that low power support ROI priority but not by delta. Is that correct?
Maybe it is a driver issue, roi_rc_qp_delta_support should be ignored when CQP is used.
(In reply to haihao.xiang from comment #11) > Maybe it is a driver issue, roi_rc_qp_delta_support should be ignored when > CQP is used. Should I create an issue in intel-vaapi-driver/media-driver ???
Created attachment 373937 [details] [review] patch for this issue.
@Haihao, according your suggestion, roi_rc_qp_delta_support will be ignored if the rc mode set as CQP, so in gst-vaapi side, we shouldn't use it to know if the driver will support roi-delta-qp, and roi_num_supported should be used. Here I cooked a patch to modify that. @Victor, could you also help to review it? Thanks.
Review of attachment 373937 [details] [review]: lgtm
attachment 373937 [details] [review] was pushed as commit d8442e47 - libs: context: roi_rc_qp_delta_support should not be checked when CQP.