After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797087 - vaapih264enc: error message occurs during encoding avc/cqp with lowpower mode.
vaapih264enc: error message occurs during encoding avc/cqp with lowpower mode.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-09-06 02:41 UTC by zj,wang
Modified: 2018-10-16 11:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.27 KB, patch)
2018-10-12 07:13 UTC, Fei
none Details | Review
patch (1.17 KB, patch)
2018-10-12 08:05 UTC, Fei
none Details | Review
patch for this issue. (1.81 KB, patch)
2018-10-16 06:31 UTC, Fei
committed Details | Review

Description zj,wang 2018-09-06 02:41:16 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
Comment 1 Víctor Manuel Jáquez Leal 2018-09-06 10:25:39 UTC
it seems to me a driver issue for that configuration
Comment 2 Soon, Thean Siew 2018-10-10 23:28:26 UTC
Same issue to Intel's media-driver too.
Comment 3 haihao.xiang 2018-10-11 01:13:45 UTC
Please check your HuC status first 

$> sudo cat /sys/kernel/debug/dri/0/i915_huc_load_status

Both fetch & load status should be SUCCESS
Comment 4 zj,wang 2018-10-11 01:20:45 UTC
the status is OK, and it can pass with cbr/vbr mode.
Comment 5 Fei 2018-10-12 07:13:28 UTC
Created attachment 373902 [details] [review]
patch
Comment 6 Fei 2018-10-12 07:18:16 UTC
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 7 haihao.xiang 2018-10-12 07:32:44 UTC
Comment on attachment 373902 [details] [review]
patch

You may simply replace && with ||.
Comment 8 Fei 2018-10-12 08:05:16 UTC
Created attachment 373903 [details] [review]
patch
Comment 9 Fei 2018-10-12 08:05:35 UTC
(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.
Comment 10 Víctor Manuel Jáquez Leal 2018-10-12 13:36:23 UTC
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?
Comment 11 haihao.xiang 2018-10-12 14:06:45 UTC
Maybe it is a driver issue, roi_rc_qp_delta_support should be ignored when CQP is used.
Comment 12 Víctor Manuel Jáquez Leal 2018-10-15 14:12:06 UTC
(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 ???
Comment 13 Fei 2018-10-16 06:31:06 UTC
Created attachment 373937 [details] [review]
patch for this issue.
Comment 14 Fei 2018-10-16 06:38:17 UTC
@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.
Comment 15 Víctor Manuel Jáquez Leal 2018-10-16 11:20:43 UTC
Review of attachment 373937 [details] [review]:

lgtm
Comment 16 Víctor Manuel Jáquez Leal 2018-10-16 11:28:21 UTC
attachment 373937 [details] [review] was pushed as commit d8442e47 - libs: context: roi_rc_qp_delta_support should not be checked when CQP.