Hello,
First, thanks a lot for providing this nice library, with such portability. I read this forum since a long while but I never had the need to ask, since all the questions I had were already answered
This time, I got a serious issue with (SDL) threads on Linux only, and I’m there because I need help.
First, I have to say there is no problem on Windows, and everything works as expected (tested on Windows 7 and > working well, with the current code, after cross compilation mingw + posic version of gcc/g++)
The issue occurs only on the Linux side, and I only tested on one Linux machine, with LinuxMint 19.2. No issue so far when using older Linuxmint versions …
SDL versions tested are built by me, 2.0.9 and 2.0.10 (see the links to see the compilation flags), and IMHO, the issue is perhaps caused by a bad SDL2 use. Very probably my fault, but I’d like to understand what exactly.
Note : I already reported the issue at linuxmint blog , but got no feedback yet.
The issue : everything works, excepted when I open a video : when I want to close it, SDL_DestroyCond() never returns, and the application is definitley frozen.
strace miniDart stops at :
futex_wait_queue_me … (application stops unendlessly …)
The code is available on framagit : https://framagit.org/ericb/miniDart , and I provided instructions to build the software. Please read:
-
https://framagit.org/ericb/miniDart/blob/master/miniDart_install_log
( + BUILDING file located in Sources for further information)
Of course, there is a lot to do and I’m not a pro, e.g. there is a lot of code factorization to do, but since I 'm alone, I’ll take my time quietly
To save your time, the problematic parts are probably located in FFmpegPlayer.cpp, + in miniDart.cpp. Just follow LoadFile() calls, to understand how it works.
Last, here are some debug information, just in case it could help :
me@my_machine ~/Devel/minidart/miniDart_0.99/build $ ./miniDart
fps : 0
drawable area is 0 x 0
dpi : 166.444
defaultDpi : 150
windowDpiScaledWidth : 1553
windowDpiScaledHeight : 865
SDL2 Window created
SDL_VERSION_ATLEAST(2,0,9) 1
SDL_VERSION_ATLEAST(2,0,8) 1
SDL_VERSION_ATLEAST(2,0,7) 1
SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE SDL_VERSION_ATLEAST(2,0,4) = 1
SDL_HAS_WINDOW_ALPHA SDL_VERSION_ATLEAST(2,0,5) = 1
SDL_HAS_ALWAYS_ON_TOP SDL_VERSION_ATLEAST(2,0,5) = 1
SDL_HAS_USABLE_DISPLAY_BOUNDS SDL_VERSION_ATLEAST(2,0,5) = 1
SDL_HAS_PER_MONITOR_DPI SDL_VERSION_ATLEAST(2,0,4) = 1
SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6) = 1
SDL_HAS_MOUSE_FOCUS_CLICKTHROUGH SDL_VERSION_ATLEAST(2,0,5) = 1
We compiled against SDL version 2.0.9 …
And we are linking against SDL version 2.0.9.
OpenGL version: 4.5 (Core Profile) Mesa 19.1.6 (git-4ec2325dd0)
GLSL version: 4.50
Vendor: Intel Open Source Technology Center
Renderer: Mesa DRI Intel® HD Graphics (Whiskey Lake 3x8 GT2)
Audio device (no recording capability) 0: HDA Intel PCH, ALC293 Analog
Audio device (with recording capability) 0: HDA Intel PCH, ALC293 Analog
Audio device (no recording capability) 1: HDA Intel PCH, HDMI 0
Audio device (with recording capability) 1: (null)
Audio device (no recording capability) 2: HDA Intel PCH, HDMI 1
Audio device (with recording capability) 2: (null)
Audio device (no recording capability) 3: HDA Intel PCH, HDMI 2
Audio device (with recording capability) 3: (null)
Audio device (no recording capability) 4: HDA Intel PCH, HDMI 3
Audio device (with recording capability) 4: (null)
Audio device (no recording capability) 5: HDA Intel PCH, HDMI 4
Audio device (with recording capability) 5: (null)
Audio device (no recording capability) 6: (null)
Audio device (with recording capability) 6: (null)
Audio device (no recording capability) 7: (null)
Audio device (with recording capability) 7: (null)
Found Audio device (with recording capability) device number : 0 name : HDA Intel PCH, ALC293 Analog
1 recordable audio devices.
Number of Audio devices (with recording capability) 1
Audio subsystem initialized; driver = alsa.
io = 0x55d3cf282918
style = 0x55d3cf283f50
isFullVideo vaut 1
Gtk-Message: 18:46:44.551: GtkDialog mapped without a transient parent. This is discouraged.
video_init done
calling main2(filename), filename in video_init contains : /home/my_login/Devel/minidart/miniDart_0.99/build/some_video.mkv
av_sync_type = 0
b_video_running = 1 (currently in video_init)
Initialization : origin = 0
max_position = 0
video_duration = 0
video_duration = 223,621000 (currently in read_thread)
do exit
entering in do_exit(is)
is->tead_tid : 0x55d3d0aa0420
closing audio stream …
… done …
closing video stream …
… done …
closing input file …
… done …
destroying video queue …
… done …
destroying video queue …
… done …
destroying frame queue …
I’m here : 383 in frame_queue_destroy
I’m here : 392 before SDL_DestroyMutex()
I’m here : 397 before SDL_DestroyCond() // never returning …
Other important information : the linux kernel I’m using is one I built myself (the Debian way), and it was working perfectly with LinuxMint 17, and 18.4
Other possible tracks: some changes in libc ? Or some important library, or kernel mitigation or …?
Last but not least, I tested building everything using gcc / g++ 5.x , 7.1.0 and no change so far. Old versions (known to work perfectly), and tested on this machine are broken, and ideas are missing me …
Thanks a lot in advance for any track …
Eric Bachard