pesintta / vdr-plugin-vaapidevice

VDR VAAPIDevice Plug-in
9 stars 12 forks source link

Segfault on some channels #111

Closed mighty-p closed 6 years ago

mighty-p commented 6 years ago

VAAPIDEVICE SYSTEM INFORMATION REPORT

inxi
System:    Kernel: 4.13.0-36-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.6.7 (Gtk 3.18.9) Distro: Linux Mint 18.3 Sylvia
Machine:   Mobo: MSI model: B150M MORTAR (MS-7972) v: 2.0
           Bios: American Megatrends v: C.90 date: 11/03/2016
CPU:       Quad core Intel Core i5-7500 (-MCP-) cache: 6144 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 27264
           clock speeds: max: 3800 MHz 1: 3400 MHz 2: 3400 MHz 3: 3400 MHz
           4: 3400 MHz
Graphics:  Card: Intel Device 5912 bus-ID: 00:02.0
           Display Server: X.Org 1.18.4 drivers: (unloaded: fbdev,vesa)
           Resolution: 1920x1080@60.00hz
           GLX Renderer: Mesa DRI Intel HD Graphics 630 (Kaby Lake GT2)
           GLX Version: 3.0 Mesa 17.2.8 Direct Rendering: Yes
Audio:     Card-1 Intel Sunrise Point-H HD Audio
           driver: snd_hda_intel bus-ID: 00:1f.3
           Card-2 Micronas Composite USB-Device
           driver: USB Audio usb-ID: 001-003
           Sound: Advanced Linux Sound Architecture v: k4.13.0-36-generic
vainfo
vainfo: VA-API version: 0.39 (libva 1.7.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Kabylake - 1.7.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
ffmpeg
ffmpeg version N-90287-g43205df Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
libavutil      56.  9.100 / 56.  9.100
libavcodec     58. 14.100 / 58. 14.100
libavformat    58. 10.100 / 58. 10.100
libavdevice    58.  2.100 / 58.  2.100
libavfilter     7. 12.100 /  7. 12.100
libswscale      5.  0.102 /  5.  0.102
libswresample   3.  0.101 /  3.  0.101
libpostproc    55.  0.100 / 55.  0.100
gcc
5.4.0
svdrpsend
220 <filter> SVDRP VideoDiskRecorder 2.2.0; Sat Mar 17 10:41:54 2018; UTF-8
900- Frames: missed(0) duped(99) dropped(2) total(1339) PTS(10:22:33.484) drift(0) audio(362) video(0)
900- Video: h264/vaapi_vld 1280x720p 16:9 @ 800x450 - Intel i965 driver for Intel(R) Kabylake - 1.7.0
900- Audio: ac3 48000Hz 2 channels
900 Command: vaapidevice -a pulse -g 800x450+100+100
221 <filter> closing connection

On my Intel system, with latest GIT state, I get a segfault that I did not get before.

#0  0x00007fd42c969428 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fd42c96b02a in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007fd42c961bd7 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007fd42c961c82 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007fd40de53f44 in ?? ()
   from /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
#5  0x00007fd40de55607 in ?? ()
   from /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
#6  0x00007fd40de4f870 in ?? ()
   from /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
#7  0x00007fd42ab0596f in vaEndPicture ()
   from /usr/lib/x86_64-linux-gnu/libva.so.1
#8  0x00007fd42b03b4e9 in VaapiPostprocessSurface (ctx=33554433, 
    src=<optimized out>, dst=67108874, filters=filters@entry=0x7fd3e7ffd8a0, 
    num_filters=<optimized out>, filter_flags=filter_flags@entry=24, 
    pipeline_flags=0, frefs=0x7fd3c8019ee0, num_frefs=1, brefs=0x7fd3c80198e0, 
    num_brefs=0) at video.c:1690
#9  0x00007fd42b03de04 in VaapiPostprocessSurface (num_brefs=0, 
    brefs=<optimized out>, num_frefs=1, frefs=<optimized out>, 
    pipeline_flags=0, filter_flags=24, num_filters=<optimized out>, 
    filters=0x7fd3e7ffd8a0, dst=<optimized out>, src=<optimized out>, 
    ctx=<optimized out>) at video.c:1650
#10 VaapiApplyFilters (decoder=decoder@entry=0x24a3680, 
    >) at video.c:1839
#11 0x00007fd42b03e467 in VaapiQueueSurface (decoder=decoder@entry=0x24a3680, 
    surface=surface@entry=67108865, softdec=0) at video.c:3045
#12 0x00007fd42b03e98f in VaapiRenderFrame (decoder=decoder@entry=0x24a3680, 
    video_ctx=video_ctx@entry=0x7fd3c80168c0, frame=frame@entry=0x7fd3c801ed40) at video.c:3288
#13 0x00007fd42b03ff03 in VaapiSyncRenderFrame (decoder=0x24a3680, video_ctx=0x7fd3c80168c0, 
    frame=0x7fd3c801ed40) at video.c:3806
#14 0x00007fd42b04981b in CodecVideoDecode (decoder=0x24b06d0, 
    avpkt=avpkt@entry=0x7fd42b258d80 <MyVideoStream+2080>) at codec.c:285
#15 0x00007fd42b0363b4 in VideoDecodeInput (stream=0x7fd42b258560 <MyVideoStream>)
    at vaapidev.c:963
#16 0x00007fd42b03cd96 in VaapiDisplayHandlerThread () at video.c:3885
#17 0x00007fd42b042c2c in VideoDisplayHandlerThread (dummy=<optimized out>) at video.c:4511
#18 0x00007fd42e0a56ba in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#19 0x00007fd42ca3b41d in clone () from /lib/x86_64-linux-gnu/libc.so.6
mighty-p commented 6 years ago

I tried finding out which commit causes this, but it seems that no recent commit did. So maybe this issue is in the code for longer (which puzzles me a bit since things seemed to run stable last week). In any case, the crash happens only when changing channels (not when the channel is already running for at least a few seconds).

For a few seconds, when I switch the channel and this happens, I see a broken image of the new channel (with a lot of green blocks/artefacts in it). So it seems something is here processed that is not ready yet (race condition?)

pesintta commented 6 years ago

It looks like your driver runs an intentional assert() which generally means that something bad happened. However the driver is missing debug symbols so the backtrace does not print the key part as can be seen in stack frames 4,5,6 such as: #4 0x00007fd40de53f44 in ?? ()

Another note: libva-1.7.0 is very old which causes the plugin to emit a build warning: libva is too old - please, upgrade!"

We may not be able to help with such an old libva version. It is likely that you are hitting a bug in the library or driver that has been fixed in later releases.

mighty-p commented 6 years ago

The segfault went away when I went back from the pre 3.5 snapshot of ffmpeg to the "proven" 3.3.2 version (which is not ideal for HEVC). So probably this was neither a problem by my outdated libva nor by vaapidevice. I am closing this. Sorry for the false alarm.