Bug 76755

Summary: libva 1.3.0 causes some videos played by xbmc to show up as black screens only
Product: libva Reporter: John <da_audiophile>
Component: intelAssignee: haihao <haihao.xiang>
Status: RESOLVED FIXED QA Contact: Sean V Kelley <seanvk>
Severity: major    
Priority: medium CC: fphillips81, jonah.bernhard, Spoon3er
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: non-working ivy bridge Xorg.0.log
non-working Haswell Xorg.0.log
xbmc.log

Description John 2014-03-28 18:33:07 UTC
When using xbmc to play an x264 video using vaapi on Intel Haswell hardware, the screen simply goes black; the movie plays since audio is heard, but there is no video being shown on the screen.  If I disable vaapi from within xbmc, the video file plays as expected.  If I downgrade libva version 1.3.0 to version 1.2.1 and leave the hardware acceleration enabled, the video plays as expected.

I'm not seeing anything in the xbmc.log that would indicate a problem.  Glad to post any logs/tests upon request.

Hardware: Intel i3-4130T on an H87 motherboard.
Distro: Arch Linux x86_64
Relevant packages:
intel-dri 10.1.0-4
iibva-intel-driver 1.3.0-1
xf86-video-intel 2.99.911-1
libva 1.2.1-2
libva-intel-driver 1.3.0-1

This bug has been produced on several other systems using these drivers (Ivybridge as well) as noted in the following discussion thread: https://bbs.archlinux.org/viewtopic.php?pid=1397905
Comment 1 John 2014-03-28 18:42:27 UTC
I just build libva from git (1.3.0.2.g8f6a3dd) and found that it did not fix this issue.
Comment 2 jonah.bernhard 2014-03-28 18:59:30 UTC
Same problem here with an Intel i3-4330 and identical software.

Here is an xbmc debug log acquired while starting a video and seeing the blank screen.  I don't see anything obviously wrong.



14:40:24 T:140451617945344   DEBUG: CDVDPlayer::SetCaching - caching state 0
14:40:24 T:140451914708736    INFO: CAESinkALSA::Initialize - Attempting to open device "default"
14:40:24 T:140451914708736    INFO: CAESinkALSA::Initialize - Opened device "default"
14:40:24 T:140451914708736    INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
14:40:24 T:140451914708736    INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S32NE
14:40:24 T:140451914708736   DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 2205, bufferSize 8820
14:40:24 T:140451914708736   DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 464, bufferSize 8816
14:40:24 T:140451914708736   DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 200 ms
14:40:24 T:140451914708736   DEBUG: CSoftAE::Run - Sink was forgotten
14:40:24 T:140451914708736   DEBUG: CSoftAE::Run - Sink restart flagged
14:40:24 T:140451914708736    INFO: CSoftAE::InternalOpenSink - RAW passthrough enabled
14:40:24 T:140451914708736    INFO: CSoftAE::InternalOpenSink - sink incompatible, re-starting
14:40:24 T:140451914708736    INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=HDMI,DEV=1"
14:40:24 T:140451914708736    INFO: CAESinkALSA::Initialize - Opened device "hdmi:CARD=HDMI,DEV=1,AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x02"
14:40:24 T:140451914708736   DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 2400, bufferSize 9600
14:40:24 T:140451914708736   DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 2400, bufferSize 9600
14:40:24 T:140451914708736   DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 200 ms
14:40:24 T:140451914708736   DEBUG: CSoftAE::InternalOpenSink - ALSA Initialized:
14:40:24 T:140451914708736   DEBUG:   Output Device : HDA Intel
14:40:24 T:140451914708736   DEBUG:   Sample Rate   : 48000
14:40:24 T:140451914708736   DEBUG:   Sample Format : AE_FMT_S16NE
14:40:24 T:140451914708736   DEBUG:   Channel Count : 2
14:40:24 T:140451914708736   DEBUG:   Channel Layout: FL,FR
14:40:24 T:140451914708736   DEBUG:   Frames        : 2400
14:40:24 T:140451914708736   DEBUG:   Frame Samples : 4800
14:40:24 T:140451914708736   DEBUG:   Frame Size    : 4
14:40:24 T:140451914708736   DEBUG: CSoftAE::InternalOpenSink - Internal Buffer Size: 9600
14:40:24 T:140450128197376   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback
14:40:24 T:140450128197376   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(32000.000000, 1)
14:40:24 T:140450128197376   DEBUG: CDVDPlayerAudio:: Discontinuity1 - was:0.731667, should be:1.078667, error:0.347000
14:40:24 T:140451617945344   DEBUG: CDVDPlayer::HandleMessages - player started 1
14:40:24 T:140451914708736   DEBUG: CSoftAE::Run - Sink restart flagged
14:40:24 T:140451914708736    INFO: CSoftAE::InternalOpenSink - RAW passthrough enabled
14:40:24 T:140451914708736    INFO: CSoftAE::InternalOpenSink - keeping old sink with : AE_FMT_AC3, FL,FR, 48000hz
14:40:24 T:140451914708736   DEBUG: CSoftAE::InternalOpenSink - Internal Buffer Size: 9600
14:40:24 T:140450209494784 WARNING: CRenderManager::Configure - timeout waiting for previous frame
14:40:24 T:140450209494784   DEBUG: Resolution HDMI2: 1920x1080 @ 59.94Hz (18) not a very good match for fps 25.000 (weight: 0.199), trying 2:3 cadence
14:40:24 T:140450209494784   DEBUG: Resolution HDMI2: 1920x1080 @ 59.94Hz (18) not a very good match for fps 25.000 with 2:3 cadence (weight: 0.041), choosing 60 hertz
14:40:24 T:140450209494784  NOTICE: Display resolution ADJUST : 1920x1080 @ 60.00 - Full Screen (16) (weight: 0.200)
14:40:24 T:140452370278336   DEBUG: Activating window ID: 12005
14:40:24 T:140452370278336   DEBUG: ------ Window Deinit (MyVideoNav.xml) ------
14:40:24 T:140452370278336   DEBUG: ------ Window Init (VideoFullScreen.xml) ------
14:40:24 T:140452370278336  NOTICE: Using GL_TEXTURE_2D
14:40:24 T:140452370278336  NOTICE: GL: Using VAAPI render method
14:40:24 T:140452370278336  NOTICE: GL: NPOT texture support detected
14:40:24 T:140452370278336  NOTICE: GL: Using GL_ARB_pixel_buffer_object
14:40:24 T:140451617945344   DEBUG: CDVDPlayer::HandleMessages - player started 2
14:40:24 T:140452370278336   DEBUG: CLinuxRendererGL::UploadVAAPITexture - creating vaapi surface for texture 1
14:40:24 T:140452370278336   DEBUG: CLinuxRendererGL::UploadVAAPITexture - creating vaapi surface for texture 0
14:40:28 T:140450128197376   DEBUG: CDVDPlayerAudio:: Discontinuity2 - was:4060548.938667, should be:4050386.459656, error:-10162.479011
14:40:28 T:140450209494784   DEBUG: CPullupCorrection: detected pattern of length 1: 40000.00, frameduration: 40000.000000
Comment 3 John 2014-03-29 12:22:17 UTC
I can also see an error from mplayer when attempting to play a file, but I believe mplayer will auto fall back which is why it still plays:



MPlayer SVN-r37051 (C) 2000-2014 MPlayer Team
207 audio & 440 video codecs
...
libavformat version 55.33.100 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (ac3), -aid 0
VIDEO:  [H264]  1280x720  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 encoder: libebml v1.3.0 + libmatroska v1.4.0
Failed to open VDPAU backend libvdpau_i965.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
...
Comment 4 John 2014-03-29 21:45:19 UTC
Perhaps helpful for debugging.  I ran xbmc from a shell and attempted to play an x264 video three times each time using a different video output setting shown below.

1) No vdpau and no vaapi; video played.
% xbmc
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

2) Just vdpau enabled; video played.
% xbmc
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Failed to open VDPAU backend libvdpau_i965.so: cannot open shared object file: No such file or directory

3) Just vaapi; video did NOT play.
% xbmc
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Comment 5 haihao 2014-03-31 03:55:24 UTC
(In reply to comment #3)
> I can also see an error from mplayer when attempting to play a file, but I
> believe mplayer will auto fall back which is why it still plays:
> 
> 
> 
> MPlayer SVN-r37051 (C) 2000-2014 MPlayer Team
> 207 audio & 440 video codecs
> ...
> libavformat version 55.33.100 (internal)
> libavformat file format detected.
> [lavf] stream 0: video (h264), -vid 0
> [lavf] stream 1: audio (ac3), -aid 0
> VIDEO:  [H264]  1280x720  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
> Clip info:
>  encoder: libebml v1.3.0 + libmatroska v1.4.0
> Failed to open VDPAU backend libvdpau_i965.so: cannot open shared object
> file: No such file or directory
> [vdpau] Error when calling vdp_device_create_x11: 1
> ...

I don't know what is libvdpau_i965.so. If you want to use mplayer + vaapi(libva), it would be better to use 
git://gitorious.org/vaapi/mplayer.git with hwaccel-vaapi branch.
Comment 6 haihao 2014-03-31 04:08:16 UTC
> 3) Just vaapi; video did NOT play.
> % xbmc
> libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
> libva info: VA-API version 0.35.0
> libva info: va_getDriverName() returns 0
> libva info: Trying to open /usr/lib/dri/i965_drv_video.so
> libva info: Found init function __vaDriverInit_0_35
> libva info: va_openDriver() returns 0

I can not reproduce this issue. my xbmc was built against libva 1.2.1 + libva-intel-driver 1.2.2 however it ran under libva1.3.0 + libva-intel-driver 1.3.0
Comment 7 Kevin Mitchell 2014-04-10 07:04:34 UTC
I can reproduce this with mpv on my ivybridge machine, but not on my comparably configured sandybridge machine.
https://github.com/mpv-player/mpv/issues/701
Comment 8 jonah.bernhard 2014-04-10 11:59:00 UTC
I have the same behavior as Kevin when using mpv on both Ivy Bridge and Haswell.
Comment 9 haihao 2014-04-11 05:42:43 UTC
I can't reproduce this issue with mpv on both Ivybridge and Haswell. The relevant packages used on my machines:

Mesa 10.1.0 (git-4a86465)
X.Org X Server 1.15.99.902 (1.16.0 RC 2)
xf86-video-intel 2.99.911
libva/libva-intel-driver: 1.3.0 or git master
ffmpeg 2.1.4
mpv: git master
Comment 10 haihao 2014-04-11 05:45:05 UTC
Did you build your xbmc or mpv against libva version 1.2.1 or version 1.3.0 ? Could you attach your Xorg.0.log ?
Comment 11 Kevin Mitchell 2014-04-11 07:07:19 UTC
linux 3.14
Mesa 10.1.0 
X.Org X Server 1.15.0.901
xf86-video-intel 2.21.15-2+b1
libva/libva-intel-driver: 1.3.0 or git master
(mpv=0.3.7 && libav=9.11-3+b2) || (mpv=git master && ffmpeg=git master)
Comment 12 Kevin Mitchell 2014-04-11 07:08:39 UTC
Created attachment 97212 [details]
non-working ivy bridge Xorg.0.log
Comment 13 Kevin Mitchell 2014-04-11 07:10:20 UTC
It's in the mpv bug report, but I should also clarify that to see this bug in mpv requires:
$ mpv --vo=opengl --hwdec=vaapi

It works fine with
$ mpv --vo=vaapi --hwdec=vaapi
Comment 14 jonah.bernhard 2014-04-11 13:50:31 UTC
I just rebuilt mpv against libva 1.3.0 and the problem persists.
Comment 15 Spooner 2014-04-12 20:59:19 UTC
I have the same Problems as posted in the description.

Hardware: Intel i5-4570 on Q87 motherboard
Distro: Arch Linux x86_64
Relevant packages:
intel-dri 10.1.0-5
iibva-intel-driver 1.3.0-1
xf86-video-intel 2.99.911-1
libva 1.3.0-1
libva-intel-driver 1.3.0-2
X.Org X Server 1.15.0.901

output vainfo:
libva info: VA-API version 0.35.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_35
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.35 (libva 1.3.0)
vainfo: Driver version: Intel i965 driver - 1.3.0
Comment 16 Spooner 2014-04-12 21:00:32 UTC
Created attachment 97276 [details]
non-working Haswell Xorg.0.log
Comment 17 Spooner 2014-04-12 21:02:53 UTC
Created attachment 97277 [details]
xbmc.log

Overall 3playbacks in this logfile. 
1. without hardware decoding (VAAPI disabled in xbmc)
2. with hardware decoding (VAAPI enabled in xbmc)
3. without hardware decoding (VAAPI disabled in xbmc)
Comment 18 Frank Phillips 2014-04-14 06:28:45 UTC
I believe this is a bug in xorg-server and is fixed in version 1.15.1 with this commit

glx: Clear new FBConfig attributes to 0 by default.

http://cgit.freedesktop.org/xorg/xserver/commit/?h=server-1.15-branch&id=eec04d76a39a7334de4e00ef9f0f6e44c92b3d91

I had sound but no video (black screen) on IVB hardware with MythTV using vaapi decoder and openglvaapi renderer directly before building xorg-server 1.15.1 and after install and restart X the video was normal.
Comment 19 Frank Phillips 2014-04-14 07:19:12 UTC
haihao is on the master branch of xorg-server, which has had the fix since 10 March, and why he couldn't reproduce it.

http://cgit.freedesktop.org/xorg/xserver/commit/?id=96a28e9c914d7ae9b269f73a27b99cbd3c465ac8

libva 1.3.0 may have exposed the bug with this commit

http://cgit.freedesktop.org/libva/commit/?id=b4a4f9b212d8b0bf41a910a85a4898573261d2a7
Comment 20 haihao 2014-04-14 07:24:03 UTC
(In reply to comment #18)
> I believe this is a bug in xorg-server and is fixed in version 1.15.1 with
> this commit
> 
> glx: Clear new FBConfig attributes to 0 by default.
> 
> http://cgit.freedesktop.org/xorg/xserver/commit/?h=server-1.15-
> branch&id=eec04d76a39a7334de4e00ef9f0f6e44c92b3d91
> 
> I had sound but no video (black screen) on IVB hardware with MythTV using
> vaapi decoder and openglvaapi renderer directly before building xorg-server
> 1.15.1 and after install and restart X the video was normal.

Great.  Thanks for your catching.  A commit (b4a4f9b) in libva reveals xserver bug.
I confirmed Both xserver 1.15.1 and 1.16.0 RC 2 fix this issue.
Comment 21 haihao 2014-04-15 03:16:14 UTC
A workaround is added in libva in case people still use older version of xorg-server.

commit 0d60132599318695dd1af8d51d2b160623ac4406
Author: Rinat Ibragimov <ibragimovrinat@mail.ru>
Date:   Tue Apr 15 11:01:43 2014 +0800

    Add a workaround for a bug in xorg-server/glx
Comment 22 Spooner 2014-04-15 18:51:30 UTC
I can confirm works with xorg-server 1.15.0

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.