hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.44k stars 897 forks source link

X server no longer running for xwayland apps after aquamarine merge #6949

Closed calebaden closed 3 weeks ago

calebaden commented 3 months ago

Regression?

Yes

System Info and Version

System/Version info ```sh Hyprland, built from branch main at commit cf373d315e9fb060576ed407bd5ee2dfb8a6d2e2 (touch: add touch swipe invert config (6940)). Date: Sun Jul 21 21:59:09 2024 Tag: v0.41.2-50-gcf373d31, commits: 4936 flags: (if any) System Information: System name: Linux Node name: arch Release: 6.9.10-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Thu, 18 Jul 2024 18:06:13 +0000 GPU information: 2d:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 23 [Radeon RX 6600/6600 XT/6600M] [1002:73ff] (rev c1) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ======Config-Start====== Config File: /home/caleb/.config/hypr/hyprland.conf: Read Succeeded # See https://wiki.hyprlaad.org/Configuring/Monitors/ monitor = DP-1,highrr,0x0,1 workspace = 1, monitor:DP-1, default:true workspace = 2, monitor:DP-1 monitor = DP-2,preferred,2560x0,1.25 workspace = 3, monitor:DP-2, default:true workspace = 4, monitor:DP-2 # Rotate pen display monitor = DP-2,transform,3 #env = AQ_NO_ATOMIC,1 #env = WLR_DRM_NO_ATOMIC,1 env = HYPRCURSOR_THEME,volantes env = HYPRCURSOR_SIZE,24 # See https://wiki.hyprland.org/Configuring/Keywords/ for more # Execute your favorite apps at launch exec-once = /usr/lib/polkit-kde-authentication-agent-1 & chbg & xrandr --output DP-1 --primary & nwg-drawer -r -c 8 -is 128 -nofs -nocats # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf source=~/.local/share/macchiato.conf debug:disable_logs=false # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = us kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 1 touchpad { natural_scroll = no } sensitivity = 0 # -1.0 - 1.0, 0 means no modification. accel_profile = custom 2 0.0 0.6 1.5 2.9 5 8 #force_no_accel = true } general { # See https://wiki.hyprland.org/Configuring/Variables/ for more gaps_in = 4 gaps_out = 8 border_size = 0 no_border_on_floating = true col.active_border = $surface2 rgba(00000000) 90deg col.inactive_border = rgba(00000000) layout = dwindle allow_tearing = true } misc { vfr = true vrr = 1 disable_hyprland_logo = true } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 5 blur { enabled = true size = 5 passes = 2 new_optimizations = on } drop_shadow = true shadow_range = 10 shadow_render_power = 3 shadow_ignore_window = true col.shadow = $surface0 col.shadow_inactive = rgba(54,58,79,0) blurls = gtk-layer-shell } animations { enabled = yes # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = lilOvershoot, 0.1, 1, 0.1, 1.1 bezier = bigOvershoot, 0.1, 1, 0.1, 2 animation = windowsIn, 1, 2, lilOvershoot, slide animation = windowsOut, 1, 2, default, popin animation = windowsMove, 1, 1, default animation = layers, 1, 2, bigOvershoot, popin 80% animation = fadeIn, 1, 5, default animation = fadeOut, 1, 2, default animation = fadeShadow, 1, 2, bigOvershoot animation = fadeLayers, 1, 1, default animation = workspaces, 1, 1, default, slidevert } dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = yes # you probably want this no_gaps_when_only = 1 } master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = off } group { col.border_active = $surface2 $mantle 90deg col.border_locked_active = $surface2 $mantle 90deg col.border_inactive = $mantle col.border_locked_inactive = $mantle groupbar { height = 4 col.active = $mantle col.locked_active = $surface0 col.inactive = $surface0 col.locked_inactive = $surface0 render_titles = false } } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more #device:epic mouse V1 { # sensitivity = -0.5 #} # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more windowrulev2 = xray 1,class:^(foot)$ windowrulev2 = float,class:^(vrmonitor)$ windowrulev2 = suppressevent fullscreen,initialClass:^(steam)$ windowrulev2 = suppressevent fullscreen,title:^(Launcher)$ windowrulev2 = suppressevent fullscreen,title:^(Battle.net)$ # tile windowrulev2 = tile,title:^(Battle.net)$ windowrulev2 = tile,title:^(Launcher)$ # game space windowrulev2 = workspace 2,title:^(Steam)$ windowrulev2 = workspace 2,initialClass:^(steam_app_.*)$,initialTitle:^(.*)$ # side space windowrulev2 = workspace 3,initialClass:^(vesktop)$ # tablet space #windowrulev2 = workspace 4,class:^(krita)$ # special space windowrulev2 = workspace special silent,initialClass:^(steam_app_.*)$,initialTitle:^$ windowrulev2 = workspace special silent,initialClass:^(explorer.exe)$ windowrulev2 = workspace special silent,initialClass:^(krsdkexternal.exe)$ # keepass window rules windowrulev2 = size 850 560,class:^(org.keepassxc.KeePassXC)$ windowrulev2 = float,class:^(org.keepassxc.KeePassXC)$ windowrulev2 = center,class:^(org.keepassxc.KeePassXC)$ # authenticator window rules windowrulev2 = size 33% 36%,class:^(org.kde.polkit-kde-authentication-agent-1)$ windowrulev2 = float,class:^(org.kde.polkit-kde-authentication-agent-1)$ windowrulev2 = center,class:^(org.kde.polkit-kde-authentication-agent-1)$ # thunar popup windowrulev2 = float,title:^(File Operation Progress)(.*)$ windowrulev2 = float,title:^(Confirm to replace files)(.*)$ # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, killactive, bind = $mainMod, M, exit, bind = $mainMod, V, togglefloating, bind = $mainMod, S, togglesplit, # dwindle bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, W, fullscreen bind = $mainMod ALT, W, fullscreen, 2 bind = $mainMod, C, centerwindow, # exec bind = $mainMod, T, exec, foot bind = $mainMod ALT, T, exec, [float;size 580 580;center] foot bind = $mainMod, F, exec, foot ranger bind = $mainMod ALT, F, exec, thunar bind = $mainMod, R, exec, nwg-drawer -c 8 -is 128 -nofs -nocats bind = $mainMod, G, exec, hyprshot -m region --clipboard-only bind = $mainMod SHIFT, G, exec, hyprshot -m region bind = $mainMod ALT, G, exec, hyprshot -m window bind = $mainMod, Z, exec, ltr_recenter bind = $mainMod, B, exec, foot btop # group bind = $mainMod, E, togglegroup bind = $mainMod SHIFT, E, moveoutofgroup bind = $mainMod ALT, E, lockactivegroup, toggle bind = $mainMod ALT, mouse_down, changegroupactive, f bind = $mainMod ALT, mouse_up, changegroupactive, b # mpc controls bind = $mainMod, SPACE, exec, mpc toggle bind = $mainMod, period, exec, mpc next bind = $mainMod, comma, exec, mpc prev bind = $mainMod, equal, exec, mpc volume +10 bind = $mainMod, minus, exec, mpc volume -10 # mpv controls bind = $mainMod ALT, SPACE, exec, playerctl -p mpv toggle bind = $mainMod ALT, equal, exec, playerctl -p mpv volume 0.05+ bind = $mainMod ALT, minus, exec, playerctl -p mpv volume 0.05- # pass bind = $mainMod, F6, pass,^(discord)$ bind = $mainMod, F7, pass, ^(com\.obsproject\.Studio)$ # Move focus with mainMod + arrow keys bind = $mainMod, H, movefocus, l bind = $mainMod, L, movefocus, r bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, GRAVE, togglespecialworkspace # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, r-1 bind = $mainMod, mouse_up, workspace, r+1 bind = $mainMod, 0, focusmonitor, +1 bind = $mainMod, 9, movewindow, mon:+1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Move window to edge bind = $mainMod ALT, H, movewindow, l bind = $mainMod ALT, L, movewindow, r bind = $mainMod ALT, J, movewindow, d bind = $mainMod ALT, K, movewindow, u # Resize window bind = $mainMod SHIFT, H, resizeactive, -24 0 bind = $mainMod SHIFT, L, resizeactive, 24 0 bind = $mainMod SHIFT, J, resizeactive, 0 24 bind = $mainMod SHIFT, K, resizeactive, 0 -24 bind = $mainMod ALT, P, resizeactive, exact 794 272 bind = $mainMod ALT, O, resizeactive, exact 272 272 Config File: /home/caleb/.local/share/macchiato.conf: Read Succeeded $rosewater = 0xfff4dbd6 $flamingo = 0xfff0c6c6 $pink = 0xfff5bde6 $mauve = 0xffc6a0f6 $red = 0xffed8796 $maroon = 0xffee99a0 $peach = 0xfff5a97f $green = 0xffa6da95 $teal = 0xff8bd5ca $sky = 0xff91d7e3 $sapphire = 0xff7dc4e4 $blue = 0xff8aadf4 $lavender = 0xffb7bdf8 $text = 0xffcad3f5 $subtext1 = 0xffb8c0e0 $subtext0 = 0xffa5adcb $overlay2 = 0xff939ab7 $overlay1 = 0xff8087a2 $overlay0 = 0xff6e738d $surface2 = 0xff5b6078 $surface1 = 0xff494d64 $surface0 = 0xff363a4f $base = 0xff24273a $mantle = 0xff1e2030 $crust = 0xff181926 ======Config-End======== ```

Description

Using hyprland-git after the aquamarine merge causes the X server to no longer work. Trying to launch steam or launch a game through wine results in errors.

How to reproduce

Using hyprland with aquamarine, try to open any xwayland app.

Crash reports, logs, images, videos

Steam: aquamarine-x

Wine:

0150:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0150:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."'

Output of 'echo $DISPLAY': echo-$DISPLAY

vaxerski commented 3 months ago

surely doesn't happen to me... I assume xwayland crashes. Can you post a log?

leg7 commented 3 months ago

I'm having the same issues after upgrading my nixos flake. I can't tell if the issue is hyprland related or if some other package broke it.

calebaden commented 3 months ago

Sure, I think this is the right file. hyprland.log

vaxerski commented 3 months ago

xwayland shat itself.

Go to src/xwayland/Server.cpp (hl)

find line 302

add WAYLAND_DEBUG=1 to the beginning of the command and > /home/youruser/xwayland.log

compile and launch

pass the xwayland.log

vaxerski commented 3 months ago

fuck wrong issue number

vaxerski commented 3 months ago

was supposed to be 6698 my bad lol

calebaden commented 3 months ago

I may have found the issue. There is no /src/xwayland when installed through the AUR package hyprland-git

EDIT: nvm wrong folder, I'll keep trying to get the xwayland log for you

calebaden commented 3 months ago

Ok so the log file was created but is empty. This was what the edit looked like for me at line 302.

auto cmd = std::format("WAYLAND_DEBUG=1 Xwayland {} -rootless -core -listenfd {} -listenfd {} -displayfd {} -wm {} > /home/caleb/xwayland.log", displayName, xFDs[0], xFDs[1], notifyFD, xwmFDs[1]);

Is that right?

vaxerski commented 3 months ago

oh wait I am dumb, not > /path... but |& tee /path...

leg7 commented 3 months ago

@vaxerski I'm not sure if this log is useful but I've attached the log of me starting hyprland and trying to launch steam. I haven't recompiled Hyprland in debug mode or whatever because I'm on nixos.

The only interesting thing I see is at the start of the logfile /bin/sh: 1: Xwayland: not found

xwayland.log

leg7 commented 3 months ago

If I start hyprland in a nix-shell with the xwayland package everything works as expected :partying_face:.

fufexan commented 3 months ago

I haven't recompiled Hyprland in debug mode or whatever because I'm on nixos.

That's no excuse https://wiki.hyprland.org/Nix/Contributing-and-Debugging/#build-in-debug-mode

leg7 commented 3 months ago

I haven't recompiled Hyprland in debug mode or whatever because I'm on nixos.

That's no excuse https://wiki.hyprland.org/Nix/Contributing-and-Debugging/#build-in-debug-mode

Do you maintain the nix package for hyprland? I've been trying to see why having hyprland enabled doesn't automatically pull in xwayland anymore but my knowledge of nix is limited and I can't go much further than this.

fufexan commented 3 months ago

Checking nix-tree, xwayland is pulled image

Can you try this patch though?

diff --git a/nix/default.nix b/nix/default.nix
index 7775b729..3e4d7e20 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -170,6 +170,7 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
           binutils
           pciutils
           pkgconf
+          xwayland
         ]}
       ''}
     '';
leg7 commented 3 months ago

I have it enabled through home manager. I've seen that you made a PR to fix this recently.

Here's my current flake.lock

{
 ...
    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1720042825,
        "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "ref": "release-24.05",
        "repo": "home-manager",
        "type": "github"
      }
    },
 ...
    "nixpkgs-stable": {
      "locked": {
        "lastModified": 1721226092,
        "narHash": "sha256-UBvzVpo5sXSi2S/Av+t+Q+C2mhMIw/LBEZR+d6NMjws=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "c716603a63aca44f39bef1986c13402167450e0a",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-24.05",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-stable_2": {
      "locked": {
        "lastModified": 1710695816,
        "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "614b4613980a522ba49f0d194531beddbb7220d3",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-23.11",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-unstable": {
      "locked": {
        "lastModified": 1721138476,
        "narHash": "sha256-+W5eZOhhemLQxelojLxETfbFbc19NWawsXBlapYpqIA=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "ad0b5eed1b6031efaed382844806550c3dcb4206",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "pre-commit-hooks-nix": {
      "inputs": {
        "flake-compat": [
          "lanzaboote",
          "flake-compat"
        ],
        "gitignore": "gitignore",
        "nixpkgs": [
          "lanzaboote",
          "nixpkgs"
        ],
        "nixpkgs-stable": "nixpkgs-stable_2"
      },
      "locked": {
        "lastModified": 1717664902,
        "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=",
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1",
        "type": "github"
      },
      "original": {
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "disko": "disko",
        "emacs-overlay": "emacs-overlay",
        "home-manager": "home-manager",
        "impermanence": "impermanence",
        "lanzaboote": "lanzaboote",
        "nixos-hardware": "nixos-hardware",
        "nixpkgs": "nixpkgs",
        "nixpkgs-unstable": "nixpkgs-unstable"
      }
    },
    "rust-overlay": {
      "inputs": {
        "flake-utils": [
          "lanzaboote",
          "flake-utils"
        ],
        "nixpkgs": [
          "lanzaboote",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1718504420,
        "narHash": "sha256-F2HT/abCfr0CDpkvXwYCscJyD66XDTLMVfdrIMRp2ck=",
        "owner": "oxalica",
        "repo": "rust-overlay",
        "rev": "0043c3f92304823cc2c0a4354b0feaa61dfb4cd9",
        "type": "github"
      },
      "original": {
        "owner": "oxalica",
        "repo": "rust-overlay",
        "type": "github"
      }
    },
    "systems": {
      "locked": {
        "lastModified": 1681028828,
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
        "owner": "nix-systems",
        "repo": "default",
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default",
        "type": "github"
      }
    },
    "systems_2": {
      "locked": {
        "lastModified": 1681028828,
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
        "owner": "nix-systems",
        "repo": "default",
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

I would gladly try out your patch but I'm not sure where you want me to apply it and how. Should I clone and host my own nixpkgs and apply it on that?

fufexan commented 3 months ago

I'm assuming you already have Hyprland as a flake input (otherwise you wouldn't have aquamarine). The steps are:

  1. clone Hyprland
  2. git apply <<<$(wl-paste) (assuming you're gonna copy the patch)
  3. in your configuration flake, run nix flake lock --override-input hyprland <path/to/cloned/hyprland>
  4. rebuild
leg7 commented 3 months ago

I'm assuming you already have Hyprland as a flake input (otherwise you wouldn't have aquamarine). The steps are:

1. clone Hyprland

2. `git apply <<<$(wl-paste)` (assuming you're gonna copy the patch)

3. in your configuration flake, run `nix flake lock --override-input hyprland <path/to/cloned/hyprland>`

4. rebuild

I'm not using the Hyprland flake input. I'm just using the one included in home-manager/nixpkgs. Either way I can confirm with nix-tree like you did that my hyprland version doesn't pull in xwayland. I replied to this thread because I got the same issue as OP but I don't know what aquamarine is.

If you want I could try switching to the flake input but I suspect it that version would work just fine since it seems to be working for you.

calebaden commented 3 months ago

Sorry about the delay, it was midnight here. Here is the xwayland log. xwayland.log

calebaden commented 3 months ago

I disconnected my VR headsets HDMI cable and now xwayland works. Not sure why it would cause that, it wasn't happening before the aquamarine merge.

asiantuntija commented 2 months ago

I experience this also and removing VR headset fixed it. Any idea what's going on or do you need more logs perhaps?

vaxerski commented 2 months ago

likely something is wrong with our drm lease impl? Though I have no clue what as xwayland doesn't log anything useful. Perhaps ask xwayland devs?

gale-username commented 2 months ago

I see a merged pr and 2 of 3 issues, tagged, closed. Is this still a thing?

The issues were closed, because they're duplicates. There's a reply on the PR confirming it doesn't fix this issue.

moritzruth commented 2 months ago

Edit: Installing xorg-server-wayland (Void Linux) fixed the problem for me. I don't remember having to do this the last time I set up Hyprland on a new system, but maybe I just forgot. Original comment below.


If somebody finds a workaround, please tell me.

And I’m not sure if everybody else here is using a VR headset, so just to be clear: I am not using a VR headset but I’m also experiencing this issue.

podiki commented 1 month ago

I think there were/are perhaps 2 issues here. One might have been the simple case that on something like Nix/Guix, it can't start XWayland without knowing the full path (since both don't just populate e.g. /bin). Specifically, patching the path at https://github.com/hyprwm/Hyprland/blob/main/src/xwayland/Server.cpp#L306 So maybe this is what the Nix issues were related to (in a working Guix package we patch that command to point to XWayland binary directly). But I don't the details on the Nix side.

The other issue is that XWayland fails to start if a VR HMD is connected. Or, if you connect one it somehow crashes XWayland. Here is the Hyprland log when this happened for me, hope it helps: hyprland.log

Atemu commented 1 month ago

XWayland works just fine under Nix without an HMD attached, it's the second issue.

Although there is still a chance it's somehow related to Nix as I also use NixOS and can reproduce this bug.

I think it's far more likely to be connected to VR HMDs though as it's only reproducible with one plugged in (and you can reliably crash XWayland by plugging its display in).

vaxerski commented 1 month ago

yeah and I don't use VR at all so I can't debug this. XWayland also doesnt seem to log anything useful

Atemu commented 1 month ago

Perhaps its reproducible with a non-desktop dummy display too; that's the only thing that differentiates VR displays.

vaxerski commented 1 month ago

no, it's the drm-lease protocol, and I don't know if you can properly virtualize this

podiki commented 1 month ago

XWayland also starts if you configure Hyprland to disable the HMD, e.g. in my case monitor=DP-1,disable. In that case I could run an XWayland app, Steam and it didn't crash. Trying to run SteamVR hit #7776 (can't find direct display from Wayland). So, something about DRM leasing/how a display is enabled or not? What can we do to debug this?

Edit: In the log I shared before, you can see Hyprland see the display (HMD) plugged in, just after that is when XWayland crashes.

Atemu commented 3 weeks ago

Could the drm-lease protocol be disabled in the meantime so that we at least don't have to physically unplug the HMD for xwayland not to crash?

vaxerski commented 3 weeks ago

it would be better to just get it fixed probably. If you want to disable it, comment out zis line: https://github.com/hyprwm/Hyprland/blob/c3f7c9bbb52b9ad3d24ccfcc5c552ed16c9985a5/src/managers/ProtocolManager.cpp#L167

ikalco commented 3 weeks ago

@Atemu @podiki try this patch.txt no this patch.txt

podiki commented 3 weeks ago

@ikalco Thanks for the patch! I just tried it on top of the v0.44.1 release and I didn't get XWayland failing to run or crashing with the HMD plugged in (and not disabled in my config). So I think your patch might be the fix for this issue.

However, perhaps should be on #7776, now trying to run SteamVR hard crashes Hyprland dumping me to my login manager. The logs also disappear then or I don't know where they end up in such a crash. So I'm not sure what the issue is there, but this is a good step so far! Before your patch, I would have to set the HMD to disabled in my config so that XWayland would start/not crash, but that meant hitting #7776 as the display wasn't available to SteamVR (I think).

ikalco commented 3 weeks ago

can you give the debug stacktrace of the crash?

podiki commented 3 weeks ago

Well I'm not on systemd but I can build with debugging and see what I can do manually (attach gdb to running session, enable logging, get it to crash?). In the meantime, here is the crash log hyprlandCrashReport17957.txt Not sure if that helps much, but in the backtrace # 7, 8, 9, 1 at least gives where in Hyprland we were.

ikalco commented 3 weeks ago

ok i have 2 patches, 1 for aq and one for hl aq - patch.txt hl - patch.txt

if you don't want to apply aq patch it isn't necessary to test the fix, it just prevents a crash when destroying the lease

edit/ps (not important for ^): note for future debugging without a VR headset for DRMLease

podiki commented 3 weeks ago

@ikalco You are fast!

I applied both patches (on top of v0.44.1 for Hyprland and v0.4.2 for aquamarine) and SteamVR did start up and work! However, when I exited, Hyprland crashed again. Here is the crash log: hyprlandCrashReport1867.txt

Thanks for this! By the way, the link to kmscube hasn't been updated in over a year but lists an active upstream as https://gitlab.freedesktop.org/mesa/kmscube/ (maybe the one you linked is a fork with some changes?)

ikalco commented 3 weeks ago

@ikalco You are fast!

;)

I applied both patches (on top of v0.44.1 for Hyprland and v0.4.2 for aquamarine) and SteamVR did start up and work! However, when I exited, Hyprland crashed again. Here is the crash log: hyprlandCrashReport1867.txt

try this hl patch.txt and same aq patch

Thanks for this! By the way, the link to kmscube hasn't been updated in over a year but lists an active upstream as https://gitlab.freedesktop.org/mesa/kmscube/ (maybe the one you linked is a fork with some changes?)

the fork adds the drm-lease protocol into kmscube. its old but it works good enough lol

podiki commented 3 weeks ago

Thanks again! That works better but I get a crash on the second time starting up SteamVR. The first time it starts and exits cleanly, but trying to run it again crashes Hyprland. Here are two crash reports: hyprlandCrashReport26319.txt hyprlandCrashReport22651.txt

Although I think at this point the issue of no XWayland when a VR HMD is plugged in seems solved, but now a separate(?) issue with DRM leases and HMD I guess. Let me know if you need something else, happy to keep testing here.

ikalco commented 3 weeks ago

Although I think at this point the issue of no XWayland when a VR HMD is plugged in seems solved, but now a separate(?) issue with DRM leases and HMD I guess. Let me know if you need something else, happy to keep testing here.

it is a separate issue, just don't feel like making one rn so hopefully this patch should work 100% 🙏

hl - patch.txt aq - same

podiki commented 3 weeks ago

it is a separate issue, just don't feel like making one rn so hopefully this patch should work 100% 🙏

No worries, just in case anyone else got confused :) Though I guess tracked at #7776

Worked here! I tried SteamVR maybe 5 times in a row, no crashes. Excellent work @ikalco!

LimticRage commented 1 week ago

Still happening to me hyprland v0.44.1 and aquamarine v0.4.3 image when i connect my steam index, it kills krita too

podiki commented 1 week ago

@LimticRage #8116 which should fix this (based on my testing) is not yet in a released version of Hyprland (v0.44.1 is older). So you'll either have to wait or include the PR/patch above or build from git.

LimticRage commented 1 week ago

oh sorry... I saw DRM leasing fixed and I thought it was the fix, My bad