Wayland Issues

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Post Reply
nwah
Posts: 45
Joined: 21 Nov 2013, 07:40

Wayland Issues

Post by nwah »

I'm on Arch linux running SDL 2.0.5 with the latest git master code.

I ran cmake with -DDESIRED_QT_VERSION=5 and -DOPENGL_ES=true

Then I export SDL_VIDEODRIVER=wayland and run OpenMW

But it says:
"ERROR: Could not initialize SDL! wayland not available"
if I don't export SDL_VIDEODRIVER=wayland, which I assume would try to run it via XWayland, then it says:
"ERROR: Failed to create SDL window: Couldn't find matching GLX visual"
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Wayland Issues

Post by psi29a »

to be fair, opengl_es should only be attempted if you are working on the Android build, you should ignore this option for anything else. OpenMW doesn't officially support ES, this is worked around in Android by using some type of gl shim to shoe-horn it in.

Qt5 is not recommended as there is a bug that effects openmw-cs, it is a reason why we ship osgQt so that we and others can compile against Qt4 and not depend on the osgQt that was compiled against Qt5 downstream.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Wayland Issues

Post by Chris »

nwah wrote:Then I export SDL_VIDEODRIVER=wayland and run OpenMW

But it says:
"ERROR: Could not initialize SDL! wayland not available"
Sounds like that version of SDL wasn't built with Wayland support. You'll need to ask the package maintainers about that.
nwah
Posts: 45
Joined: 21 Nov 2013, 07:40

Re: Wayland Issues

Post by nwah »

According to the Arch wiki, wayland has been enabled by default since 2.0.2

https://wiki.archlinux.org/index.php/wayland#SDL

Wayland is explicitly a build dependency

https://www.archlinux.org/packages/extra/x86_64/sdl2/

Upstream, it has been enabled by default since 2.0.4

https://www.phoronix.com/scan.php?page= ... 4-Released
nwah
Posts: 45
Joined: 21 Nov 2013, 07:40

Re: Wayland Issues

Post by nwah »

Even if QT5 isn't preferred, it works just fine on X11. I used OpenGL-ES in order to try to leverage EGL, which is what Wayland likes. Not building with OpenGL-ES gives the same error.

My understanding is that GLX and Wayland don't play nicely, which is why KWin uses EGL on Wayland. I'm using KWin.
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Wayland Issues

Post by psi29a »

nwah wrote:Even if QT5 isn't preferred, it works just fine on X11. I used OpenGL-ES in order to try to leverage EGL, which is what Wayland likes. Not building with OpenGL-ES gives the same error.

My understanding is that GLX and Wayland don't play nicely, which is why KWin uses EGL on Wayland. I'm using KWin.
Qt5 bug only manifests itself in openmw-cs, as it isn't used on openmw. Up to you, I'm just warning you of the result until it is fixed. :)

Please report back if after your work that openmw itself runs correctly with EGL or GLESv1. :)

When I tried with OSG, it went all horribly wrong... it was able to open a gl context, and it could draw a few boxes (mygui), display the loading images but rendering of anything 3D related was just black.

According to my research (read: not tested) however, Kwin and Gnome need to play nicely with Wayland to be able to render on Wayland. However once you ask SDL2 (that is compiled with Wayland support) for a GL context, it doesn't matter if it is EGL, GLESv1 or just GL, thus bypassing Wayland's compositor anyway.
nwah
Posts: 45
Joined: 21 Nov 2013, 07:40

Re: Wayland Issues

Post by nwah »

Found out that it actually works in wayland as long as I set anti-aliasing to zero. Does anyone know why anti-aliasing is causing the GLX issues?

Wayland is not playable yet, in KWin. There are some remaining relative mouse issues. Those issues are supposed to have been fixed in SDL and KWin, but it appears not quite yet.

And, as a side note, when I take a look at CMakeLists, it appears that -DOPENGL_ES=true doesn't do anything, but it does exist.

Framerate is unchanged, compared to using X11
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Wayland Issues

Post by psi29a »

nwah wrote:And, as a side note, when I take a look at CMakeLists, it appears that -DOPENGL_ES=true doesn't do anything, but it does exist.
As I said in a previous post, it was only necessary for Android (certain params/flags are set) and obviously this is a misleading cmake flag. ;)

So can you say what works? What combination of black magic to get OpenMW to run with wayland? Was normal GL enough in combination with SDL2 that was compiled for wayland support?
nwah
Posts: 45
Joined: 21 Nov 2013, 07:40

Re: Wayland Issues

Post by nwah »

Nice, I just found that the mouse issues are ok if I execute the game with this command

Code: Select all

SDL_VIDEODRIVER=wayland openmw
As long as anti-aliasing is set to zero, I think if you run Arch linux, all the standard packages allow it to run on wayland just fine, without any special config options. Simply because Arch linux tends to be quite bleeding edge. You could also use the pre-built openmw package as well.

I should note that I'm running on AMD integrated graphics with the open source drivers.

Because I'm running multi-monitor, I have compiled KWin from git to eliminate some horrible glitches that only happen in multi-monitor setups. And I'm running OpenMW from git because I'm used to it.
Post Reply