wang-bin / mdk-sdk

multimedia development kit. download:
https://sourceforge.net/projects/mdk-sdk/files/
292 stars 33 forks source link

Crash on OpenSUSE Tumbleweed KDE #143

Open pierrexn opened 1 year ago

pierrexn commented 1 year ago

An idea of the problem? logs.txt

OPEN player /home/arne/Data/Users/Public/Videos/Eigene/2015-Take That.mp4
X11 display: 0x34f2540
#MDK SDK : 0.23.0 (git 9270859) - Multimedia Development Kit. Copyright (c) 2016-2023 WangBin(QtAV author) <wbsecg1 at gmail.com>
Build for: Linux x86_64; Clang17.0.4 (++20231031083134+309d55140c46-1~exp1~20231031083240.62)GCC4.2.1; libc++170004; 13:51:56 Oct 31 2023

#MDK SDK : video decoders: "VAAPI", "VDPAU", "CUDA", "MMAL", "FFmpeg"

#MDK SDK : video decoders: "VAAPI", "VDPAU", "CUDA", "MMAL", "FFmpeg"

#MDK SDK : setLoop(9999), now 0/0

QMDKWidget setMedia /home/arne/Data/Users/Public/Videos/Eigene/2015-Take That.mp4
#MDK SDK : default FrameReader0x3bbf3a0 state: 0=>0=>0, 0

#MDK SDK : default0x3bbf3a0 virtual void mdk::FrameReader::stop(), current state: 0

#MDK SDK : default FrameReader0x3bbf3a0 state: 0=>0=>0, 0

#MDK SDK : default0x3bbf3a0 virtual void mdk::FrameReader::stop(), current state: 0

#MDK SDK : ERROR! Unable to seek unloaded media

#MDK SDK : unloaded media's position 0

QMDKWidget play
#MDK SDK : 0x43a9690 virtual void mdk::MediaControlPush::setState(PlaybackState)@1013 requested state 0=>1, current state 0. status: 0

#MDK SDK : AudioBackendALSA ERROR@285>>> snd_pcm_pause(pcm_, value) (fffffffb): Input/output error

#MDK SDK :
#MDK SDK : AudioBackendALSA ERROR@285>>> snd_pcm_pause(pcm_, value) (fffffffb): Input/output error

#MDK SDK :
#MDK SDK : default 0x3bbf3a0 FrameReader.start(0, ...)

#MDK SDK : default 0x3bbf3a0 FrameReader::update MediaStatus 0=>0X2

#MDK SDK : default FrameReader0x3bbf3a0 state: 0=>0=>1, 0

#MDK SDK : default FrameReader0x3bbf3a0 state: 0=>1=>1, 0

#MDK SDK : unloaded media's position 0

#MDK SDK : start frame reader thread: 140684514281152

#MDK SDK : try to load av module: /home/arne/bin/XnView/lib/libffmpeg.so.6

############################################ InfoPropertiesView

Create Tree : File
#MDK SDK : ffmpeg loaded: /home/arne/bin/XnView/lib/libffmpeg.so.6

#MDK SDK : Selected avformat runtime version: 60.15.100 (build: 60.15.100), license: LGPL version 2.1 or later

#MDK SDK : Selected avformat runtime configuration: --extra-version=avbuild --disable-doc --disable-debug --disable-static --enable-shared --enable-runtime-cpudetect --enable-libvpl --enable-libdrm --disable-postproc --ranlib=llvm-ranlib-17 --nm=llvm-nm-17 --ar=llvm-ar-17 --nvcc=clang-17 --toolchain=hardened --enable-cross-compile --target-os=linux --arch=amd64 --pkg-config=pkg-config --sysroot='$SYSROOT' --cc=clang-17 --enable-lto --enable-pic --extra-cflags='-Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong -I/home/runner/work/avbuild/avbuild/tools/Vulkan-Headers/include -I=/usr/include/libdrm -I/tmp/dep/include -Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong --target=x86_64-linux-gnu' --extra-ldflags='-s -fuse-ld=lld -Wl,--gc-sections -Wl,--gc-sections --target=x86_64-linux-gnu' --extra-libs=-lrt --disable-stripping --enable-small --disable-outdevs --disable-filters --enable-filter='*null*,afade,*fifo,*format,*resample,aeval,allrgb,allyuv,atempo,pan,*bars,color,*key,crop,draw*,eq*,framerate,*_qsv,*_vaapi,*v4l2*,hw*,scale,volume,test*' --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --enable-wolfssl --enable-decoder='*sub*,movtext,*web*,aac*,*ac3*,alac*,ape,ass,av1*,ccaption,cfhd,cook,dca,dnxhd,eac3*,exr,truehd,ff*,*yuv*,flv,flac,gif,h26[3-4]*,hevc*,hap,mp[1-3]*,prores,*peg*,mlp,mpl2,nellymoser,opus,pcm*,qtrle,*png*,tiff,rawvideo,rv*,sami,srt,ssa,v210*,vc1*,vorbis,vp[6-9]*,wm*,wrapped_avframe' --enable-demuxer='*sub*,*ac3,*ac,*peg*,*web*,au,ape,ass,avi,concat,dnxhd,dts*,*dash*,*flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm*,rawvideo,rt*p,spdif,srt,vc1,v210*,wav,*pipe,image2,mlv,nsv,nut' --enable-encoder='aac,cfhd,dnxhd,exr,ff*,*yuv*,gif,h26[3-4]*,av1*,hevc*,mjpeg*,*png,opus,pcm*,prores*,rawvideo,spdif,speedhq,*jpeg,*png,tiff,vp[8-9]*,wrapped_avframe,*nvenc,*qsv,*v4l2m2m,*vaapi,vorbis' --enable-muxer='*jpeg,dnxhd,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,og*,pcm*,rawvideo,spdif,*pipe,*segment,webm,wav,dash,nu*'

#MDK SDK : global option: ffmpeg.version = 6

#MDK SDK : avformat_version0x7ff39a96ccb9

#MDK SDK : Trying MediaIO FFmpeg for protocol ""

#MDK SDK : 0x7ff394001640 open url: /home/arne/Data/Users/Public/Videos/Eigene/2015-Take That.mp4

#MDK SDK : 0x7ff394001640 url opened

#MDK SDK : default 0x3bbf3a0 FrameReader::update MediaStatus 0X2=>0X2

#MDK SDK : Selected avcodec runtime version: 60.30.102 (build: 60.30.102), license: LGPL version 2.1 or later

#MDK SDK : av_packet_alloc0x7ff39a57f6be

#MDK SDK : FFmpeg/Libav runtime git-2023-10-21-a76b409-avbuild

#MDK SDK : Selected avutil runtime version: 58.27.100 (build: 58.27.100), license: LGPL version 2.1 or later

#MDK SDK : global option: ffmpeg.configuration = --extra-version=avbuild --disable-doc --disable-debug --disable-static --enable-shared --enable-runtime-cpudetect --enable-libvpl --enable-libdrm --disable-postproc --ranlib=llvm-ranlib-17 --nm=llvm-nm-17 --ar=llvm-ar-17 --nvcc=clang-17 --toolchain=hardened --enable-cross-compile --target-os=linux --arch=amd64 --pkg-config=pkg-config --sysroot='$SYSROOT' --cc=clang-17 --enable-lto --enable-pic --extra-cflags='-Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong -I/home/runner/work/avbuild/avbuild/tools/Vulkan-Headers/include -I=/usr/include/libdrm -I/tmp/dep/include -Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong --target=x86_64-linux-gnu' --extra-ldflags='-s -fuse-ld=lld -Wl,--gc-sections -Wl,--gc-sections --target=x86_64-linux-gnu' --extra-libs=-lrt --disable-stripping --enable-small --disable-outdevs --disable-filters --enable-filter='*null*,afade,*fifo,*format,*resample,aeval,allrgb,allyuv,atempo,pan,*bars,color,*key,crop,draw*,eq*,framerate,*_qsv,*_vaapi,*v4l2*,hw*,scale,volume,test*' --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --enable-wolfssl --enable-decoder='*sub*,movtext,*web*,aac*,*ac3*,alac*,ape,ass,av1*,ccaption,cfhd,cook,dca,dnxhd,eac3*,exr,truehd,ff*,*yuv*,flv,flac,gif,h26[3-4]*,hevc*,hap,mp[1-3]*,prores,*peg*,mlp,mpl2,nellymoser,opus,pcm*,qtrle,*png*,tiff,rawvideo,rv*,sami,srt,ssa,v210*,vc1*,vorbis,vp[6-9]*,wm*,wrapped_avframe' --enable-demuxer='*sub*,*ac3,*ac,*peg*,*web*,au,ape,ass,avi,concat,dnxhd,dts*,*dash*,*flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm*,rawvideo,rt*p,spdif,srt,vc1,v210*,wav,*pipe,image2,mlv,nsv,nut' --enable-encoder='aac,cfhd,dnxhd,exr,ff*,*yuv*,gif,h26[3-4]*,av1*,hevc*,mjpeg*,*png,opus,pcm*,prores*,rawvideo,spdif,speedhq,*jpeg,*png,tiff,vp[8-9]*,wrapped_avframe,*nvenc,*qsv,*v4l2m2m,*vaapi,vorbis' --enable-muxer='*jpeg,dnxhd,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,og*,pcm*,rawvideo,spdif,*pipe,*segment,webm,wav,dash,nu*'

#MDK SDK : av_dict_copy0x7ff39a9881c3

#MDK SDK : before avformat_open_input. io: 0x7ff394001640(FFmpeg/pb: 0x7ff39400d680, url: /home/arne/Data/Users/Public/Videos/Eigene/2015-Take That.mp4

#MDK SDK : FFmpeg/Libav runtime git-2023-10-21-a76b409-avbuild

#MDK SDK : after avformat_open_input. pb: 0x7ff39400d680, iformat: 0x7ff39aa99c88 context flags: 2097280, input format flags: 67141640

Create Tree : Video
Create Tree : Audio
resizeGL>>>>>dpr: 1.000000, logical dpi: (96.000000,96.000000), phy dpi: (81.280000,80.682353)

############################################ InfoPropertiesView

Create Tree : File
#MDK SDK : supports 205 ffmpeg sw pixel formats. unsupported: uyyvyy411 x2rgb10be x2bgr10be p212be p212le p412be p412le gbrap14be gbrap14le

#MDK SDK : Format: mov,mp4,m4a,3gp,3g2,mj2, range: 0 +122740ms, bitrate: 25911745, size: 0
Metadata:
creation_time: 2017-01-22T15:02:17.000000Z
minor_version: 0
compatible_brands: isomavc1
major_brand: isom
Streams: 2
Video:
stream#0, range: 20 +122720ms, frames: 6136
codec: h264 tag: 'avc1' profile: 100 level: 42, yuv420p, bpc:8, bpp:12(8,8,8), channels:(1,1,1), map: 0 1 2 0, bitrate: 25746208, 1920x1080, fps: 50, bframes: 1
extra data(52): 01 64 00 2A FF E1 00 25 27 64 00 2A AC 2D 10 07 80 22 7E 5C 04 40 00 00 03 00 40 00 00 19 38 18 00 00 85 7B E0 00 02 09 7C 2F 7B E0 A0 01 00 04 28 EE 3C B0
Metadata:
encoder: AVC Coding
vendor_id: [0][0][0][0]
language: eng
creation_time: 2017-01-22T15:02:17.000000Z
Audio:
stream#1, range: 0 +122667ms, frames: 5750
codec: aac tag: 'mp4a' profile: 1 level: -99, sample size: 0/16, block align: 0, frame_size: 1024, f32p stereo(2) @48000Hz, bitrate: 163833
extra data(2): 11 90
Metadata:
vendor_id: [0][0][0][0]
language: eng
creation_time: 2017-01-22T15:02:17.000000Z

#MDK SDK : default 0x3bbf3a0 FrameReader::update MediaStatus 0X2=>0X4

#MDK SDK : ***buffering progress 0%***

#MDK SDK : default 0x3bbf3a0 FrameReader::update MediaStatus 0X4=>0X14

#MDK SDK : AudioBackendALSA ERROR@285>>> snd_pcm_pause(pcm_, value) (fffffffb): Input/output error

#MDK SDK :
#MDK SDK : ++++++++++++BUFFERING START++++++++++++

#MDK SDK :
#MDK SDK : default FrameReader0x3bbf3a0 state: 0=>1=>1, 1

#MDK SDK : default FrameReader0x3bbf3a0 update state: 0=>1

#MDK SDK : starting decode loop thread mdk.vdec0@140684495419072

#MDK SDK : video stream#0 starting decoding loop from decoder index 0...

#MDK SDK : creating video decoder: VAAPI...

#MDK SDK : opening video decoder: VAAPI...

#MDK SDK : opening ffmpeg video decoder: h264 ...

#MDK SDK : starting decode loop thread mdk.adec1@140684487026368

#MDK SDK : audio stream#1 starting decoding loop from decoder index 0...

#MDK SDK : creating audio decoder: auto...

#MDK SDK : opening audio decoder: FFmpeg...

#MDK SDK : opening ffmpeg audio decoder: aac ...

#MDK SDK : trying va from x11 display: 0x34f2540

#MDK SDK : 0x7ff3900c0ef0 VA-API INFO: VA-API version 1.20.0

#MDK SDK : AVCodec.Audio[aac.] decoder: 1 Single threads

#MDK SDK : aac f32p, stereo @48000Hz

Segmentation fault (core dumped)
wang-bin commented 1 year ago

no idea. i need core dump file, or debug your self and show me crash line

wang-bin commented 1 year ago

I can't see anything useful

(gdb) bt full
#0  0x00007ffff7885107 in ?? ()
No symbol table info available.
#1  0x00007ffff2a511e6 in ?? ()
No symbol table info available.
#2  0x00007fff99600279 in ?? ()
No symbol table info available.
#3  0x00007fff680c17b0 in ?? ()
No symbol table info available.
#4  0x00007ffff7bcae81 in ?? ()
No symbol table info available.
#5  0x00000000ffffffff in ?? ()
No symbol table info available.
#6  0x00007ffff16a3430 in ?? ()
No symbol table info available.
#7  0xda42c04034968c00 in ?? ()
No symbol table info available.
#8  0x00007fff680c0fe0 in ?? ()
No symbol table info available.
#9  0x00007fff680c1450 in ?? ()
No symbol table info available.
#10 0x00007fff996003f0 in ?? ()
No symbol table info available.
#11 0x00007fff99600398 in ?? ()
No symbol table info available.
#12 0x00007fff9960039c in ?? ()
No symbol table info available.
#13 0x0000000000000003 in ?? ()
No symbol table info available.
#14 0x00007fff680c0fe0 in ?? ()
No symbol table info available.
#15 0x00007ffff16a803a in ?? ()
No symbol table info available.
#16 0x00007fff680c1450 in ?? ()
No symbol table info available.
#17 0x0000000000000000 in ?? ()
No symbol table info available.
pierrexn commented 1 year ago

When trying to run and debug my executable, i have same thing. I have added the libmdk.so....dsym. I don't dont understand why...

pierrexn commented 11 months ago

The user has this problem only when using Wayland and not X11, is it a known issue?

wang-bin commented 11 months ago

MDK SDK : trying va from x11 display: 0x34f2540

the log show it's in x11. wayland is also supported, but the I will try to use x11 display if possible, in pure wayland enviroment, x11 display will be null, then drm prime will be used. to skip x11 display, use VAAPI:display=drm or with the last release player.setProperty("videode.decoder", "display=drm").

pierrexn commented 11 months ago

Sorry but users have a crash when using wayland. So why X11 is used? What's the purpose of VAAPI:display=drm?

wang-bin commented 11 months ago

I guess qt is running in x11 mode. it's possible to run x11 apps in wayland. do you have this line https://github.com/wang-bin/mdk-examples/blob/b35218477782c1cc021251064562aba001209dea/Qt/QMDKRenderer.cpp#L35 ?

display=drm will use drm device instead of x11. maybe you can add an option in ui to let user choose x11 or drm

wang-bin commented 11 months ago

what's the result of vainfo, vainfo --display x11 and vainfo --display drm?

pierrexn commented 11 months ago

in the example, it's for Qt >= 6.2.0, and i use 5.15.15, i ask the user for vainfo

pierrexn commented 11 months ago
vainfo --display x11
Trying display: x11
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 23.2.1 for AMD Radeon Graphics (renoir, LLVM 17.0.6, DRM 3.54, 6.6.6-1-default)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
arne@Keller-PC:~> vainfo --display drm
Trying display: drm
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 23.2.1 for AMD Radeon Graphics (renoir, LLVM 17.0.6, DRM 3.54, 6.6.6-1-default)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
wang-bin commented 11 months ago

both are supported. Can you let user run DecodeFps(in sdk package)? put the program in the dir contains libmdk.so.0, and run

export MDK_CLOG=1
./DecodeFps -c:v VAAPI:display=x11 test.mp4 &>vax11.log
./DecodeFps -c:v VAAPI:display=drm test.mp4 &>vadrm.log
wang-bin commented 10 months ago

what about environment var QT_XCB_GL_INTEGRATION=xcb_egl? it works for me in qt examples. default is xcb_glx, then crash in vaapi driver in wayland, no crash in x11 environment

pierrexn commented 10 months ago

I have 2 users that have crash as soon as they try to play video file, even with QT_XCB_GL_INTEGRATION=xcb_egl