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 790633 - vaapi: Show video with artifacts under Wayland on AMD
vaapi: Show video with artifacts under Wayland on AMD
Status: RESOLVED NOTGNOME
Product: clutter-gst
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: clutter-gst-maint
clutter-gst-maint
Depends on:
Blocks:
 
 
Reported: 2017-11-20 20:11 UTC by Mikhail
Modified: 2017-12-17 08:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mikhail 2017-11-20 20:11:03 UTC
On Fedora 27 with GNOME on Wayland,  Totem playing all video files with artifacts.
With GNOME on Xorg problem is disappeared.

Demonstration: https://youtu.be/Z8RtuoWEJ-g


$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! vaapih264dec ! vaapisink
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
Setting pipeline to PAUSED ...
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
Pipeline is PREROLLING ...
Got context from element 'vaapisink0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1";
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:03:53.107783793
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 1 Nicolas Dufresne (ndufresne) 2017-11-20 21:05:02 UTC
Any reason to title this bug report "glimagesink" if you are using vaapisink ?
Comment 2 Mikhail 2017-11-20 21:11:22 UTC
Above output from GNOME on Xorg, below output from GNOME on Wayland:

$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! vaapih264dec ! glimagesink
Setting pipeline to PAUSED ...
mesa: for the -simplifycfg-sink-common option: may only occur zero or one times!
Pipeline is PREROLLING ...
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Got context from element 'vaapidecode_h264-0':
gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayWayland\)\vaapidisplaywayland1";
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLUploadEle
ment:gluploadelement0: Failed to upload buffer
Additional debug info:
gstgluploadelement.c(250): gst_gl_upload_element_prepare_output_buffer
():
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLUploadEle
ment:gluploadelement0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...


I discussed this issue with amdgpu developer, because think that this is specific GPU problem. But without vaapi we have same result.
Comment 3 Nicolas Dufresne (ndufresne) 2017-11-20 21:19:51 UTC
For Victor to have a look, provide which Intel HW you are running this on, it works for me (run vainfo):

   Intel i965 driver for Intel(R) Ivybridge Mobile - 1.8.3

So it looks like a AMD VAAPI driver issue somehow. Note that you should not use vaapih264dec directly, but vaapidecodebin if you want to use it with glimagesink, autocluttersink (like totem) etc.
Comment 4 Nicolas Dufresne (ndufresne) 2017-11-20 22:00:03 UTC
Was previous reply was mid-air. So you say you have non-vaapi pipeline to reproduce the issue ? What do you mean, does the following works ?

 videotestsrc ! glimagesink
 filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! avdec_h264 ! glimagesink
 filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! openh264dec ! glimagesink

I'm marking this bug report as NEEDINFO because I have no idea how I can assist you with this issue.
Comment 5 Nicolas Dufresne (ndufresne) 2017-11-20 22:01:09 UTC
Maybe give some output with / without this env too ?

  export GST_GL_WINDOW=wayland
Comment 6 Mikhail 2017-11-20 22:08:07 UTC
Please look new demonstration: https://youtu.be/WXBiCF1YnBQ

Command which you provide above show video without artifacts, but totem still show video with artifacts

 gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! vaapidecodebin ! glimagesink
Setting pipeline to PAUSED ...
mesa: for the -simplifycfg-sink-common option: may only occur zero or one times!
Pipeline is PREROLLING ...
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Got context from element 'vaapipostproc0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayWayland\)\ vaapidisplaywayland1";
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
Got EOS from element "pipeline0".
Execution ended after 0:03:53.107730387
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...


What it means?
Comment 7 Mikhail 2017-11-20 22:22:36 UTC
Also I want noted that variant without vaapi also worked without artifacts:

$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! avdec_h264 ! glimagesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Redistribute latency...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:03:53.107727538
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 8 Nicolas Dufresne (ndufresne) 2017-11-20 22:30:50 UTC
So it is a vaapi decoder issue in the end. If all you care about is getting Totem to work:

  dnf remote gstramer1-vaapi
Comment 9 Mikhail 2017-11-20 22:42:08 UTC
Please watch my last demo. I try both variants without vaapi and with vaapi. Totem show artifacts in both cases. But gst-launch was showed video fine in both cases.


Demo: https://youtu.be/Uv0_CJ3gKWE
Comment 10 Mikhail 2017-11-20 22:56:52 UTC
It means both variants with and without VAAPI works fine when we manually set path in gst-launch-1.0
And this both variants show artifacts in Totem player.
Comment 12 Nicolas Dufresne (ndufresne) 2017-11-21 00:45:55 UTC
It's a bit weird, you should also test with ! autocluttersink, as this is what Totem uses. Because gnome app are persistant, have you made sure that Totem was not running anymore ? (See GApplication and their D-Bbus interface for details).
Comment 13 Nicolas Dufresne (ndufresne) 2017-11-21 00:47:33 UTC
Julien, it's quite visually different from the two other bugs though.
Comment 14 Víctor Manuel Jáquez Leal 2017-11-21 09:58:07 UTC
(In reply to Mikhail from comment #10)
> It means both variants with and without VAAPI works fine when we manually
> set path in gst-launch-1.0
> And this both variants show artifacts in Totem player.

May I suggest one tests (already requested by Nicolas):

uninstall gstreamer-vaapi and run

gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! decodebin ! clutterautovideosink

how does it look?

As you are testing with Totem, Totem uses clutter video sink. Perhaps there's some issue with cogl/clutter along your video card.
Comment 15 Mikhail 2017-11-21 15:23:46 UTC
$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! decodebin ! autocluttersink
 - able reproduce Totem bug with this command, for addition info please see demonstration: https://youtu.be/Wiqsq1g8xzw



$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! decodebin ! clutterautovideosink
WARNING: erroneous pipeline: no element "clutterautovideosink"
 - This is incorrect command
Comment 16 Víctor Manuel Jáquez Leal 2017-11-21 16:24:55 UTC
autocluttersink is the correct one in your setup.

At least we have found the problematic element here: the clutter sink.

Let me assign it.
Comment 17 Lionel Landwerlin 2017-11-21 19:37:26 UTC
Just to confirm, this works with an issue :

$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! avdec_h264 ! glimagesink


This doesn't work :

$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! matroskademux ! h264parse ! avdec_h264 ! clutterautovideosink
Comment 18 Lionel Landwerlin 2017-11-21 19:40:46 UTC
Also, is the video available anywhere? Thanks!
Comment 19 Mikhail 2017-11-22 18:30:58 UTC
Artifacts are present on all videos. So you're not needed have demonstration video for debugging problem.

But if you want download it for fun you can do this from my server: https://download.sy24.ru/PSY%20-%20Gentleman.mkv
Comment 20 Nicolas Dufresne (ndufresne) 2017-11-22 18:50:12 UTC
Ok, so we just(TM) need the same hardware ;-P
Comment 21 Mikhail 2017-12-06 20:22:58 UTC
I don't know how it related, but after update mesa to 17.4.0-0.11.git20d37da version seems issue was gone.
Comment 22 Víctor Manuel Jáquez Leal 2017-12-11 21:52:14 UTC
Closing as not gnome - not related, according to comment 21
Comment 23 Mikhail 2017-12-16 22:24:58 UTC
But Intel GPU still having artifacts with gstreamer1-vaapi.

Demonstration: https://youtu.be/73amHQeS30Q
Comment 24 Mikhail 2017-12-17 08:20:11 UTC
And strange why command:
$ gst-launch-1.0 -f filesrc location= Videos/2D/PSY\ -\ Gentleman.mkv ! decodebin ! autocluttersink
WARNING: erroneous pipeline: no element "autocluttersink"

no more working?