Bug 89251 - [gst-vaapi-master] fatal error "Status Unknown" decoding h264 content at gstvaapidecoder_h264.c:decode_current_picture
Summary: [gst-vaapi-master] fatal error "Status Unknown" decoding h264 content at gstv...
Status: RESOLVED NOTOURBUG
Alias: None
Product: libva
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: high blocker
Assignee: haihao
QA Contact: Sean V Kelley
URL:
Whiteboard:
Keywords: have-backtrace, patch
Depends on:
Blocks:
 
Reported: 2015-02-20 23:33 UTC by Faham Negini
Modified: 2015-02-25 04:46 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
vaapideocder-hack avoiding the infinite loop and pipeline shutdown (1.85 KB, text/plain)
2015-02-20 23:33 UTC, Faham Negini
Details

Description Faham Negini 2015-02-20 23:33:48 UTC
Created attachment 113707 [details]
vaapideocder-hack avoiding the infinite loop and pipeline shutdown

Environment:
--------------
kernel:               3.13.0-24-generic #47-Ubuntu x86_64
cpu:                  Intel(R) Atom(TM) CPU  E3845  @ 1.91GHz
gstreamer-vaapi:      (master)6b73746ab6453253ea4bb82170914e0a1892e135 > 0.5.10
libva:                (master)f9741725839ea144e9a6a1827f74503ee39946c3 > 1.4.0
libva-intel-driver:   (master)9a20d6c34cb65e5b85dd16d6c8b3a215c5972b18
gstreamer:            (master)1f6d5d3ff5cb03527acb99b4059788f53d49567e
gst-plugins-base:     (master)e2a693656b1a8513adab5e8f7698758c583c8eed > 1.4.0
gst-plugins-good:     (master)6b69ef24a1e13f0ad7980fe25d954d37133ba746 > 1.4.0
gst-plugins-bad:      (master)8e2964ee599853fff2a7aba9275960b4ae7844fc > 1.4.1
gst-plugins-ugly:     (master)86562f56e208d0d7360a9b5f7bc5cf13836f06a3 > 1.4.0


Bug Info:
--------------
libva info: VA-API version 0.37.0
libva info: VA-API version 0.37.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /home/fahamne/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: va_getDriverName() returns 0
libva info: Trying to open /home/fahamne/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_37
libva info: Found init function __vaDriverInit_0_37
libva info: va_openDriver() returns 0
libva info: va_openDriver() returns 0
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'vaapidecode1': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'vaapidecode1': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
fahamne@testboard-2164:~
>WARNING: from element /GstPipeline:pipeline0/GstVaapiSink:vaapisink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2794): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstVaapiSink:vaapisink0:
There may be a timestamping problem, or this computer is too slow.
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc2: Internal data flow error.
Additional debug info:
gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc2:
streaming task paused, reason error (-5)
Execution ended after 0:05:32.950265692
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc2: Internal data flow error.
Additional debug info:
gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc2:
streaming task paused, reason error (-5)
Execution ended after 0:05:33.031227820
Setting pipeline to PAUSED ...
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Setting pipeline to NULL ...
Freeing pipeline ...
Freeing pipeline ...

Steps:
--------------
Run 2 instances of the following pipeline (the video content could be coming from a filesrc):
udpsrc address=239.4.4.23 port=10000 name=udpsrc1 ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_tsdemux_1 ! tsdemux name=dmx1 program-number=3 \ 
 dmx1. ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_videoparse_1 ! h264parse ! vaapidecode name=vaapidecode1 ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_videosink_1 ! vaapisink display=x11 \ 
 udpsrc address=239.4.4.23 port=10000 name=udpsrc2 ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_tsdemux_2 ! tsdemux name=dmx2 program-number=3 \ 
 dmx2. ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_videoparse_2 ! h264parse ! vaapidecode name=vaapidecode2 ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_videosink_2 ! vaapisink display=x11 \ 
 udpsrc address=239.4.4.23 port=10000 name=udpsrc3 ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_tsdemux_3 ! tsdemux name=dmx3 program-number=3 \ 
 dmx3. ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_videoparse_3 ! h264parse ! vaapidecode name=vaapidecode3 ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=10000000000 name=q_videosink_3 ! vaapisink display=x11



Additional Info:
--------------
Tracking down the problem, the apparently internal data flow error, is actually happening after vaapidecode
returns an error in gstvaapidecoder_h264.c:decode_current_picture with the
following stacktrace.

There is a case for the dpb_find_lowest_poc which all fs/pic output_needed flag
is set to 0 and therefore it returns -1 which leads to a
GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN at decode_current_picture function in
that file:

dpb_find_lowest_poc(decoder = 0x7fffc8017580,picture = 0x7fffc8006180,found_picture_ptr = 0x7fffdfffdd10,);
dpb_bump(decoder = 0x7fffc8017580,picture = 0x7fffc8006180,);
dpb_add(decoder = 0x7fffc8017580,picture = 0x7fffc8006180,);
decode_current_picture(decoder = 0x7fffc8017580,);
gst_vaapi_decoder_h264_end_frame(base_decoder = 0x7fffc8017580,);
do_decode_1(decoder = 0x7fffc8017580,frame = 0x7fffc8015c10,);
do_decode(decoder = 0x7fffc8017580,base_frame = 0x7fffd80042e0,);
gst_vaapi_decoder_decode(decoder = 0x7fffc8017580,frame = 0x7fffd80042e0,);
gst_vaapidecode_decode_frame(vdec = 0x81d6f0,frame = 0x7fffd80042e0,);
gst_vaapidecode_handle_frame(vdec = 0x81d6f0,frame = 0x7fffd80042e0,);
gst_video_decoder_decode_frame(decoder = 0x81d6f0,frame = 0x7fffd80042e0,);
gst_video_decoder_have_frame(decoder = 0x81d6f0,);
gst_vaapidecode_parse_frame(vdec = 0x81d6f0,frame = 0x7fffd80042e0,adapter = 0x6935b0,at_eos = 0,);
gst_vaapidecode_parse(vdec = 0x81d6f0,frame = 0x7fffd80042e0,adapter = 0x6935b0,at_eos = 0,);
gst_video_decoder_parse_available(dec = 0x81d6f0,at_eos = 0,new_buffer = 0,);
gst_video_decoder_chain_forward(decoder = 0x81d6f0,buf = 0x7fffbc01c3d0,at_eos = 0,);
gst_video_decoder_chain(pad = 0x7ed900,parent = 0x81d6f0,buf = 0x7fffbc01c3d0,);
gst_pad_chain_data_unchecked(pad = 0x7ed900,type = 4112,data = 0x7fffbc01c3d0,);
gst_pad_push_data(pad = 0x7ed6d0,type = 4112,data = 0x7fffbc01c3d0,);
gst_pad_push(pad = 0x7ed6d0,buffer = 0x7fffbc01c3d0,);
gst_base_parse_push_frame(parse = 0x80c240,frame = 0x7fffd4001c50,);
gst_base_parse_handle_and_push_frame(parse = 0x80c240,frame = 0x7fffd4001c50,);
gst_base_parse_finish_frame(parse = 0x80c240,frame = 0x7fffd4001c50,size = 6,);
gst_h264_parse_handle_frame(parse = 0x80c240,frame = 0x7fffd4001c50,skipsize = 0x7fffdfffea3c,);
gst_base_parse_handle_buffer(parse = 0x80c240,buffer = 0x7fffac03de80,skip = 0x7fffdfffea3c,flushed = 0x7fffdfffeab0,);
gst_base_parse_chain(pad = 0x7ed4a0,parent = 0x80c240,buffer = 0x7fff98003370,);
gst_pad_chain_data_unchecked(pad = 0x7ed4a0,type = 4112,data = 0x7fff98003370,);
gst_pad_push_data(pad = 0x7ed270,type = 4112,data = 0x7fff98003370,);
gst_pad_push(pad = 0x7ed270,buffer = 0x7fff98003370,);
gst_queue_push_one(queue = 0x7aa720,);
gst_queue_loop(pad = 0x7ed270,);
gst_task_func(task = 0x9153b0,);
default_func(tdata = 0x8212a0,pool = 0x622090,);
??();
??();
start_thread(arg = 0x7fffdffff700,);
clone();
-------------------

Note: the attached patch seem to alleviate the fatal error and shutdown of the pipeline but sometimes lead to a green screen and can't recover from
Comment 1 haihao 2015-02-25 04:46:59 UTC
Hi,

This is an issue of gst-vaapi, please file a bug at https://bugzilla.gnome.org

Thanks
Haihao


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.