Broadwell vaapi video decode broken by i915_bpo migration

Bug #1507994 reported by Stephen Thirlwall
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
High
Timo Aaltonen
Vivid
Expired
High
Unassigned
Wily
Invalid
High
Timo Aaltonen

Bug Description

Since upgrading from linux-image-3.19.0-28-generic to linux-image-3.19.0-30-generic, vaapi-accelerated video playback on Kodi 15.2 (and 15.1) is now all black.

On-screen display items (eg. elapsed time) and audio still work, but the decoded video content is now all black. Disabling vaapi acceleration in the Kodi options restores the video playback.

I have bisected the problem to this commit: http://kernel.ubuntu.com/git/ubuntu/ubuntu-vivid.git/commit/?id=059c4a45e7a0233ab06b16f591a7877d11f6d79c

The problem still happens in Ubuntu-3.19.0-31.36, as well as Ubuntu-4.0.0-1.2 and Ubuntu-4.2.0-16.19 from the ubuntu-wily repo.

It appears that the above commit flicks the switch on many changes, and doesn't really shed too much light on what the actual problem might be.

I've tried moving that commit earlier into the history in the hope that I might be able to find a 'good' point to bisect from, but had no luck. The furthest I was able to push it back was http://kernel.ubuntu.com/git/ubuntu/ubuntu-vivid.git/commit/?id=59b6d9aaa4c379d84930598183cb4911a2713ff4, but the problem remained.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: linux-image-3.19.0-30-generic 3.19.0-30.34
ProcVersionSignature: Ubuntu 3.19.0-30.34-generic 3.19.8-ckt6
Uname: Linux 3.19.0-30-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.5
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: sdt 1916 F.... kodi.bin
Date: Tue Oct 20 21:39:48 2015
InstallationDate: Installed on 2015-05-03 (170 days ago)
InstallationMedia: Ubuntu-Server 14.10 "Utopic Unicorn" - Release amd64 (20141022.2)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.19.0-30-generic.efi.signed root=UUID=fb2f2c21-efe7-405c-b354-4a462517f241 ro
RelatedPackageVersions:
 linux-restricted-modules-3.19.0-30-generic N/A
 linux-backports-modules-3.19.0-30-generic N/A
 linux-firmware 1.143.3
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
SourcePackage: linux
UpgradeStatus: Upgraded to vivid on 2015-05-03 (170 days ago)
dmi.bios.date: 08/12/2015
dmi.bios.vendor: Intel Corporation
dmi.bios.version: RYBDWi35.86A.0350.2015.0812.1722
dmi.board.name: NUC5i3RYB
dmi.board.vendor: Intel Corporation
dmi.board.version: H41000-502
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorporation:bvrRYBDWi35.86A.0350.2015.0812.1722:bd08/12/2015:svn:pn:pvr:rvnIntelCorporation:rnNUC5i3RYB:rvrH41000-502:cvn:ct3:cvr:

Revision history for this message
Stephen Thirlwall (l-sdt) wrote :
Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

I've previously reported this behaviour here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1488719/comments/25

I'm reporting this as a separate bug as I now suspect the "master control interrupt lied" message is unrelated.

Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: kernel-da-key
Changed in linux (Ubuntu):
importance: Medium → High
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Does vlc with vaapi work for you? It does here, so what does kodi do differently?

Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

I'll give vlc a try when I get home tonight.

Does that mean you've been able to reproduce the kodi behaviour?

Revision history for this message
penalvch (penalvch) wrote :

Stephen Thirwall, could you please test the latest upstream kernel available from the very top line at the top of the page from http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D (the release names are irrelevant for testing, and please do not test the daily folder)? Install instructions are available at https://wiki.ubuntu.com/Kernel/MainlineBuilds . This will allow additional upstream developers to examine the issue.

If the latest kernel did not allow you to test to the issue (ex. you couldn't boot into the OS) please make a comment in your report about this, and continue to test the next most recent kernel version until you can test to the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this issue is fixed in the mainline kernel, please add the following tags by clicking on the yellow circle with a black pencil icon, next to the word Tags, located at the bottom of the report description:
kernel-fixed-upstream
kernel-fixed-upstream-X.Y-rcZ

Where X, Y, and Z are numbers corresponding to the kernel version.

If the mainline kernel does not fix the issue, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-X.Y-rcZ

Please note, an error to install the kernel does not fit the criteria of kernel-bug-exists-upstream.

Once testing of the latest upstream kernel is complete, please mark this report's Status as Confirmed. Please let us know your results.

Thank you for your understanding.

tags: added: latest-bios-0350
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

No, I haven't installed kodi to try it, just that vlc still works fine with vaapi.

Timo Aaltonen (tjaalton)
Changed in linux (Ubuntu Wily):
assignee: nobody → Timo Aaltonen (tjaalton)
Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

vlc works with vaapi

vlc reports:

libva info: VA-API version 0.37.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_0_37
libva info: va_openDriver() returns 0
[00007fc474c0ae78] avcodec decoder: Using Intel i965 driver for Intel(R) Broadwell - 1.5.0 for hardware decoding.

tags: added: kernel-bug-exists-upstream
tags: added: kernel-bug-exists-upstream-4.3-rc6
Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

Tested http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.3-rc6-unstable/linux-image-4.3.0-040300rc6-generic_4.3.0-040300rc6.201510182030_amd64.deb

Problem remains, although the first playback seems to work about half the time, then subsequent ones fail.

I run kodi standalone with xinit, so when I say first playback I mean kodi and X11 both freshly started.

Added tags as requested: kernel-bug-exists-upstream kernel-bug-exists-upstream-4.3-rc6

Changing status to Confirmed as requested.

Changed in linux (Ubuntu Wily):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Stephen Thirwall, to see if this already resolved upstream, could you please test the latest drm-intel-nightly via http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-nightly/ and advise to the results?

Changed in linux (Ubuntu Vivid):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

Tested http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-nightly/2015-10-17-unstable/linux-image-4.3.0-994-generic_4.3.0-994.201510162200_amd64.deb

This kernel does not resolve the problem.

(there's two newer directories, but these only contain i386 builds)

Revision history for this message
Peter Frühberger (peter-fruehberger) wrote :

Comparing with VLC will lead to nothing as it does not use VAAPI for uploading the decoded surfaces. You can test mplayer-vaapi / mpv with vaapi output to see the issue. From a first point of view I think this change did not break the decoder but the transfer of decoded surfaces to GLX via vaputSurface, which would be really critical not only for kodi.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Ok, then how to get mpv use vaapi? Trying 'mpv --hwdec=vaapi --vo=opengl-hq' as suggested somewhere still results in software decoding according to the debug output. Tried big buck bunny 1080p avi and 720p ogg.

Revision history for this message
Peter Frühberger (peter-fruehberger) wrote :

Try: --hwdec=vaapi -vo=vaapi

We made some tests on kodi forum, yes - if bypassing vaPutSurface and copying the surfaces manually with SSE4 "workarounds" the bug. So, yes - accelerated vaPutSurface seems to be broken with this kernel change.

Revision history for this message
Peter Frühberger (peter-fruehberger) wrote :

Sorry: vo=opengl in combination with --hwdec=vaapi please

I also don't know if the mpv package you are using is some cripled debian / ubuntu version with patched out stuff. But you can easily try with the kodi package ubuntu ships. Turn on VAAPI and Prefer VAAPI Render-Method, that should make the issue clearly visible. Afterwards downgrade the kernel and see it working again.

Btw. using the CHV driver in combination with the very outdated vaapi 1.5.0 I don't consider a great choice either. CHV started to work "mostly bugfree" after libva / libva-driver-intel 1.6.1 was released.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

At this point it would be most useful to bisect where it broke upstream, somewhere between 3.19..4.2 as it seems.

I'm running BDW with wily, don't see anything being crippled on mpv. Using vo=vaapi shows it finds the va driver but still uses software decoding.

libva 1.5.0 was latest available for vivid, now wily has 1.6.0.

penalvch (penalvch)
tags: added: bisect-done regression-update
Changed in linux (Ubuntu Vivid):
status: Incomplete → Triaged
importance: Medium → High
tags: added: trusty utopic
tags: added: wily
removed: utopic
Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

Shall do.

One question: should I be using the latest mainline kernel, or the latest drm-intel-nightly for the Kernel.org bug report?

Revision history for this message
Peter Frühberger (peter-fruehberger) wrote :

Best would be if you could bisect on mainline kernel to find the offending commit. But for the bugreport it does not really matter as it is a regression in mainline 4.3-rc6 kernel, so that needs fixing.

You could try 4.2.x mainline before that which would "help" in finding the regression already.

penalvch (penalvch)
Changed in linux (Ubuntu Vivid):
status: Triaged → Incomplete
tags: added: needs-bisect
removed: bisect-done
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Eh, the regression is somewhere in upstream 3.19..4.2, not -ckt series. Try mainline ppa builds to get a rough idea first, then dive in.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Then you missed that the regression was triggered by BDW using i915_bpo since -30, and it's backported from 4.2.

Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

Bug report posted to linux-gfx

  http://lists.freedesktop.org/archives/intel-gfx/2015-October/078660.html

I'll get started on bisecting the mainline kernel.

Revision history for this message
penalvch (penalvch) wrote :

Timo Aaltonen, I didn't miss it. I had just woke up too early. ;)

Stephen Thirlwall, to clarify, you would want to bisect first, then report. They aren't going to pay attention to a regression that isn't bisected as previously advised.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

And the mailing list is not a bug tracker, http:/bugs.freedesktop.org is (DRI, DRM/Intel)

Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

The offending upstream commit appears to be:

  http://kernel.ubuntu.com/git/virgin/linux.git/commit/?id=dc9fb09cae5b1355c1a9d8102e40b97b34332f31

I still need to test this with mpv, and there's been some new mainline & intel-drm-nightly kernels released since by last attempt.

Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

I haven't been able to reproduce this behaviour with mpv.

I've tried all combinations of --vo=opengl / --vo=vaapi and --hwdev=vaapi and they all display correctly.

mpv 0.8.0 (C) 2000-2015 mpv/MPlayer/mplayer2 projects
 built on 2015-02-19T17:03:21
libav library versions:
   libavutil 54.3.0
   libavcodec 56.1.0
   libavformat 56.1.0
   libswscale 3.0.0
   libavfilter 5.0.0
   libavresample 2.1.0

Revision history for this message
Stephen Thirlwall (l-sdt) wrote :

Upgrading to wily has fixed this for me.

penalvch (penalvch)
Changed in linux (Ubuntu Vivid):
status: Incomplete → Invalid
Changed in linux (Ubuntu Wily):
status: Confirmed → Invalid
Changed in linux (Ubuntu Vivid):
status: Invalid → Incomplete
Changed in linux (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu Vivid) because there has been no activity for 60 days.]

Changed in linux (Ubuntu Vivid):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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