After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730911 - random fail when doing transcoding test(MPEG2->H264)
random fail when doing transcoding test(MPEG2->H264)
Status: VERIFIED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-05-29 06:03 UTC by zhixinx.liu
Modified: 2014-11-27 06:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description zhixinx.liu 2014-05-29 06:03:18 UTC
when testing transcoder, sometimes progress will stop after running the test command.
not regression fail. even old version(2014/03/20) can also reproduce this problem.

1. Testing Env:
========================================================================
kernel:	3.15.0-rc7_drm-intel-nightly_9f53d4_20140528
X11R7:	X11R7.unstable.2014-05-28.tar.gz
{
Libva:               (staging)35e70cb9b9c77dfb99fb370e319ed501f0c31b17
Libva_intel_driver:  (staging)7c2273f1334d7d45e248d128e17200b7e8beffd1
Gstreamer10:         (1.0)4e880d4d1e151ea64f83c28b5c3e1bbc06c57903
Gst_plugins_base10:  (1.0)2dd3f028c1e6dea799d7496639f53220818b20b1
Gst_plugins_good10:  (1.0)643d425f51f81b56deec16c01162637546708ee5
Gst_plugins_bad10:   (1.0)0587ab41b4f9979e9cfc11011ed5c970569ee3d3
Gst_plugins_ugly10:  (1.0)c7c911b8320576429e4a4234a1e29ec7436e6814
Gst_plugins_vaapi10: (master)f0d3d9cd3c2fa852e71198184336b31259762a25
Gstreamer010:        (0.10)76fc67b18c38e7f6c9cfacc4e4d0ed11d3b2c548
Gst_plugins_base010: (0.10)1e1e6eaf3f0dd11f6618154d9739cbe3e007d206
Gst_plugins_good010: (0.10)5af6f5bfb6c3619a9ccc3b1681579aeb90e8b89a
Gst_plugins_bad010:  (0.10)cef47d85294a0dca38631f938b81a3f0dd6891bd
}

2. Testing Steps:
========================================================================
    1.run command "gst-launch-0.10 filesrc location=/home/GFX/build/testsuite/Media_tools/media_tools/transcoder/Sally.ts ! tsdemux ! vaapidecode !  vaapiencodeh264 rate-control=cqp init-qp=26 intra-period=30 b-frame-num=2 ! qtmux faststart=true ! filesink location=enc.mp4"
    2.check if the mp4 file has been created.
	
3. Frequency of Occurence:
========================================================================
30%(test 10 times, this issue arise 3 times)
Comment 1 zhixinx.liu 2014-06-11 07:04:50 UTC
only BDW find this problem. Log:
[root@x-bdw08 opt]# gst-launch-0.10 filesrc location=/home/Stream/Sally.ts ! tsdemux ! vaapidecode !  vaapiencodeh264 rate-control=cqp init-qp=26 intra-period=30 b-frame-num=2 ! qtmux faststart=true ! filesink location=/home/enc.mp4
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
libva info: VA-API version 0.35.1
libva info: va_getDriverName() returns 0
libva info: Trying to open /opt/X11R7/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
vaapiencode Current fps: 266.78, Total avg fps: 266.78
vaapiencode Current fps: 276.94, Total avg fps: 271.77
vaapiencode Current fps: 283.50, Total avg fps: 275.57
vaapiencode Current fps: 272.49, Total avg fps: 274.79
vaapiencode Current fps: 278.63, Total avg fps: 275.55
vaapiencode Current fps: 284.55, Total avg fps: 277.01
vaapiencode Current fps: 274.42, Total avg fps: 276.64
vaapiencode Current fps: 278.84, Total avg fps: 276.91
vaapiencode Current fps: 284.64, Total avg fps: 277.75
vaapiencode Current fps: 273.79, Total avg fps: 277.35
vaapiencode Current fps: 278.04, Total avg fps: 277.41

it will stop here.
Comment 2 Gwenole Beauchesne 2014-06-11 08:23:12 UTC
Hi, there is no platform specific code in gstreamer-vaapi, this all uses standard VA-API interfaces. So, if the issue you report only occurs on Broadwell, on occasions, and not on Haswell or Ivybridge for instance, then the most likely cause could be on the driver side.

I'd suggest you to investigate the hang more closely, by e.g. providing a backtrace? Thanks.

Ah, hmm, no, you said stop, i.e. gst-launch just quits and doesn't have any file generated?
Comment 3 zhixinx.liu 2014-06-11 09:10:06 UTC
the backtrace is:
(gdb) bt
  • #0 poll
    from /usr/lib64/libc.so.6
  • #1 g_main_context_poll
    at gmain.c line 4028
  • #2 g_main_context_iterate
    at gmain.c line 3729
  • #3 g_main_context_iterate
    at gmain.c line 3671
  • #4 g_main_loop_run
    at gmain.c line 3928
  • #5 gst_bus_poll
    at gstbus.c line 1078
  • #6 event_loop
    at gst-launch.c line 623
  • #7 main
    at gst-launch.c line 1157

sorry, not describe clearly. i said stop, it mean that gst-launch don't print any log, and cannot quits, you only input "Ctrl + C" to interrupt it. after that check the generated file's size is 0.
Comment 4 Gwenole Beauchesne 2014-06-11 09:15:09 UTC
The contents for other threads could help you maybe. e.g. "info threads" and look for other points that may be hanging around. Switch to that thread and "bt". Or just "thread apply all bt".
Comment 5 zhixinx.liu 2014-06-11 09:34:57 UTC
thank you for giving me such a useful command. maybe it also gsteamer's issue according other two thread info:


Comment 6 zhixinx.liu 2014-06-11 10:01:19 UTC
at first, i test 5 times on BDW/HSW/BYT/IVB/SGB, only BDW find this problem.
But when i test 20 times, BYT/BDW can find this problem. 
so maybe all platforms have this issue. i will do stress test to check it,
will upload the test data later.
Comment 7 Gwenole Beauchesne 2014-06-11 12:07:59 UTC
Oh, I didn't realize that earlier. Your pipeline looks wrong, and you are not testing the right encode element. Please, only test again GStreamer >= 1.2 and with the official set of plug-in elements (vaapiencode_h264 here, for instance).
Comment 8 zhixinx.liu 2014-06-13 06:06:51 UTC
thanks, i will use gstreamer 1.2 to retest it.
Comment 9 zhixinx.liu 2014-07-04 06:02:30 UTC
use gstreamer 1.2 to retest this issue, also can find this problem.
command:
gst-launch-1.0 filesrc location=/home/Stream/Sally.ts ! tsdemux ! vaapidecode !  vaapiencode_h264 rate-control=cqp init-qp=26 keyframe-period=30 max-bframes=2 ! qtmux faststart=true ! filesink location=/home/enc.mp4

bt info:

Thread 1 (Thread 0x7ffff756c740 (LWP 5250))

  • #0 __lll_lock_wait
    from /usr/lib64/libpthread.so.0
  • #1 _L_lock_839
    from /usr/lib64/libpthread.so.0
  • #2 pthread_mutex_lock
    from /usr/lib64/libpthread.so.0
  • #3 post_activate
    at gstpad.c line 906
  • #4 gst_pad_activate_mode
    at gstpad.c line 1090
  • #5 gst_pad_set_active
    at gstpad.c line 969
  • #6 activate_pads
    at gstelement.c line 2687
  • #7 gst_iterator_fold
    at gstiterator.c line 614
  • #8 iterator_activate_fold_with_resync
    at gstelement.c line 2707
  • #9 gst_element_pads_activate
    at gstelement.c line 2751
  • #10 gst_element_change_state_func
    at gstelement.c line 2815
  • #11 gst_video_decoder_change_state
    at gstvideodecoder.c line 2082
  • #12 gst_element_change_state
    at gstelement.c line 2602
  • #13 gst_element_set_state_func
    at gstelement.c line 2558
  • #14 gst_bin_element_set_state
    at gstbin.c line 2325
  • #15 gst_bin_change_state_func
    at gstbin.c line 2648
  • #16 gst_pipeline_change_state
    at gstpipeline.c line 471
  • #17 gst_element_change_state
    at gstelement.c line 2602
  • #18 gst_element_set_state_func
    at gstelement.c line 2558
  • #19 main
    at gst-launch.c line 1154

Comment 10 zhixinx.liu 2014-07-04 06:04:46 UTC
test env:
Libva:                  (master)c61d8c6ce9ffc27320e9e177c1e1123d5f1b5014
Libva_intel_driver:     (master)c5cb17ea86f0065a939d3636dd26651c93d497c8
Gstreamer10:            (1.2)b8b6dbd36dd28b97b3e6ec7ef512fc01c270f4ec
Gst_plugins_base10:     (1.2)4c31880bf0a4b720ab90fc8753fbbcc72275d6f8
Gst_plugins_good10:     (1.2)177dfaebdc1560b7e8830a29e1bc4966eba3d736
Gst_plugins_bad10:      (1.2)277b8c34e7214177764833b73f17e43ced496f8f
Gst_plugins_ugly10:     (1.2)2233d97e6ad1a3988d9a9ca0fc0cf00ec4031a8f
Gst_plugins_vaapi10:    (master)e6cdacee65f221e4c464cff5cc5f2bbb74a75146
Comment 11 Gwenole Beauchesne 2014-11-26 14:38:38 UTC
Please try with the current git master branch. Thanks.
Comment 12 zhixinx.liu 2014-11-27 02:31:24 UTC
Internal data stream error when doing transcoding test(MPEG2->H264) with same test command.

log:
[root@x-hsw29 tmp]# GST_DEBUG=vaapi:4 gst-launch-1.0 filesrc location=/home/Stream/Sally.ts ! tsdemux ! vaapidecode ! vaapiencode_h264 rate-control=cqp init-qp=26 keyframe-period=30 max-bframes=2 ! qtmux faststart=true ! filesink location=/home/enc.mp4
0:00:00.007896402  3326      0x1057210 INFO                   vaapi gstvaapidisplay.c:119:libgstvaapi_init_once: gstreamer-vaapi version 0.5.9-67-g0508e13
libva info: VA-API version 0.36.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /opt/X11R7/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_36
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;
ERROR: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: Internal data stream error.
Additional debug info:
mpegtsbase.c(1311): mpegts_base_loop (): /GstPipeline:pipeline0/GstTSDemux:tsdemux0:
stream stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

TEST ENV:
Libva:(master)c095cc6cf08523cd0dffcfe5ac4bce9122527f22
Libva_intel_driver:(master)edbb8cdada09cd116103e68f942b0889fd767391
Gstreamer10:(1.2)861ca3d6787d84c9bea7110cb46821e9b8f63aff
Gst_plugins_base10:(1.2)df7e7daa29ba14447b4d8dd43c35d8a3ad9e4984
Gst_plugins_good10:(1.2)08ab260b8a39791e7e62c95f4b64fd5b69959325
Gst_plugins_bad10:(1.2)277b8c34e7214177764833b73f17e43ced496f8f
Gst_plugins_ugly10:(1.2)2233d97e6ad1a3988d9a9ca0fc0cf00ec4031a8f
Gst_plugins_vaapi10:(master)0508e13ddfd03e5f7a8e06273bba70925a523c1d
Comment 13 Gwenole Beauchesne 2014-11-27 05:42:19 UTC
(In reply to comment #12)
> Internal data stream error when doing transcoding test(MPEG2->H264) with same
> test command.
> 
> log:
> [root@x-hsw29 tmp]# GST_DEBUG=vaapi:4 gst-launch-1.0 filesrc
> location=/home/Stream/Sally.ts ! tsdemux ! vaapidecode ! vaapiencode_h264
> rate-control=cqp init-qp=26 keyframe-period=30 max-bframes=2 ! qtmux
> faststart=true ! filesink location=/home/enc.mp4

You forgot an mpegvideoparse element here between tsdemux and vaapidecode.

> 0:00:00.007896402  3326      0x1057210 INFO                   vaapi
> gstvaapidisplay.c:119:libgstvaapi_init_once: gstreamer-vaapi version
> 0.5.9-67-g0508e13
> libva info: VA-API version 0.36.0
> libva info: va_getDriverName() returns 0
> libva info: Trying to open /opt/X11R7/lib/dri/i965_drv_video.so
> libva info: Found init function __vaDriverInit_0_36
> 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;
> ERROR: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: Internal data
> stream error.
> Additional debug info:
> mpegtsbase.c(1311): mpegts_base_loop ():
> /GstPipeline:pipeline0/GstTSDemux:tsdemux0:
> stream stopped, reason not-negotiated
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to NULL ...
> Freeing pipeline ...
> 
> TEST ENV:
> Libva:(master)c095cc6cf08523cd0dffcfe5ac4bce9122527f22
> Libva_intel_driver:(master)edbb8cdada09cd116103e68f942b0889fd767391
> Gstreamer10:(1.2)861ca3d6787d84c9bea7110cb46821e9b8f63aff
> Gst_plugins_base10:(1.2)df7e7daa29ba14447b4d8dd43c35d8a3ad9e4984
> Gst_plugins_good10:(1.2)08ab260b8a39791e7e62c95f4b64fd5b69959325
> Gst_plugins_bad10:(1.2)277b8c34e7214177764833b73f17e43ced496f8f
> Gst_plugins_ugly10:(1.2)2233d97e6ad1a3988d9a9ca0fc0cf00ec4031a8f
> Gst_plugins_vaapi10:(master)0508e13ddfd03e5f7a8e06273bba70925a523c1d
Comment 14 zhixinx.liu 2014-11-27 06:11:42 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > Internal data stream error when doing transcoding test(MPEG2->H264) with same
> > test command.
> > 
> > log:
> > [root@x-hsw29 tmp]# GST_DEBUG=vaapi:4 gst-launch-1.0 filesrc
> > location=/home/Stream/Sally.ts ! tsdemux ! vaapidecode ! vaapiencode_h264
> > rate-control=cqp init-qp=26 keyframe-period=30 max-bframes=2 ! qtmux
> > faststart=true ! filesink location=/home/enc.mp4
> 
> You forgot an mpegvideoparse element here between tsdemux and vaapidecode.

Thanks for you reminding! 
every decode/encode need a parse in current version.

I test 20 times on HSW/BDW, and cannot reproduce this issue anymore. so closed it.