L-as / waymonad

A wayland compositor based on ideas from and inspired by xmonad
https://matrix.to/#/#waymonad:matrix.org
GNU Lesser General Public License v2.1
90 stars 7 forks source link

Running from VT #5

Open willat8 opened 3 years ago

willat8 commented 3 years ago

I have freshly installed minimal NixOS and built waymonad as per the README. Trying to run directly from a virtual terminal I get

Loading default config 
Opened on socket: wayland-0

00:00:00.003 [backend/wayland/backend.c:383] Creating wayland backend
00:00:00.083 (backend/wayland/backend.c:401] Could not connect to remote display: No such file or directory

It works fine when running from another wayland compositor.

Running from VT works ok with Ongy's waymonad, I will build some older versions to find when it started failing.

Thanks for your work on this.

willat8 commented 2 years ago

I ended up trying to use WLR_BACKENDS=drm cabal run to try my luck in skipping the wayland backend autocreate.

Added this to my /etc/nixos/configuration.nix

hardware.opengl.enable = true;

And enabled DRM debugging. Now the VT freezes and I have to force shutdown with the power button. Attached DRM debug log.

willat8 commented 2 years ago

Not a lot of progress on this one unfortunately.

Have noticed that running with

WLR_BACKENDS=libinput,drm cabal run

Is better since it allows switching to another VT (using Ctrl-Alt-F2) after VT1 freezes on launch.

Switching from VT2 back to VT1 leads to a completely black screen which still accepts keyboard input. I can do Win-Enter then check that the terminal emulator process is running via ps on VT2. Still nothing is displayed at all on VT1 but it leads me to think the compositor is running.

I've also had problems building earlier commits so trying to find the commit where this broke is pretty difficult.

willat8 commented 2 years ago

Removing these lines:

https://github.com/L-as/waymonad/blob/ba576b4cb325a0b69e036efd8733c75a8cd2c49f/src/Waymonad/Start.hs#L174-L179

and renaming usage of _WAYLAND_DISPLAY to some other name (I used __WAYLAND_DISPLAY) makes the wlroots backend autocreate attempt a libinput + drm backend when running from a VT.

The same drm problem still exists though.

willat8 commented 2 years ago

Everything is working for me at 49ba28f. Something in the bump from wlroots 0.7.1 to 0.9.1 has broken.

Progress on getting commit 9d27132 working:

Adding a liftIO $ commitOutput (outputRoots output) at line 295 https://github.com/L-as/waymonad/blob/9d2713253f2330078a186a93259d2c9c8621c58a/src/Waymonad/Output.hs#L294-L295

Changing unsafe to safe at https://github.com/L-as/waymonad/blob/9d2713253f2330078a186a93259d2c9c8621c58a/hsroots/src/Graphics/Wayland/WlRoots/Output.hsc#L132

willat8 commented 2 years ago

Ok this is kind of working now. All changes I had to make:

https://github.com/willat8/waymonad/compare/ba576b4cb325a0b69e036efd8733c75a8cd2c49f..935a8e3ef2dc6aca82a4536eab36948cadc504ef

The setOutMode workaround is really dodgy, need to figure out what's going on there more.

Probably also needs another commitOutput in some of the DPMS stuff to make VT switches smoother.

Also had to sync my system nixpkgs to the specific version used in https://github.com/L-as/waymonad/blob/master/sources.nix.

But perhaps just pinning mesa would be enough. Will experiment with that.

The good news is that EGL is working a lot better here vs Ongy's waymonad.