Bug 92811 - Having issue playing video in fullscreen mode in wayland weston with different platform.
Summary: Having issue playing video in fullscreen mode in wayland weston with differen...
Status: RESOLVED WONTFIX
Alias: None
Product: libva
Classification: Unclassified
Component: intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: PengChen
QA Contact: Sean V Kelley
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-04 11:17 UTC by Lim Siew Hoon
Modified: 2016-12-07 05:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Lim Siew Hoon 2015-11-04 11:17:29 UTC
Environment: 
libva 1.6.2 pre1
intel-va driver 1.6.2 pre1
OS: Fedora22 64bit with Wayland Weston 1.8.0 version
Gstreamer-vaapi: master
Gstreamre framework: 1.6.0 version
libdrm 2.4.65 version
mesa: 10.6.9 version
Platform: SNB 

No issue playing the video in X11 enviroment. But playing in Wayland Weston, then got received segmentation fault message, video can't play at all. Some video can play, but when running in fullscreen, received segmentation fault.
This happen in Sandy Bridge.

gst-launch-1.0 -v filesrc location=video_800x600.mp4 ! qtdemux ! vaapidecode ! vaapisink

gst-launch-1.0 -v filesrc location=video_800x600.mp4 ! qtdemux ! vaapidecode ! vaapisink fullscreen=true


In The cgdb, is showing this issue happen in drm_intel_bo_get_tiling function in libdrm, trying access drm_intel_bo *bo that is 0x0. 

libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'vaapidecode0': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)3
\,\ profile\=\(string\)main\,\ codec_data\=\(buffer\)014d401effe10018674d401eeca06409bf2c20000003002000000781e2c5b2c001000468ebecb2\,\ width\=\(int\)800\,\ height\=\
(int\)600\,\ framerate\=\(fraction\)30/1\,\ pixel-aspect-ratio\=\(fraction\)1/1"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:src: caps = "video/x-raw\(memory:VASurface\)\,\ format\=\(string\)I420\,\ width\=\(int\)800\,\ height\=\(in
t\)600\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=
\(fraction\)30/1"
Redistribute latency...
/GstPipeline:pipeline0/GstVaapiSink:vaapisink0.GstPad:sink: caps = "video/x-raw\(memory:VASurface\)\,\ format\=\(string\)I420\,\ width\=\(int\)800\,\ height\=\(int\)
600\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=\(f
raction\)30/1"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:src: caps = "video/x-raw\(memory:VASurface\)\,\ format\=\(string\)I420\,\ width\=\(int\)800\,\ height\=\(in
t\)608\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=
\(fraction\)30/1"
Redistribute latency...
/GstPipeline:pipeline0/GstVaapiSink:vaapisink0.GstPad:sink: caps = "video/x-raw\(memory:VASurface\)\,\ format\=\(string\)I420\,\ width\=\(int\)800\,\ height\=\(int\)
608\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=\(f
raction\)30/1"
[New Thread 0x7fffe7a5e700 (LWP 1590)]
[New Thread 0x7fffe725d700 (LWP 1591)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe7a5e700 (LWP 1590)]
drm_intel_bo_get_tiling (bo=0x0, tiling_mode=0x7fffe7a5cf98, swizzle_mode=0x7fffe7a5cf9c) at intel_bufmgr.c:255
Missing separate debuginfos, use: dnf debuginfo-install bzip2-libs-1.0.6-14.fc22.x86_64 elfutils-libelf-0.163-4.fc22.x86_64 elfutils-libs-0.163-4.fc22.x86_64 expat-2
.1.0-10.fc22.x86_64 glib2-2.44.1-2.fc22.x86_64 libattr-2.4.47-10.fc22.x86_64 libcap-2.24-7.fc22.x86_64 libffi-3.1-7.fc22.x86_64 libgcc-5.1.1-4.fc22.x86_64 libpciacce
.1.0-10.fc22.x86_64 glib2-2.44.1-2.fc22.x86_64 libattr-2.4.47-10.fc22.x86_64 libcap-2.24-7.fc22.x86_64 libffi-3.1-7.fc22.x86_64 libgcc-5.1.1-4.fc22.x86_64 libpciacce
ss-0.13.3-0.3.fc22.x86_64 libX11-1.6.3-1.fc22.x86_64 libXau-1.0.8-4.fc22.x86_64 libXdamage-1.1.4-6.fc22.x86_64 libXext-1.3.3-2.fc22.x86_64 libXfixes-5.0.1-4.fc22.x86
_64 libXrender-0.9.9-1.fc22.x86_64 libXxf86vm-1.1.4-1.fc22.x86_64 systemd-libs-219-25.fc22.x86_64 xz-libs-5.2.0-2.fc22.x86_64 zlib-1.2.8-7.fc22.x86_64
(gdb) bt
#0  0x00007fffe7cebf70 in drm_intel_bo_get_tiling (bo=0x0, tiling_mode=0x7fffe7a5cf98, swizzle_mode=0x7fffe7a5cf9c) at intel_bufmgr.c:255
#1  0x00007fffe7f695c1 in i965_pp_set_surface_state (surf_bo=0x0, surf_bo_offset=surf_bo_offset@entry=0, width=width@entry=200, height=height@entry=608, pitch=pitch@entry=800, format=320, index=7, is_target=1, pp_context=0x7fffe006fb70, ctx=<optimized out>) at i965_post_processing.c:1817
#2  0x00007fffe7f6ce78 in pp_nv12_avs_initialize (ctx=<optimized out>, pp_context=0x7fffe006fb70, src_surface=0x7fffe7a5d1c0, src_rect=0x7fffe7a5d1a0, dst_surface=0x7fffe7a5d1d0, dst_rect=0x7fffe7a5d1b0, filter_param=0x0) at i965_post_processing.c:2740
#3  0x00007fffe7f68aed in gen6_post_processing (filter_param=<optimized out>, pp_index=<optimized out>, dst_rect=0x7fffe7a5d1b0, dst_surface=<optimized out>, src_rect=<optimized out>, src_surface=<optimized out>, pp_context=0x7fffe006fb70, ctx=0x75e020) at i965_post_processing.c:4383
#4  0x00007fffe7f68aed in gen6_post_processing (ctx=0x75e020, pp_context=0x7fffe006fb70, src_surface=<optimized out>, src_rect=<optimized out>, dst_surface=<optimized out>, dst_rect=0x7fffe7a5d1b0, pp_index=5, filter_param=0x0) at i965_post_processing.c:4714
#5  0x00007fffe7f6f33c in i965_proc_picture (filter_param=0x0, pp_index=<optimized out>, dst_rect=0x7fffe7a5d1b0, dst_surface=0x7fffe7a5d1d0, src_rect=0x7fffe7a5d1a0, src_surface=0x7fffe7a5d1c0, pp_context=0x7fffe006fb70, ctx=0x75e020) at i965_post_processing.c:4748
#6  0x00007fffe7f6f33c in i965_proc_picture (proc_state=0x767bf0, proc_state=0x767bf0, proc_context=0x7fffe006fb50, ctx=0x75e020) at i965_post_processing.c:5762
#7  0x00007fffe7f6f33c in i965_proc_picture (ctx=0x75e020, profile=<optimized out>, codec_state=0x767bf0, hw_context=0x7fffe006fb50) at i965_post_processing.c:5788
#8  0x00007fffecb2ccff in vaEndPicture (dpy=0x75cd60, context=33554433) at va.c:1216
#9  0x00007fffecd6b681 in gst_vaapi_filter_process (flags=<optimized out>, dst_surface=0x7fffe006b280, src_surface=0x7fffe0007400, filter=0x7883b0) at gstvaapifilter.c:1522
#10 0x00007fffecd6b681 in gst_vaapi_filter_process (filter=0x7883b0, src_surface=src_surface@entry=0x7fffe0007400, dst_surface=dst_surface@entry=0x7fffe006b280, flags=<optimized out>) at gstvaapifilter.c:1552
#11 0x00007fffed1f5f12 in gst_vaapi_window_wayland_render (flags=<optimized out>, dst_rect=0x75df70, src_rect=0x7fffe7a5d440, surface=0x7fffe0007400, window=0x7fffe0004820) at gstvaapiwindow_wayland.c:429
#12 0x00007fffed1f5f12 in gst_vaapi_window_wayland_render (window=0x7fffe0004820, surface=0x7fffe0007400, src_rect=0x7fffe7a5d440, dst_rect=0x75df70, flags=<optimized out>) at gstvaapiwindow_wayland.c:498
#13 0x00007fffecd74002 in gst_vaapi_window_put_surface (window=0x7fffe0004820, surface=0x7fffe0007400, src_rect=0x7fffe7a5d440, dst_rect=<optimized out>, flags=<optimized out>) at gstvaapiwindow.c:440
#14 0x00007fffee248942 in gst_vaapisink_render_surface (sink=<optimized out>, surface=<optimized out>, surface_rect=<optimized out>, flags=<optimized out>) at gstvaapisink.c:162
#15 0x00007fffee249835 in gst_vaapisink_show_frame (src_buffer=0x7fffe0003e70, sink=0x75da20) at gstvaapisink.c:1385
#16 0x00007fffee249835 in gst_vaapisink_show_frame (video_sink=0x75da20, src_buffer=0x7fffe0003e70) at gstvaapisink.c:1426
#17 0x00007fffef8eb055 in gst_base_sink_do_preroll (sink=sink@entry=0x75da20, obj=obj@entry=0x7fffe0003e70) at gstbasesink.c:2281
#18 0x00007fffef8ebc03 in gst_base_sink_do_sync (basesink=basesink@entry=0x75da20, obj=obj@entry=0x7fffe0003e70, late=late@entry=0x7fffe7a5d6a8, step_end=step_end@entry=0x7fffe7a5d6ac) at gstbasesink.c:2500
#19 0x00007fffef8ece83 in gst_base_sink_chain_unlocked (basesink=basesink@entry=0x75da20, obj=obj@entry=0x7fffe0003e70, is_list=is_list@entry=0, pad=<optimized out>) at gstbasesink.c:3486
#20 0x00007fffef8ee4c0 in gst_base_sink_chain_main (basesink=0x75da20, pad=<optimized out>, obj=0x7fffe0003e70, is_list=0) at gstbasesink.c:3647
#21 0x00007ffff7b27784 in gst_pad_push_data (data=0x7fffe0003e70, type=4112, pad=0x72e960) at gstpad.c:4085
#22 0x00007ffff7b27784 in gst_pad_push_data (pad=0x72e720, type=type@entry=4112, data=data@entry=0x7fffe0003e70) at gstpad.c:4337
#23 0x00007ffff7b2f066 in gst_pad_push (pad=<optimized out>, buffer=buffer@entry=0x7fffe0003e70) at gstpad.c:4453
#24 0x00007fffeedb50df in gst_video_decoder_clip_and_push_buf (decoder=decoder@entry=0x7551a0, buf=buf@entry=0x7fffe0003e70) at gstvideodecoder.c:3203
#25 0x00007fffeedbb540 in gst_video_decoder_finish_frame (decoder=decoder@entry=0x7551a0, frame=0x0, frame@entry=0x7fffe00030a0) at gstvideodecoder.c:3096
#26 0x00007fffee240f9e in gst_vaapidecode_push_all_decoded_frames (out_frame=0x7fffe00030a0, vdec=0x7551a0) at gstvaapidecode.c:339
#27 0x00007fffee240f9e in gst_vaapidecode_push_all_decoded_frames (decode=0x7551a0) at gstvaapidecode.c:416
#28 0x00007fffeedb3d16 in gst_video_decoder_decode_frame (decoder=decoder@entry=0x7551a0, frame=0x7fffe0003d60) at gstvideodecoder.c:3405
#29 0x00007fffeedbba8c in gst_video_decoder_have_frame (decoder=decoder@entry=0x7551a0) at gstvideodecoder.c:3337
#30 0x00007fffee24189a in gst_vaapidecode_parse (at_eos=0, adapter=0x73a900, frame=0x7fffe0003d60, vdec=0x7551a0) at gstvaapidecode.c:869
#31 0x00007fffee24189a in gst_vaapidecode_parse (vdec=0x7551a0, frame=0x7fffe0003d60, adapter=0x73a900, at_eos=0) at gstvaapidecode.c:900
#32 0x00007fffeedb4066 in gst_video_decoder_parse_available (dec=dec@entry=0x7551a0, at_eos=at_eos@entry=0, new_buffer=0, new_buffer@entry=1) at gstvideodecoder.c:1005
#33 0x00007fffeedb4214 in gst_video_decoder_chain_forward (decoder=decoder@entry=0x7551a0, buf=buf@entry=0x7fffe00031b0, at_eos=at_eos@entry=0) at gstvideodecoder.c:2196
#34 0x00007fffeedb68d3 in gst_video_decoder_chain (pad=<optimized out>, parent=0x7551a0, buf=0x7fffe00031b0) at gstvideodecoder.c:2492
#35 0x00007ffff7b27784 in gst_pad_push_data (data=0x7fffe00031b0, type=4112, pad=0x72e4e0) at gstpad.c:4085
#36 0x00007ffff7b27784 in gst_pad_push_data (pad=0x72f260, type=type@entry=4112, data=data@entry=0x7fffe00031b0) at gstpad.c:4337
#37 0x00007ffff7b2f066 in gst_pad_push (pad=<optimized out>, buffer=buffer@entry=0x7fffe00031b0) at gstpad.c:4453
#38 0x00007fffef670147 in gst_qtdemux_decorate_and_push_buffer (qtdemux=qtdemux@entry=0x73c030, stream=stream@entry=0x7fffe0007800, buf=0x7fffe00031b0, dts=dts@entry
=133333333, pts=pts@entry=166666666, duration=duration@entry=33333333, keyframe=0, position=66666667, byte_position=<optimized out>) at qtdemux.c:4905
#39 0x00007fffef687dc2 in gst_qtdemux_loop (qtdemux=<optimized out>) at qtdemux.c:5159
#40 0x00007fffef687dc2 in gst_qtdemux_loop (pad=0x72e2a0) at qtdemux.c:5235
#41 0x00007ffff7b56ce1 in gst_task_func (task=0x78e050) at gsttask.c:331
#42 0x00007ffff7096a3e in g_thread_pool_thread_proxy () at /lib64/libglib-2.0.so.0
#43 0x00007ffff70960a5 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#44 0x00007ffff6a04555 in start_thread () at /lib64/libpthread.so.0
#45 0x00007ffff673fb9d in clone () at /lib64/libc.so.6


If running gst command by add vaapipost, can play for few second straight weston,player and mouse freezing. But remote ssh still working.

gst-launch-1.0 -v filesrc location=video_800x600.mp4 ! qtdemux ! vaapidecode ! vaapipostproc format=nv12 width=800 height=600 ! vaapisink fullscreen=true


This issue didn't happen in BSW platform.
The only issue happen in BSW, vaapisink=fullscreen get corruption by vertical green line corruption. But already submitted in https://bugzilla.gnome.org/show_bug.cgi?id=748634.
Comment 1 Lim Siew Hoon 2015-11-05 07:50:54 UTC
in snb_hw_codec_info struct, I changed to has_vpp=0 to force it to using software video postprocessing. No longer able to reproduce the the issue.
And I'm able to play the video with fullscreen mode as well using same video clip that always causing the segmentation fault in wayland weston environment.

Look like the the VPP in VA driver side didn't handle it correctly for SNB platform.
Comment 2 Lim Siew Hoon 2015-11-05 08:38:01 UTC
In BSW platform, able to play the video in fullscreen mode without segmentation fault, but the video rendering out with multiple vertical green line bar. Using the same video clip, same VA driver version, same gstreamer framework and same Wayland and Weston version in FC22.
Comment 3 Lim Siew Hoon 2015-11-05 12:07:53 UTC
For  BSW platform, playing video in fullscreen will observe the vertical green line issue able to fix it by make sure the dest_x and dest_y is align by 16 in gen8_pp_plx_avs_initialize function . Since the dest_w and dest_h is aligning with 16 too.

    pp_avs_context->dest_x = ALIGN(dst_rect->x, 16); 
    pp_avs_context->dest_y = ALIGN(dst_rect->y, 16); 
    pp_avs_context->dest_w = ALIGN(dst_rect->width, 16);
    pp_avs_context->dest_h = ALIGN(dst_rect->height, 16);
    pp_avs_context->src_w = src_rect->width;
    pp_avs_context->src_h = src_rect->height;
    pp_avs_context->horiz_range = (float)src_rect->width / src_width;

    int dw = (pp_avs_context->src_w - 1) / 16 + 1;


For SNB platform, playing video causing segmentation fault looks like another issue need to debug.
Comment 4 Lim Siew Hoon 2015-11-18 09:19:21 UTC
For SNB plaform, the segmentation fault is causing by the dst_obj->bo is NULL. And decide to fix it by add if checking for dst_obj_surface->bo is NULL return VA_STATUS_ERROR_UNIMPLEMENTED in i965_proc_picture_fast function.

By found out by return VA_STATUS_ERROR_UNIMPLEMENTED will causing the GPU hang in ring during video playback halfway.

With test by recommend by Yakui to disable the PPGTT, no more GPU hang issue.

We previous also tested by using return VA_STATUS_ERROR_INVALID_SURFACE for checking only dst_obj->bo is NULL, it is working fine without purposely to
disable PPGTT in boot parameter in grub.cfg.

End up decided to use VA_STATUS_ERROR_INVALID_SURFACE instead
VA_STATUS_ERROR_UNIMPLEMENTED for dst_obj->bo checking in
i965_proc_picture_fast.

1) http://lists.freedesktop.org/archives/libva/2015-November/003719.html
2) http://lists.freedesktop.org/archives/libva/2015-November/003732.html


For BSW plaform and GEN 9 issue, the multiple horizontal green line in video region will be able to fix it by correct the coordinate X with 4 alignment before pass to VPP shader. This is due to HW require coordinate X also need to be 4 align. Also add this for Gen7 plaform.

http://lists.freedesktop.org/archives/libva/2015-November/003725.html
Comment 5 Lim Siew Hoon 2015-11-18 09:31:42 UTC
Feedback from Yakui regarding the green line issue in Gen8/Gen9:

In order to solve this issue perfectly, I think that the following two factors should be considered:
a. Driver should send the correct x coordinate to VPP shader. (It should be multiple of 4).
b. add MASK_SETTING to mask out the unaligned data in VPP shader. This is to avoid that the incorrect value is written for the unaligned border. (But this needs more efforts to handle it).

Already fixed for a).

Left over is b) add Mask setting to mask out the unaligned data in VPP shader not yet implemented.
Comment 6 haihao 2016-12-07 05:23:18 UTC
We won't fix b) (unaligned border).


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.