-
Notifications
You must be signed in to change notification settings - Fork 38
Xonotic does not work with the latest sdl3/sdl2-compat library #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The window isn't appearing on Wayland because eglSwapBuffers() always fails with EGL_BAD_DISPLAY. The EGL display and surface passed to the function appear to be valid, and there are no other errors during initialization or before swapping, so I'm not sure what is going on here. |
Can we git bisect to see where it broke? |
On my system with the Nvidia proprietary drivers, Xonotic doesn't work with Wayland with the current release version, the old 3.2.10/2.32.54 version, or with the real SDL2 either. If I take the Nvidia drivers out of the equation and force lavapipe + Zink it works though: This is probably an Nvidia driver bug. |
Just forcing Zink with Nvidia's Vulkan implementation works too: This is definitely an Nvidia GL driver bug. |
Hi, but I am using Xonotic-SDL on AMD Radeon hardware (RX 5600 XT) and plain X11 (no Wayland and no Vulkan AFAIK). |
I am having the same issue. I am using ArchLinux and the nvidia-open driver. My computer has an Intel CPU and an NVidia 4070 mobile graphics card. I can launch Xonotic with An interesting detail is that if I
Then the console will open and contain those random keys I typed. But if I press more letter keys after step 3, they won't appear in the console. Another interesting detail: If I press the enter key, it behaves as if I pressed the enter key twice. The same is true for arrow keys. If I press the "up" key once, it will go back two commands in history in quick succession. And this problem seems to be related to FCITX 5 (the input method framework for inputting Chinese, Japanese and other languages). I am using Wayland + KDE Plasma, and I am setting the "virtual keyboard" in System Settings to the Fcitx virtual keyboard (which is the expected way to use Fcitx). If I turn off the virtual keyboard, the problem will go away. I think it may be related to some interaction between SDL and input methods. |
I created a minimalist test program #include <stdio.h>
#include <SDL.h>
int main() {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
printf("Error initializing SDL: %s\n", SDL_GetError());
return -1;
}
SDL_Window *window = SDL_CreateWindow("Keyboard events test",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
800, 600,
SDL_WINDOW_SHOWN);
if(!window) {
printf("Error creating window: %s\n", SDL_GetError());
return -2;
}
bool quit = false;
while (!quit) {
SDL_Event e;
SDL_WaitEvent(&e);
switch (e.type) {
case SDL_QUIT:
quit = true;
break;
case SDL_KEYDOWN:
printf("Key down: %d\n", e.key.keysym.sym);
break;
case SDL_KEYUP:
printf("Key up: %d\n", e.key.keysym.sym);
break;
case SDL_TEXTINPUT:
printf("Text input: [%s]\n", e.text.text);
break;
default:
printf("Event: %d\n", e.type);
}
}
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
} Save it as
I first go to KDE System Setting -> Input & Output -> Virtual Keyboard and select "None". I launch the program and press A B C D E ALT+F4 in that order. It prints:
Then I go to KDE System Setting -> Input & Output -> Virtual Keyboard and select "Fcitx 5" or "Fcitx 5 Wayland Launcher (experimental)" (the results are the same). I launch the program and press A B C D E ALT+F4 in that order. It prints:
Notice that all key-down events are duplicated. Some package versions:
|
Well, the duplicated key-down event was caused by 2a9b84e However, that was an independent problem. I built the revision before that, and used |
I also tried downgrading my ArchLinux packages to the previous versions. The following combination does not have the problem:
Because the commit 2a9b84e was between 2.30.50 and 2.30.51, but the package sdl2-compat-2.32.54-2 works, I guess something happened in sdl3 between 3.2.10 and 3.2.12 changed the behavior. |
The X11 IME double key issue is fixed in upstream SDL3, which also seems to solves the Xonotic text input issue from my testing. |
I bisected the SDL repo and found the culprit is libsdl-org/SDL@e42071a It was related to X11 and IME.
@Kontrabant Thank you. I have just seen your message. I confirm that the current But if I do so, Xonotic will crash on exit with an error message
And whenever I open the console by pressing BACKTICK, it opens the console, but the BACKTICK character is also typed into the console, which shouldn't happen. Anyway those are other problems that needs solution. I think what I can do as an ArchLinux user is just temporarily pin the version of |
The assertion failures are due to compiling in debug mode, and the game not completely cleaning up its threads on exit. This is not unique to Xonotic, as it happens with others as well.
This might be a legit game bug, as the engine seems to make an assumption about internal X and SDL workings in that a text event will always immediately follow the associated key down event in the event queue, which doesn't always happen with the updated SDL3 IME code and passing dead keys while text input is enabled, as X may not send the text event immediately following the key down event. In short:
|
Not sure if this is the same issue, but in my case, I have a black Xonotic window with all three drivers (nvidia, nouveau and nouveau+zink) (and I have no idea how to run nvidia+zink, the commands mentioned above don't work) Downgrading to 2.32.54 fixes this (both sdl3 3.2.10 and 3.2.12 work well after downgrading sdl2-compat) UPD: the black screen seems to be caused by libsdl-org/SDL#12986 |
Ah, my system defaults to Pipewire for audio, so that's why I couldn't reproduce this. Forcing it to Pulseaudio breaks GL rendering on my setup as well, on both X and Wayland. |
…oop callback." This reverts commit 3b91017. This apparently is cleaning up more threads than expected, so this needs a rethink. Fixes #12986. Fixes libsdl-org/sdl2-compat#486 Fixes libsdl-org/sdl2-compat#482 (cherry picked from commit e1066ce)
SDL 3.2.14 with the fix for the bug is now available! |
I am using Xonotic (fps online game) on Arch Linux, after upgrading to sdl3-3.2.12/sdl2-compat-2.32.56 it stopped working (only the splash screen is displayed with music). I had to downgrade to the previous version.
Unfortunately I cannot supply further information.
Thanks
The text was updated successfully, but these errors were encountered: