Skip to content
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

Wayland video driver not being used on Wayland devices #11603

Closed
Semphriss opened this issue Dec 7, 2024 · 3 comments
Closed

Wayland video driver not being used on Wayland devices #11603

Semphriss opened this issue Dec 7, 2024 · 3 comments
Milestone

Comments

@Semphriss
Copy link
Contributor

Semphriss commented Dec 7, 2024

As of recently (I can try to bisect the exact commit if necessary), SDL will no longer use the Wayland driver on any of my Wayland devices, including Ubuntu 24.04. I verified in the system settings that I'm using Wayland and not Xorg.

Here's a basic test program that I used with latest commit on main (f64e9a5):

#include <SDL3/SDL.h>

int main(void)
{
  if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    SDL_Log("Could not init SDL: %s", SDL_GetError());
    return 1;
  }

  SDL_Log("Video driver: %s\n", SDL_GetCurrentVideoDriver());

  SDL_Quit();

  return 0;
}

This prints: Video driver: x11.


Some extra info:

  • When configuring SDL, I verified that Wayland support is enabled:
    -- SDL_WAYLAND (Wanted: ON): ON
    -- SDL_WAYLAND_LIBDECOR (Wanted: ON): ON
    -- SDL_WAYLAND_LIBDECOR_SHARED (Wanted: ON): ON
    -- SDL_WAYLAND_SHARED (Wanted: ON): ON
  • I enabled verbose logging for all categories, and SDL seems to attempt to load some Wayland and libdecor functions: Failed loading wl_egl_window_create: /opt/amdgpu/lib/x86_64-linux-gnu/libwayland-client.so.0: undefined symbol: _wl_egl_window_create; Failed loading libdecor_unref: /opt/amdgpu/lib/x86_64-linux-gnu/libwayland-client.so.0: undefined symbol: _libdecor_unref
@slouken
Copy link
Collaborator

slouken commented Dec 7, 2024

We default to X11 unless certain Wayland extensions are available, for performance reasons. What happens if you set the environment variable SDL_VIDEO_DRIVER=wayland?

@slouken slouken added this to the 3.2.0 milestone Dec 7, 2024
@Semphriss
Copy link
Contributor Author

With SDL_VIDEO_DRIVER=wayland, it reports using Wayland as expected.

Is the change recent? I was quite surprised to see my apps switch to X11, given that my system has "regular" Wayland support.

It's mostly an issue for Ubuntu Touch phones, for which I'm currently working on an SDL port, and whose support for X11 is abysmal. I can manually set SDL_HINT_VIDEO_DRIVER to wayland, though I should instruct app porters to do the same.

@slouken
Copy link
Collaborator

slouken commented Dec 7, 2024

Yes, it was made recently, due to performance issues with current Wayland support. See #9383 for details.

@slouken slouken closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants