Bug 189118 - multimedia/vlc with VAAPI SIGSEGVs after playback ends
Summary: multimedia/vlc with VAAPI SIGSEGVs after playback ends
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 19:40 UTC by isoa
Modified: 2017-02-06 12:06 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description isoa 2014-04-29 19:40:00 UTC
Playing video with VAAPI enabled works, but VLC crashes after playback ends. I compiled VLC, libva, libva-intel and ffmpeg with WITH_DEBUG knob. Then I used gdb to trace the problem, and found out it has something to do with how VLC releases resources after the playback surface is closed.

I also built multimedia/mpv with VAAPI support, then played the same video with: mpv -vo=opengl -hwdec=vaapi video.mkv ... and mpv did NOT crash. It did report a message that might have something to do with this problem: [vo/opengl/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)

I am not a real programmer, nor knowledgeable about VLC, so unfortunately all I can offer is this back trace for now:

[xxx@xxx /usr/home/xxx]$ gdb vlc
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) run
Starting program: /usr/local/bin/vlc 
[New LWP 100084]
VLC media player 2.1.2 Rincewind (revision 2.1.2-0-ga4c4876)
[New Thread 802006400 (LWP 100084/vlc)]
[0x802046150] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without 
interface.
[New Thread 802009400 (LWP 100443/vlc)]
[New Thread 80ea12800 (LWP 100445/vlc)]
[New Thread 81004b400 (LWP 100446/vlc)]
[New Thread 80ea18000 (LWP 100447/vlc)]
[New Thread 810863400 (LWP 100448/vlc)]
[New Thread 8104df400 (LWP 100449/vlc)]
[New Thread 8118bb800 (LWP 100454/vlc)]
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/va/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
[0x8118ba450] avcodec decoder: Using VA API version 0.35 for hardware decoding.
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/va/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
[0x8118ba450] avcodec decoder: Using VA API version 0.35 for hardware decoding.
Fontconfig warning: FcPattern object size does not accept value "0"
Fontconfig warning: FcPattern object size does not accept value "0"
[New Thread 8104e1000 (LWP 100455/vlc)]
Fontconfig warning: FcPattern object size does not accept value "0"
Fontconfig warning: FcPattern object size does not accept value "0"
[0x8230443d0] main vout display error: Failed to resize display

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 810863400 (LWP 100448/vlc)]
0x000000081d802456 in Release (p_external=0x8104691d0, p_ff=0x8104d3550) at avcodec/vaapi.c:519
519	avcodec/vaapi.c: No such file or directory.
	in avcodec/vaapi.c
Current language:  auto; currently minimal
(gdb) bt
#0  0x000000081d802456 in Release (p_external=0x8104691d0, p_ff=0x8104d3550) at avcodec/vaapi.c:519
#1  0x0000000811212afe in vlc_va_Release (va=0x8104691d0, frame=0x8104d3550) at va.h:56
#2  0x0000000811210af0 in ffmpeg_ReleaseFrameBuf (p_context=0x8104d3120, p_ff_pic=0x8104d3550) at 
avcodec/video.c:1074
#3  0x000000081a076e8a in compat_free_buffer (opaque=<value optimized out>, data=0x4000005 <Error 
reading address 0x4000005: Bad address>) at libavcodec/utils.c:789
#4  0x000000081143589d in av_buffer_unref (buf=<value optimized out>) at libavutil/buffer.c:115
#5  0x000000081a076eae in compat_release_buffer (opaque=0x8104691d0, data=0x4000005 <Error reading 
address 0x4000005: Bad address>) at libavcodec/utils.c:796
#6  0x000000081143589d in av_buffer_unref (buf=<value optimized out>) at libavutil/buffer.c:115
#7  0x000000081143b94f in av_frame_unref (frame=0x8203d4c50) at libavutil/frame.c:363
#8  0x0000000819fd823f in release_delayed_buffers (p=0x8118954f0) at libavcodec/pthread.c:498
#9  0x0000000819fd8ecd in frame_thread_free (avctx=0x811854b20, thread_count=4) at 
libavcodec/pthread.c:768
#10 0x000000081a074c80 in avcodec_close (avctx=0x811854b20) at libavcodec/utils.c:2526
#11 0x000000081121c5dd in CloseDecoder (p_this=0x8118ba450) at avcodec/avcodec.c:371
#12 0x0000000800b0548a in generic_stop (func=0x81121c550, ap=0x7fffff2f6030) at modules/modules.c:359
#13 0x0000000800b05297 in vlc_module_unload (module=0x80218d4c0, deinit=0x800b05400 <generic_stop>) at 
modules/modules.c:340
#14 0x0000000800b053ed in module_unneed (obj=0x8118ba450, module=0x80218d4c0) at modules/modules.c:373
#15 0x0000000800a99995 in input_DecoderDelete (p_dec=0x8118ba450) at input/decoder.c:362
#16 0x0000000800aa87fa in EsDestroyDecoder (out=0x810839070, p_es=0x81184c400) at input/es_out.c:1580
#17 0x0000000800aa7dac in EsUnselect (out=0x810839070, es=0x81184c400, b_update=true) at 
input/es_out.c:1691
#18 0x0000000800aa4a64 in EsOutControlLocked (out=0x810839070, i_query=65536, args=0x7fffff2f6a70) at 
input/es_out.c:2176
#19 0x0000000800aa3ab7 in EsOutControl (out=0x810839070, i_query=65536, args=0x7fffff2f6a70) at 
input/es_out.c:2698
#20 0x0000000800ab22a8 in es_out_vaControl (out=0x810839070, i_query=65536, args=0x7fffff2f6a70) at 
vlc_es_out.h:126
#21 0x0000000800ab089c in es_out_Control (out=0x810839070, i_query=65536) at vlc_es_out.h:135
#22 0x0000000800ab04bd in CmdExecuteControl (p_out=0x810839070, p_cmd=0x7fffff2f6d08) at 
input/es_out_timeshift.c:1458
#23 0x0000000800aae6eb in ControlLocked (p_out=0x811810040, i_query=65536, args=0x7fffff2f6f30) at 
input/es_out_timeshift.c:620
#24 0x0000000800aae221 in Control (p_out=0x811810040, i_query=65536, args=0x7fffff2f6f30) at 
input/es_out_timeshift.c:718
#25 0x0000000800ab6df8 in es_out_vaControl (out=0x811810040, i_query=65536, args=0x7fffff2f6f30) at 
vlc_es_out.h:126
#26 0x0000000800ab6dac in es_out_Control (out=0x811810040, i_query=65536) at vlc_es_out.h:135
#27 0x0000000800ab69d4 in es_out_SetMode (p_out=0x811810040, i_mode=0) at es_out.h:89
#28 0x0000000800ab5909 in End (p_input=0x810835070) at input/input.c:1369
#29 0x0000000800ab5f5f in Run (obj=0x810835070) at input/input.c:527
#30 0x00000008016414a4 in pthread_create () from /lib/libthr.so.3
#31 0x0000000000000000 in ?? ()
(gdb)

How-To-Repeat: Compile multimedia/vlc with VAAPI -support.
Play video with "Hardware accelerated decoding" enabled, and using VAAPI.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-04-29 19:40:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-multimedia

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Dominic Fandrey freebsd_committer freebsd_triage 2017-02-04 14:39:21 UTC
Is this still an issue?
Comment 3 Arto Pekkanen 2017-02-06 01:59:10 UTC
(In reply to Dominic Fandrey from comment #2)

Not anymore. Maybe some of the updates solved this.

Btw, please enable the ASS -option by default in the ports makefile.