Bug 1390233
Summary: | SDL2 is broken on Wayland when using SDL_VIDEODRIVER=wayland | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | sebby2k <shopper2k> |
Component: | SDL2 | Assignee: | Igor Gnatenko <ignatenko> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 25 | CC: | ignatenko, tcallawa |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-12-12 15:42:44 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1277927 |
Description
sebby2k
2016-10-31 14:34:11 UTC
This also happens with other SDL2 packages in F25 repo.
> sudo dnf install cdogs-sdl
> SDL_VIDEODRIVER=wayland cdogs-sdl
C-Dogs SDL v0.6.2
Original Code Copyright Ronny Wester 1995
Game Data Copyright Ronny Wester 1995
SDL Port by Jeremy Chin, Lucas Martin-King and Cong Xu, Copyright 2003-2016
INFO [MAIN ] [files.c:622] SetupConfigDir(): Creating config dir /home/sebby/.config/cdogs-sdl/...
INFO [MAIN ] [files.c:627] SetupConfigDir(): Config dir already exists.
INFO [MAIN ] [cdogs.c:260] main(): Command line (1 args): cdogs-sdl
ERROR [MAIN ] [cdogs.c:381] main(): Could not initialise SDL: wayland not available
Any update on this? I compiled a local version of SDL2 2.0.5 using the following deps and configuration:
sudo dnf install libX11-devel libXcursor-devel libXext-devel libXxf86vm-devel libXi-devel libXinerama-devel libXrandr-devel libXrender-devel libXScrnSaver-devel libusb-devel libxkbcommon-devel alsa-lib-devel audiofile-devel dbus-devel mesa-libEGL-devel mesa-libGL-devel mesa-libGLES-devel mesa-libwayland-egl-devel pulseaudio-libs-devel systemd-devel wayland-devel wayland-protocols-devel
> hg clone https://hg.libsdl.org/SDL SDL
> cd SDL
> mkdir build
> cd build
> ../configure
> make -j
Using my local version, SDL wayland backend works properly. It seems the source RPM spec doesn't resolve all dependencies properly, specifically one or more of the following:
wayland-devel wayland-protocols-devel mesa-libwayland-egl-devel
Interestingly, I had removed the local build of SDL2 and reinstalled offical SDL2-2.0.5-2.fc25.x86_64.rpm and can no longer repro the issue. Not sure what has changed, but since I can no longer reproduce it, its no longer a bug. I had mistakenly used SDL_BACKEND=wayland env variable instead of SDL_VIDEODRIVER=wayland cdogs-sdl in my last two comments.
This is still an open issue.
> SDL_VIDEODRIVER=wayland cdogs-sdl
C-Dogs SDL v0.6.2
Original Code Copyright Ronny Wester 1995
Game Data Copyright Ronny Wester 1995
SDL Port by Jeremy Chin, Lucas Martin-King and Cong Xu, Copyright 2003-2016
INFO [MAIN ] [files.c:622] SetupConfigDir(): Creating config dir /home/sebby/.config/cdogs-sdl/...
INFO [MAIN ] [files.c:627] SetupConfigDir(): Config dir already exists.
INFO [MAIN ] [cdogs.c:260] main(): Command line (1 args): cdogs-sdl
ERROR [MAIN ] [cdogs.c:381] main(): Could not initialise SDL: wayland not available
Segmentation fault (core dumped)
I traced the error to the following function: src/video/wayland/SDL_waylandvideo.c: Wayland_Available - calls WAYLAND_wl_display_connect which returns null. Hope that helps. I did more troubleshooting and tried running this simple program to test wayland connection.
#include <stdio.h>
#include <wayland-client.h>
int main(int argc, char **argv) {
struct wl_display *display = NULL;
display = wl_display_connect("wayland-0");
if (display == NULL) {
fprintf(stderr, "Can't connect to display\n");
return 1;
}
printf("connected to display\n");
wl_display_disconnect(display);
printf("disconnected from display\n");
return 0;
}
The call to wl_display_connect also failed in this case.
Oddly enough, the loginctl reports that I'm using X11 session even though I explicitly select GNOME session (not GNOME on X.org) on the login screen.
> loginctl show-session 3 -p Type
Type=x11
Therefore, this no longer appears to be SDL2 related issue.
The problem with Gnome failing to start Wayland session is reported by another user here: https://bugzilla.redhat.com/show_bug.cgi?id=1403512 My hw configuration also comes with Intel integrated and Radeon discrete graphics in my laptop. With the workaround radeon.modeset=0 in grub configuration, Wayland session start successfully and so do SDL2 based apps. |