Description of problem: Hi, I was investigating some graphical glitching for an SDL game (OpenRA) under FC24 under Wayland which doesn't show up under Xorg. When doing some SDL tests, I saw that SDL2 applications were still defaulting to "x11" under Wayland (if "lg" output and tests below are to be believed...). I'm running a fairly default FC24 install. 2 question/issues: A) Does "SDL_Init( SDL_INIT_VIDEO )" still default to "x11" under Wayland? The tests below show it is. Does this apply: https://wiki.archlinux.org/index.php/wayland#SDL and if so whats the plan around this transition? If the aim is to have Wayland be the default for FC25, should this be patched now for people testing Wayland in FC24 to flush out bugs? B) Is "SDL_Init(SDL_INIT_VIDEO);" known to work for the Wayland SDL video driver? It crashes for me, see below - maybe something more is needed for this patch: http://pkgs.fedoraproject.org/cgit/rpms/SDL2.git/tree/SDL2-wayland-dyn-wl_proxy_marshal_constructor_versioned.patch?id=fac91fa8fec7a8dc2f02008bd1eb43a6628f3932 Or maybe I am not linking this properly... Thanks! Version-Release number of selected component (if applicable): $ rpm -qa SDL2 SDL2-2.0.4-4.fc24.x86_64 How reproducible: All the time under Gnome + Wayland Steps to Reproduce: ### Directly calling SDL_Init() shows this issue [jman@talos test_sdl]$ cat test_sdl.c #include <stdio.h> #include <SDL.h> int main( int argc, char *argv[] ) { if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) { printf( "SDL_Init() error: %s\n", SDL_GetError() ); return 1; } printf( "SDL_Init() succeeded.\n" ); printf( "SDL_GetCurrentVideoDriver(): %s\n", SDL_GetCurrentVideoDriver() ); return 0; } [jman@talos test_sdl]$ ./test_sdl SDL_Init() succeeded. SDL_GetCurrentVideoDriver(): x11 [jman@talos test_sdl]$ SDL_VIDEODRIVER=x11 ./test_sdl SDL_Init() succeeded. SDL_GetCurrentVideoDriver(): x11 [jman@talos test_sdl]$ SDL_VIDEODRIVER=blabla ./test_sdl SDL_Init() error: blabla not available [jman@talos test_sdl]$ SDL_VIDEODRIVER=wayland ./test_sdl Segmentation fault (core dumped) ### OpenArena just for comparison, not directly concerned about it at the moment... ### "lg" shows x11 windows by default ### crashes when wayland driver is chosen [jman@talos test_sdl]$ openarena [jman@talos test_sdl]$ SDL_VIDEODRIVER=wayland openarena SDL_Init( SDL_INIT_VIDEO ) FAILED (No available video device) [jman@talos test_sdl]$ SDL_VIDEODRIVER=wayland gdb ./test_sdl GNU gdb (GDB) Fedora 7.11.1-75.fc24 [...skip...] Reading symbols from ./test_sdl...done. (gdb) run Starting program: /home/jman/test_sdl/test_sdl [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007ffff7b8fb4c in wl_registry_bind (version=1, interface=<optimized out>, name=<optimized out>, wl_registry=<optimized out>) at /usr/include/wayland-client-protocol.h:305 #2 display_handle_global (data=0x605490, registry=<optimized out>, id=<optimized out>, interface=<optimized out>, version=<optimized out>) at /usr/src/debug/SDL2-2.0.4/src/video/wayland/SDL_waylandvideo.c:246 #3 0x00007ffff367ac58 in ffi_call_unix64 () at ../src/x86/unix64.S:76 #4 0x00007ffff367a6ba in ffi_call (cif=cif@entry=0x7fffffffdbd0, fn=<optimized out>, rvalue=<optimized out>, rvalue@entry=0x0, avalue=avalue@entry=0x7fffffffdca0) at ../src/x86/ffi64.c:525 #5 0x00007ffff3885a9e in wl_closure_invoke (closure=closure@entry=0x6044d0, flags=flags@entry=1, target=<optimized out>, target@entry=0x604300, opcode=opcode@entry=0, data=<optimized out>) at src/connection.c:949 #6 0x00007ffff3882840 in dispatch_event (display=display@entry=0x605520, queue=<optimized out>) at src/wayland-client.c:1274 #7 0x00007ffff3883a14 in dispatch_queue (queue=0x6055e8, display=0x605520) at src/wayland-client.c:1420 #8 wl_display_dispatch_queue_pending (display=0x605520, queue=0x6055e8) at src/wayland-client.c:1662 #9 0x00007ffff3883d2f in wl_display_roundtrip_queue (display=0x605520, queue=0x6055e8) at src/wayland-client.c:1085 #10 0x00007ffff7b8f824 in Wayland_VideoInit (_this=<optimized out>) at /usr/src/debug/SDL2-2.0.4/src/video/wayland/SDL_waylandvideo.c:299 #11 0x00007ffff7b7a50c in SDL_VideoInit_REAL (driver_name=<optimized out>, driver_name@entry=0x0) at /usr/src/debug/SDL2-2.0.4/src/video/SDL_video.c:513 #12 0x00007ffff7ae2587 in SDL_InitSubSystem_REAL (flags=16416) at /usr/src/debug/SDL2-2.0.4/src/SDL.c:173 #13 0x000000000040078f in main (argc=1, argv=0x7fffffffdfa8) at test_sdl.c:4 ### ### "WAYLAND_wl_proxy_marshal_constructor_versioned" an uninitialzed pointer/hook? ### (gdb) frame 1 #1 0x00007ffff7b8fb4c in wl_registry_bind (version=1, interface=<optimized out>, name=<optimized out>, wl_registry=<optimized out>) at /usr/include/wayland-client-protocol.h:305 305 id = wl_proxy_marshal_constructor_versioned((struct wl_proxy *) wl_registry, (gdb) print wl_proxy_marshal_constructor_versioned $1 = {struct wl_proxy *(struct wl_proxy *, uint32_t, const struct wl_interface *, uint32_t, ...)} 0x7ffff3882eb0 <wl_proxy_marshal_constructor_versioned> (gdb) print WAYLAND_wl_proxy_marshal_constructor_versioned $2 = (struct wl_proxy *(*)(struct wl_proxy *, uint32_t, const struct wl_interface *, uint32_t, ...)) 0x0 (gdb) ### Pretty sure I am running Wayland: ### - Picked it at the login screen ### - "lg" shows some Wayland windows active ### - "ps" shows Wayland process no Xorg processes [jman@talos test_sdl]$ ps fwww PID TTY STAT TIME COMMAND 25208 tty2 Ssl+ 0:00 /usr/libexec/gdm-wayland-session gnome-session 25210 tty2 Sl+ 0:00 \_ /usr/libexec/gnome-session-binary 25230 tty2 Sl+ 7:13 \_ /usr/bin/gnome-shell 25246 tty2 Sl+ 2:23 | \_ /usr/bin/Xwayland :0 -rootless -noreset -listen 4 -listen 5 -displayfd 6 25536 tty2 Rl+ 31:08 | \_ /usr/lib64/firefox/firefox 25900 tty2 Sl+ 0:02 | \_ /usr/bin/python /usr/bin/terminator 25908 tty2 S+ 0:00 | | \_ gnome-pty-helper 25909 pts/0 Ss 0:00 | | \_ /bin/bash 13879 pts/0 R+ 0:00 | | \_ ps fwww 27670 tty2 Sl+ 0:28 | \_ gedit 28820 tty2 Sl+ 0:49 | \_ /usr/bin/python /usr/bin/terminator 28827 tty2 S+ 0:00 | | \_ gnome-pty-helper 28828 pts/1 Ss 0:01 | | \_ /bin/bash 13847 pts/1 Sl+ 0:00 | | | \_ gdb ./test_sdl 3104 pts/2 Ss+ 0:00 | | \_ /bin/bash 9094 tty2 Sl+ 0:00 | \_ /usr/bin/python /usr/bin/terminator 9101 tty2 S+ 0:00 | \_ gnome-pty-helper 9102 pts/3 Ss+ 0:00 | \_ /bin/bash 25279 tty2 Sl+ 0:12 \_ /usr/libexec/gnome-settings-daemon 25359 tty2 SNl+ 0:00 \_ /usr/libexec/tracker-miner-apps 25365 tty2 Sl+ 0:00 \_ /usr/bin/python /usr/libexec/gnome-tweak-tool-lid-inhibitor 25367 tty2 Sl+ 0:01 \_ /usr/bin/gnome-software --gapplication-service 25368 tty2 SNl+ 0:00 \_ /usr/libexec/tracker-extract 25369 tty2 SNl+ 0:00 \_ /usr/libexec/tracker-miner-user-guides 25370 tty2 Sl+ 0:00 \_ abrt-applet 25384 tty2 S+ 0:00 \_ /usr/bin/seapplet 25397 tty2 SNl+ 0:00 \_ /usr/libexec/tracker-miner-fs 25402 tty2 Sl+ 0:00 \_ /usr/libexec/evolution/evolution-alarm-notify 25377 tty2 Sl+ 0:00 /usr/libexec/gsd-printer [jman@talos test_sdl]$ lshw -short | grep display /0/100/2 display HD Graphics 5300
This is how I was compiling that test C code: $ gcc -o test_sdl test_sdl.c -g -lSDL2 -lGL -I/usr/include/SDL2
Created attachment 1178090 [details] Updated version of the original patch
Created attachment 1178091 [details] 0001-fix-Wayland-dynamic-symbol-loading-bz1354155.patch Yup, it looks like this fix from https://bugzilla.libsdl.org/show_bug.cgi?id=3255 was missing another step added later here: https://bugzilla.libsdl.org/show_bug.cgi?id=3265 https://hg.libsdl.org/SDL/rev/330f500d5815 Attached an update to the patch: - SDL2-wayland-dyn-wl_proxy_marshal_constructor_versioned.patch (updated version of the original patch) - 0001-make-static-subpackage.patch (git format-patch) After applying, SDL_Init() works as expected and test applications seem to work OK, so this takes care of B) above. $ SDL_VIDEODRIVER=wayland ./test_sdl SDL_Init() succeeded. SDL_GetCurrentVideoDriver(): wayland $ cd ~/rpmbuild/BUILD/SDL2-2.0.4/test $ SDL_VIDEODRIVER=wayland ./testdisplayinfo INFO: Using video target 'wayland'. INFO: See 1 displays. INFO: 0: "SyncMaster" (1680x1050, (0, 0)), 1 modes. ... $ SDL_VIDEODRIVER=wayland ./testgl2 <works OK> One extra question: Are the SDL test applications built into any RPMs? They could be very useful to include in SDL2-devel as common reference tests for the upcoming wave of SDL wayland troubleshooting...
SDL2-2.0.4-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a9097aa363
SDL2-2.0.4-6.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d7e30fd6ac
(In reply to Joseph Mullally from comment #1) > This is how I was compiling that test C code: > > $ gcc -o test_sdl test_sdl.c -g -lSDL2 -lGL -I/usr/include/SDL2 Thanks a lot for contribution!
SDL2-2.0.4-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a9097aa363
SDL2-2.0.4-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d7e30fd6ac
SDL2-2.0.4-6.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
SDL2-2.0.4-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.