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 786954 - gst-validate scenarios case fail on DRM mode.
gst-validate scenarios case fail on DRM mode.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-29 04:57 UTC by Fei
Modified: 2017-09-01 20:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fail log (12.73 KB, text/plain)
2017-08-29 04:58 UTC, Fei
  Details
vaapisink: fix rendering use case in drm display type (1.59 KB, patch)
2017-08-30 21:40 UTC, sreerenj
committed Details | Review

Description Fei 2017-08-29 04:57:26 UTC
By using gst-validate, some scenarios case fail:

cmdline: gst-validate-launcher vaapi -t validate.file.playback.seek_forward.raw_video_mov

fail case:
validate.file.playback.seek_forward.raw_video_mov
validate.file.playback.seek_forward.raw_video_mkv
validate.file*.vorbis_vp8_1_webm 

error log can find in attach.
Comment 1 Fei 2017-08-29 04:58:57 UTC
Created attachment 358649 [details]
fail log
Comment 2 Fei 2017-08-30 01:10:25 UTC
additional information: these case all pass on X mode.
Comment 3 Fei 2017-08-30 02:21:40 UTC
You can also reproduce this with detail cmdline by using attach media. For example:

DRM mode fail cmd:
#GST_VALIDATE_SCENARIO='seek_forward' GST_GL_XINITTHREADS='1' /usr/bin/gst-validate-1.0 playbin uri=file:///root/raw_video.mov

X mode pass cmd:
#GST_VALIDATE_SCENARIO='seek_forward' GST_GL_XINITTHREADS='1' DISPLAY=':0.0' /usr/bin/gst-validate-1.0 playbin uri=file:///root/raw_video.mov
Comment 4 Fei 2017-08-30 02:50:49 UTC
(In reply to Fei from comment #3)
> You can also reproduce this with detail cmdline by using attach media. For
> example:
> 
> DRM mode fail cmd:
> #GST_VALIDATE_SCENARIO='seek_forward' GST_GL_XINITTHREADS='1'
> /usr/bin/gst-validate-1.0 playbin uri=file:///root/raw_video.mov
> 
> X mode pass cmd:
> #GST_VALIDATE_SCENARIO='seek_forward' GST_GL_XINITTHREADS='1' DISPLAY=':0.0'
> /usr/bin/gst-validate-1.0 playbin uri=file:///root/raw_video.mov

media upload failed for file size limitation, share it with goole drive:
https://drive.google.com/drive/folders/0B-M3YNi0HORQbGpsd2JNWWVBeGc?usp=sharing
Comment 5 sreerenj 2017-08-30 20:56:08 UTC
Easy way to reproduce the issue :
gst-launch-1.0 filesrc location= raw_video.mov ! videoparse format=uyvy width=320 height=240 framerate=30/1 ! vaapisink display=drm

Here the problem is that gst_vaapisink_set_caps() always return TRUE for drm 
display type with out even setting the plugin caps, pool and other attributes. Then in the render frame routine vaapisink trying to copy the raw data from input buffer to a va_surface backed sink buffer through gst_vaapi_plugin_base_get_input_buffer() which is obviously going to fail since we haven't created the sinkpad pool yet.

We usually don't hit this issue since even for drm use case the pool is shared between upstream element and vaapisink (eg: decodebin ! vaapisink display=drm).

This particular test case is different since there is no pool shared between the upstream element and vaapisink and eventually we have to copy the incoming raw data buffer to vaapisink buffer from the pool.

Either we can just return from sink render function for drm display type or make sure that all sink attributes including caps, pool etc set in set_caps().
Comment 6 sreerenj 2017-08-30 21:40:04 UTC
Created attachment 358796 [details] [review]
vaapisink: fix rendering use case in drm display type
Comment 7 Víctor Manuel Jáquez Leal 2017-08-31 07:09:57 UTC
Review of attachment 358796 [details] [review]:

Just a question, besides that it lgtm.

::: gst/vaapi/gstvaapisink.c
@@ +1343,2 @@
   gst_vaapisink_ensure_colorbalance (sink);
   gst_vaapisink_ensure_rotation (sink, FALSE);

Is it required to ensure display's color-balance and rotation before bail out?
Comment 8 U. Artie Eoff 2017-08-31 17:30:52 UTC
Review of attachment 358796 [details] [review]:

Verified this fixes it for me.  Thanks!
Comment 9 sreerenj 2017-08-31 18:04:38 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #7)
> Review of attachment 358796 [details] [review] [review]:
> 
> Just a question, besides that it lgtm.
> 
> ::: gst/vaapi/gstvaapisink.c
> @@ +1343,2 @@
>    gst_vaapisink_ensure_colorbalance (sink);
>    gst_vaapisink_ensure_rotation (sink, FALSE);
> 
> Is it required to ensure display's color-balance and rotation before bail
> out?

Ideally not, we invoke them in render_frame routine too. But I think it is better to follow the same code path for all display servers except that drm won't be doing any "rendering" by itself so that the structure attributes will show correct values even if it is not using anywhere.
Comment 10 sreerenj 2017-09-01 20:51:14 UTC
Review of attachment 358796 [details] [review]:

Pushed as commit 782184e7813ff4cd402bec0e556ce1f4d1187220