gst-vaapi+Wayland = rendering corruption in totem (but not in gst-play-1.0)

Bug #1701463 reported by Daniel van Vugt on 2017-06-30
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GStreamer
Expired
Medium
clutter-gst-3.0 (Ubuntu)
High
Daniel van Vugt
gstreamer-vaapi (Ubuntu)
High
Daniel van Vugt

Bug Description

After successfully getting gst-vaapi to work in a Wayland session (either requires Weston, or you to unset $DISPLAY in Gnome Shell), totem produces rendering corruption. Strangely enough though, gst-play-1.0 has no such corruption.

Note: The technique of unsetting $DISPLAY to avoid Xwayland and use Wayland-proper only seems to work for totem, not gst-play-1.0. gst-play-1.0 only renders to Wayland successfully (without corruption) in Weston.

Tested with:
http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4

Changed in totem:
importance: Unknown → Medium
status: Unknown → Confirmed
Daniel van Vugt (vanvugt) wrote :

Confirmed the problem seems to be in the clutter plugin:

env -uDISPLAY gst-launch-1.0 filesrc location=bbb_sunflower_1080p_60fps_normal.mp4 ! qtdemux ! vaapidecodebin ! clutterautovideosink

so a workaround is to avoid clutter:

env -uDISPLAY gst-launch-1.0 filesrc location=bbb_sunflower_1080p_60fps_normal.mp4 ! qtdemux ! vaapidecodebin ! glimagesink

affects: totem (Ubuntu) → clutter-gst-3.0 (Ubuntu)
affects: totem → clutter-gst
Changed in clutter-gst-3.0 (Ubuntu):
importance: Undecided → High
status: New → Triaged
Daniel van Vugt (vanvugt) wrote :

Note that you may notice very high CPU usage with clutter rendering (especially in totem). Although that's a concurrent problem, it should be treated separately; in bug 1698282.

Changed in clutter-gst-3.0 (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: Triaged → In Progress
Changed in gstreamer-vaapi (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
importance: Undecided → High
status: New → In Progress
no longer affects: clutter-gst
Changed in clutter-gst-3.0 (Ubuntu):
status: In Progress → Invalid
Changed in gstreamer:
importance: Unknown → Medium
status: Unknown → Confirmed
Daniel van Vugt (vanvugt) wrote :

I have published an experimental fix for the Wayland-specific corruption and performance issues here:

https://launchpad.net/~vanvugt/+archive/ubuntu/videoaccel
gstreamer-vaapi 1.12.2-1ubuntu1vanvugtppa1

BEFORE
Wayland Gnome..totem..... 60% and corrupt (LP: #1701463)
Wayland Gnome..gst-play.. 5% but requires workarounds (LP: #1698287)
Wayland Gnome..cluttergst 52% and corrupt (LP: #1701463) \
Wayland Gnome..glimagesnk 3% and smooth / gst-launch-1.0
Wayland.Weston.totem..... 62% and corrupt (LP: #1701463)
Wayland.Weston.gst-play.. 4% and smooth
Xorg Gnome.....totem..... 12% and jerky (LP: #1698282, LP: #1698270)
Xorg Gnome.....gst-play.. 4% and smooth

AFTER
Wayland Gnome..totem..... 25% and jerky (LP: #1698282, LP: #1698270)
Wayland Gnome..gst-play.. 8% but requires workarounds (LP: #1698287)
Wayland Gnome..cluttergst 5% and smooth \
Wayland Gnome..glimagesnk 5% and smooth / gst-launch-1.0
Wayland.Weston.totem..... 10% and jerky (LP: #1698282, LP: #1698270)
Wayland.Weston.gst-play.. 4% and smooth
Xorg Gnome.....totem..... 13% and jerky (LP: #1698282, LP: #1698270)
Xorg Gnome.....gst-play.. 4% and smooth

Daniel van Vugt (vanvugt) wrote :

Patch for artful attached.

Sebastien Bacher (seb128) wrote :

Thanks Daniel, could you include some header in the patch though (http://dep.debian.net/deps/dep3/)?

Daniel van Vugt (vanvugt) wrote :

I was aiming to just use the same patch file as I had given to upstream (generated by git), but OK I can reformat it...

Daniel van Vugt (vanvugt) wrote :

Same patch, but more verbose (DEP-3).

Changed in gstreamer-vaapi (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gstreamer-vaapi - 1.12.2-1ubuntu2

---------------
gstreamer-vaapi (1.12.2-1ubuntu2) artful; urgency=medium

  * Add gstreamer-vaapi-EGL-GLTextureUpload-2f368a4d.patch
    - Fixes corruption on Wayland (LP: #1701463)
    - Improves performance (eliminating software buffer copies in clutter-gst)
    - Note: Intel users will also need fix: i965-va-driver 1.8.3-1ubuntu1,
      or else may just see a black image.

 -- Daniel van Vugt <email address hidden> Fri, 04 Aug 2017 15:12:58 +0800

Changed in gstreamer-vaapi (Ubuntu):
status: Fix Committed → Fix Released
tags: added: wayland wayland-session
Changed in gstreamer:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.