[regression] Video playback in totem is corrupted in X11

Bug #1747744 reported by Doug McMahon
66
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Mesa
Fix Released
Medium
mesa (Ubuntu)
Fix Released
High
Timo Aaltonen

Bug Description

WORKAROUND (1):

Install these two together:
https://launchpad.net/ubuntu/+source/mesa/17.2.4-0ubuntu2/+build/13697262/+files/libgl1-mesa-glx_17.2.4-0ubuntu2_amd64.deb
https://launchpad.net/ubuntu/+source/mesa/17.2.4-0ubuntu2/+build/13697262/+files/libglapi-mesa_17.2.4-0ubuntu2_amd64.deb

WORKAROUND (2):

sudo apt remove gstreamer1.0-vaapi

WORKAROUND (3):

Log in to "Ubuntu on Wayland" instead of "Ubuntu".

---

Test case
Log inti xorg session
Install gstreamer1.0-vaapi plugin
Play a supported video (- h.264/avc in .mp4, .mkv or .mov would suffice

Expected: hardware decoded playback
What happens: totally corrupted screen, see screenshots

Does work ok in a wayland session

$ vainfo
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0 (libva 2.0.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.0.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple : VAEntrypointVLD
      VAProfileMPEG2Simple : VAEntrypointEncSlice
      VAProfileMPEG2Main : VAEntrypointVLD
      VAProfileMPEG2Main : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main : VAEntrypointVLD
      VAProfileH264Main : VAEntrypointEncSlice
      VAProfileH264High : VAEntrypointVLD
      VAProfileH264High : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh : VAEntrypointVLD
      VAProfileH264MultiviewHigh : VAEntrypointEncSlice
      VAProfileH264StereoHigh : VAEntrypointVLD
      VAProfileH264StereoHigh : VAEntrypointEncSlice
      VAProfileVC1Simple : VAEntrypointVLD
      VAProfileVC1Main : VAEntrypointVLD
      VAProfileVC1Advanced : VAEntrypointVLD
      VAProfileNone : VAEntrypointVideoProc
      VAProfileJPEGBaseline : VAEntrypointVLD

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gstreamer1.0-vaapi 1.12.4-1ubuntu1
ProcVersionSignature: Ubuntu 4.13.0-32.35-generic 4.13.13
Uname: Linux 4.13.0-32-generic x86_64
ApportVersion: 2.20.8-0ubuntu8
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue Feb 6 14:43:57 2018
InstallationDate: Installed on 2018-02-06 (0 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180204)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gstreamer-vaapi
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Doug McMahon (mc3man) wrote :
Revision history for this message
Doug McMahon (mc3man) wrote :
description: updated
summary: - Video playerback in totem is corrupted in X11
+ Video playback in totem is corrupted in X11
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Video playback in totem is corrupted in X11

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gstreamer-vaapi (Ubuntu):
status: New → Confirmed
Revision history for this message
Doug McMahon (mc3man) wrote :

Seems I can play a vid directly with gstreamer so maybe issue is with totem?
ex.
~$ gst-launch-1.0 playbin uri=file:///home/doug/Desktop/amostviolentyear-nowplaying_h1080p.mkv
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'vaapisink0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx1";
Redistribute latency...
Got context from element 'playsink': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx1";
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
...

Changed in gstreamer-vaapi (Ubuntu):
importance: Undecided → High
Changed in totem (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in totem (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh, that's new. Confirmed!

summary: - Video playback in totem is corrupted in X11
+ [regression] Video playback in totem is corrupted in X11
tags: added: regression
Changed in gstreamer-vaapi (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in totem (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Totem didn't really change since 17.10, there was a no change rebuild for a library transition and another upload to remove the patch that made it use the old style decoration/menubar under Unity, so it's not really likely totem is the issue or maybe the impact of a rebuild with the new toolchain? In any case it should be easy enough to try to previous version on bionic

Revision history for this message
Doug McMahon (mc3man) wrote :

It's possible that this broke on the switch to libva2 which would be somewhat hard to test on a current 18.04 image.(not impossible just hard due to extensive amount of packages involved..
To note: parole works fine with the gst-vaapi plugin.

Revision history for this message
Doug McMahon (mc3man) wrote :

Going the other way, i.e. 17.10 updated, then slowly upgraded to bionic found this.
Updating totem, the eventually all of gstreamer inc. the vaapi plugin, installing libva2 packages produced no issues & did provide vaapi in totem once libva was fully on bionic versions. (restarts after all changes..
Updating libdrm2 caused no issues.
However as soon as this group was updated & a reboot corruption in totem occurred

Upgraded the following packages:
libdrm-amdgpu1 (2.4.83-1) to 2.4.89-1
libegl1-mesa (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libgbm1 (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libgl1-mesa-dri (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libgl1-mesa-glx (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libglapi-mesa (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libgles2-mesa (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libmirclient9 (0.28.0+17.10.20171011.1-0ubuntu1) to 0.29.0-0ubuntu1
libmircommon7 (0.28.0+17.10.20171011.1-0ubuntu1) to 0.29.0-0ubuntu1
libmircore1 (0.28.0+17.10.20171011.1-0ubuntu1) to 0.29.0-0ubuntu1
libmirprotobuf3 (0.28.0+17.10.20171011.1-0ubuntu1) to 0.29.0-0ubuntu1
libwayland-egl1-mesa (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
mesa-va-drivers (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
mesa-vdpau-drivers (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1

Revision history for this message
Doug McMahon (mc3man) wrote :

Downgrading mesa to 17.10 proposed again then upgrading in smallest groups possible (libegl1-mesa, libgl1-mesa-dri & deps first) it's this final 3 group that starts the corruption

Upgraded the following packages:
libgl1-mesa-glx (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libglapi-mesa (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1
libgles2-mesa (17.2.8-0ubuntu0~17.10.1) to 17.3.3-0ubuntu1

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. Yeah I knew it was working till recently so suspected the Mesa update caused it.

Changed in mesa (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mesa (Ubuntu):
status: New → Confirmed
no longer affects: gstreamer-vaapi (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, so it sounds like the regression probably occurred in Mesa 17.3 recently, and it looks like it only affects clutterautovideosink (used by Totem) in Xorg sessions.

THESE WORK:

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

gst-launch-1.0 filesrc location=bbb_sunflower_1080p_60fps_normal.mp4 ! qtdemux ! vaapidecodebin ! ximagesink

gst-launch-1.0 filesrc location=bbb_sunflower_1080p_60fps_normal.mp4 ! qtdemux ! vaapidecodebin ! xvimagesink

THIS DOESN'T WORK:

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

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Although this does work:

gst-launch-1.0 filesrc location=bbb_sunflower_1080p_60fps_normal.mp4 ! qtdemux ! avdec_h264 ! clutterautovideosink

So it's the combination vaapidecodebin + clutterautovideosink that doesn't work any more.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Similarly to comment #13

THESE WORK:

gst-play-1.0 --videosink glimagesink bbb_sunflower_1080p_60fps_normal.mp4
gst-play-1.0 --videosink xvimagesink bbb_sunflower_1080p_60fps_normal.mp4
gst-play-1.0 --videosink ximagesink bbb_sunflower_1080p_60fps_normal.mp4

THIS DOESN'T:

gst-play-1.0 --videosink clutterautovideosink bbb_sunflower_1080p_60fps_normal.mp4

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in clutter-gst-3.0 (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

To undo the above workaround you can do this:

sudo apt install --reinstall libgl1-mesa-glx/bionic libglapi-mesa/bionic

Changed in totem (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → nobody
Changed in mesa:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
dino99 (9d9) wrote :

An other similar issue on Xenial which probably use mesa 17.2.4 (proposed not enabled)
lp:1746771

Revision history for this message
shemgp (shemgp) wrote :

Verified that the patch in fd works in mesa 17.3.3. People may test here: https://launchpad.net/~shemgp/+archive/ubuntu/testing

Although, totem still runs at like 10~18% CPU while mpv is lower at 3~5%.

Revision history for this message
dino99 (9d9) wrote :

@shemgp
thanks for the ppa, and pointing to mpv, i was not aware of that app

Enabled the ppa on Bionic, and upgraded the system with your packages. Restarted the gnome-shell session (alt+F2+r), then started gtkorphan that was previously exposing a dropdown black menu: but no luck, the problem persist.

Revision history for this message
dino99 (9d9) wrote :

oops

forget the #20 comment above; i've answered to the wrong report

With shemgp's mesa upgrade, totem is playing as expected.
Hope upstream/ubuntu will accept that version/change

Revision history for this message
dino99 (9d9) wrote :
Changed in mesa:
status: Confirmed → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

WORKAROUND (1):

Install these two together:
https://launchpad.net/ubuntu/+source/mesa/17.2.4-0ubuntu2/+build/13697262/+files/libgl1-mesa-glx_17.2.4-0ubuntu2_amd64.deb
https://launchpad.net/ubuntu/+source/mesa/17.2.4-0ubuntu2/+build/13697262/+files/libglapi-mesa_17.2.4-0ubuntu2_amd64.deb

WORKAROUND (2):

sudo apt remove gstreamer1.0-vaapi

WORKAROUND (3):

Log in to "Ubuntu on Wayland" instead of "Ubuntu".

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mesa (Ubuntu):
assignee: nobody → Timo Aaltonen (tjaalton)
status: Confirmed → Fix Committed
no longer affects: clutter-gst-3.0 (Ubuntu)
Revision history for this message
dino99 (9d9) wrote :

@Daniel

mesa 18 have been successfully built , but the packages still have not landed into 'proposed' archive.

Revision history for this message
dino99 (9d9) wrote :
Revision history for this message
dino99 (9d9) wrote :

Packages landed now, and upgrade is ok (if purging previous shemgp ppa first, in case of use)

mesa (18.0.0~rc4-1ubuntu1) bionic; urgency=medium

  * Merge with Debian experimental.
  * Stop using alternatives, not needed anymore with libglvnd.
  * patches: Mir patches updated.
  * dri3-reinstate-get_dri_screen-callback.diff: Fix a regression in
    accelerated video playback. (LP: #1747744)
  * control: Add nvidia-304/340/384 to libegl-mesa0, libgles2-mesa and
    libglx-mesa0 Breaks.

 -- Timo Aaltonen <email address hidden> Tue, 13 Feb 2018 17:56:35 +0200

Changed in mesa (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
dino99 (9d9) wrote :

And totem reads video without problem with mesa 18

Revision history for this message
dino99 (9d9) wrote :

Clearly cant blame totem.

Changed in totem (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

don't jump the gun, mesa hasn't landed in bionic yet and won't land before nvidia is fixed to work with libglvnd..

Changed in mesa (Ubuntu):
status: Fix Released → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please don't close the totem task. It is there to help other people find this bug while it's open. That's all.

Changed in totem (Ubuntu):
status: Invalid → Confirmed
Changed in mesa:
status: In Progress → Fix Released
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mesa - 18.0.0~rc4-1ubuntu3

---------------
mesa (18.0.0~rc4-1ubuntu3) bionic; urgency=medium

  * dont-enable-10bpc-by-default.diff: Replace the drirc hack, just flip
    the default to not enable 10bpc configs by default for gallium drivers.
    (LP: #1752123)

 -- Timo Aaltonen <email address hidden> Wed, 28 Feb 2018 19:34:58 +0200

Changed in mesa (Ubuntu):
status: Fix Committed → Fix Released
no longer affects: totem (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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