question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SDL Wayland backend no longer working since 2022.515.0

See original GitHub issue

Type

Crash to desktop

Bug description

Game crashes when started with SDL_VIDEODRIVER=wayland due to missing primary display. My compositor does not actually have a primary display, and programs (including older versions of osu) just open on whatever display my mouse is on, which is expected/fine. (Maybe fall back to the old display logic when there is no primary display?)

When started with SDL_VIDEODRIVER=x11 it opens on the display my mouse is on, but with the resolution of my other connected display, instead of the expected resolution of the display it opens on. This is repeated every time I open osu.

The game crashes with the following error when using wayland:

Unhandled exception. System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at osu.Framework.Platform.SDL2DesktopWindow.get_PrimaryDisplay()
   at osu.Framework.Platform.SDL2DesktopWindow.SetupWindow(FrameworkConfigManager config)
   at osu.Framework.Platform.GameHost.Run(Game game)
   at osu.Desktop.Program.Main(String[] args) in /var/lib/buildkite-agent/builds/debian-gnu-linux-vm-2/ppy/osu/osu.Desktop/Program.cs:line 105

Edit: Resolution also breaks whenever focus is lost on x11

Screenshots or videos

https://streamable.com/olsm6a (video is cropped on the sides due to hardware encoder limitations)

Version

2022.515.0

Logs

x11_database.log x11_legacy-ipc.log x11_network.log x11_performance.log x11_runtime.log x11_updater.log wayland_runtime.log (only runtime.log was present for wayland)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
smoogipoocommented, May 16, 2022

Imo I think it’s fine bumping up the CI runner. People tend to upgrade their desktops to the latest software, if possible (which is pretty much always the case with Linux).

3reactions
bdachcommented, May 15, 2022

Related upstream thread: https://github.com/libsdl-org/SDL/pull/5429

Looks like upstream is plain giving up on wayland on older distros, which I suppose from their perspective is understandable, but is putting us in a bad spot due to an “unconventional” (in the linux world) release model. I wouldn’t be necessarily opposed to giving up on older distros ourselves, ubuntu 18.04 merely has a year of LTS left and there are two newer stable releases now, but I don’t feel it’s my call to make.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SDL backend does not work with SDL_VIDEODRIVER= ...
On wayland compile example_sdl_(opengl3, opengl2 or vulkan); let example run with SDL_VIDEODRIVER=wayland environment variable SDL_VIDEODRIVER= ...
Read more >
SDL 2.0.22 will default to Wayland on Linux : r/linux_gaming
Probably not much unless you have an issue. What this means is that the Wayland back-end in SDL is in good enough shape...
Read more >
SDL2 error on RISC-V - SDL Development
I'm porting an app to StarFive VisionFive2 RISC-V @64bit Linux. Compile work well, but once run, the app quit without creating any window....
Read more >
1390233 – SDL2 is broken on Wayland when using ...
Description of problem: SDL2 wayland backend used to work in F24. After upgrading to F25, SDL2 is unable to use wayland backend.
Read more >
[posila] [1.1.59] Can not launch on Wayland compositor
Hello, Background The latest Fedora builds are using the Wayland display system instead of Xorg. This has been supported in SDL2 graphics ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found