We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5292 - SDL_CreateRenderer hangs on Manjaro/Arch Linux for FULLSCREEN_DESKTOP window
Summary: SDL_CreateRenderer hangs on Manjaro/Arch Linux for FULLSCREEN_DESKTOP window
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.12
Hardware: x86_64 Linux
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-21 12:02 UTC by bvschaik
Modified: 2020-12-29 09:03 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bvschaik 2020-09-21 12:02:34 UTC
At least two users of my game, both running Manjaro Linux using NVidia graphics, report not being able to start the game in FULLSCREEN_DESKTOP mode: the screen flashes but does not show the game's window. "Top" or equivalent show the game is still running but is stuck on something.

Through trial and error we found that the code hangs on SDL_CreateRenderer() for a window with the flag SDL_WINDOW_FULLSCREEN_DESKTOP set. When they start in windowed mode, the window shows up and they can then move in and out of fullscreen without any problems. When they quit the game, the first time they start up in fullscreen mode it still works, but the second time it hangs again.

I wasn't able to reproduce this myself with a virtual machine.

Original bug: https://github.com/bvschaik/julius/issues/510
Video of the behaviour: https://youtu.be/PSdNT67bcdk

Relevant code:

    SDL_Log("Creating renderer, available drivers:");
    SDL_RendererInfo info;
    int num_drivers = SDL_GetNumRenderDrivers();
    for (int i = 0; i < num_drivers; i++) {
        SDL_GetRenderDriverInfo(i, &info);
        SDL_Log("- %s", info.name);
    }
    SDL.renderer = SDL_CreateRenderer(SDL.window, -1, SDL_RENDERER_PRESENTVSYNC);
    if (!SDL.renderer) {
        SDL_Log("Unable to create renderer, trying software renderer: %s", SDL_GetError());
        SDL.renderer = SDL_CreateRenderer(SDL.window, -1, SDL_RENDERER_SOFTWARE);
        if (!SDL.renderer) {
            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create renderer: %s", SDL_GetError());
            return 0;
        }
    }
    SDL_GetRendererInfo(SDL.renderer, &info);
    SDL_Log("Created renderer: %s (%d)", info.name, info.flags);

The logging for starting in windowed mode shows:

INFO: Creating renderer, available drivers:
INFO: - opengl
INFO: - opengles2
INFO: - software
INFO: Created renderer: opengl (14)

The logging for starting in fullscreen mode stops after the list of drivers: neither "Created renderer" nor any of the error messages is printed.

I'm guessing this is an issue with a combination of Manjaro/Arch software update, display drivers, and SDL, since both users report the issue starting suddenly. It's frustrating that I cannot reproduce it. Since it hangs in an SDL call I report this bug here; if I should have reported it somewhere else, please let me know.
Comment 1 Rohit Nirmal 2020-09-29 19:15:09 UTC
I'm getting the issue in Chocolate Doom with fullscreen as well. I erroneously filed the bug there (https://github.com/chocolate-doom/chocolate-doom/issues/1314), and the issues I mentioned are similar to the ones described here.
Comment 2 bvschaik 2020-12-29 09:03:41 UTC
One user reported this issue is fixed in Manjaro 20.2. I assume it was a driver issue then.