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
19.8k stars 842 forks source link

Gamescope in hyprland keeps changing refresh rates constantly #7531

Closed zeptic99 closed 3 weeks ago

zeptic99 commented 1 month ago

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 9a09eac79b85c846e3a865a9078a3f8ff65a9259 (props: bump version to 0.42.0). Date: Wed Aug 7 19:17:10 2024 Tag: v0.42.0, commits: 5069 flags: (if any) System Information: System name: Linux Node name: ZeTieX Release: 6.10.6-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Mon, 19 Aug 2024 17:02:39 +0000 GPU information: 07:00.0 VGA compatible controller [0300]: Intel Corporation DG2 [Arc A380] [8086:56a5] (rev 05) (prog-if 00 [VGA controller]) 0d:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA102 [GeForce RTX 3080] [10de:2206] (rev a1) (prog-if 00 [VGA controller]) NVRM version: NVIDIA UNIX x86_64 Kernel Module 560.35.03 Fri Aug 16 21:39:15 UTC 2024 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/zeptic/.config/hypr/hyprland.conf: Read Succeeded env = WLR_DRM_DEVICES,$HOME/.config/hypr/card monitor=DP-2,1920x1080@240,auto,auto monitor=DP-3,3840x2160@60,auto,auto workspace = 1, monitor:DP-2 workspace = 2, monitor:DP-2 workspace = 3, monitor:DP-2 workspace = 4, monitor:DP-2 workspace = 11, monitor:DP-3 workspace = 12, monitor:DP-3 workspace = 13, monitor:DP-3 # unscale XWayland xwayland { force_zero_scaling = true } # toolkit-specific scale env = GDK_SCALE,1 env = XCURSOR_SIZE,32 ################### ### MY PROGRAMS ### ################### $terminal = alacritty $fileManager = dolphin $menu = rofi -modi drun -show drun -show-icons -width 22 -no-click-to-exit ################# ### AUTOSTART ### ################# exec-once = waybar & sunshine #exec-once = hyprpm reload -n exec-once = [workspace 2 silent] alacritty -e nvim exec-once = [workspace 1 silent] alacritty -e bash -c "fastfetch && zsh" exec-once = [workspace 3 silent] firefox exec-once = sleep 0.1 && hyprctl dispatch workspace 3 && hyprctl dispatch workspace 11 && hyprctl dispatch workspace 2 exec-once = hyprpaper ############################# ### ENVIRONMENT VARIABLES ### ############################# env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 ##################### ### LOOK AND FEEL ### ##################### general { gaps_in = 0 gaps_out = 0 border_size = 1 # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = false # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false layout = dwindle } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 0 # Change transparency of focused and unfocused windows active_opacity = 1.0 inactive_opacity = 1.0 drop_shadow = true shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = true size = 3 passes = 1 vibrancy = 0.1696 } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = false # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more #master { # new_is_master = true #} # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. force_no_accel = true touchpad { natural_scroll = false } } # https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { workspace_swipe = false } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device { name = epic-mouse-v1 sensitivity = -0.5 } #################### ### KEYBINDINGSS ### #################### # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, exec, $terminal bind = $mainMod, C, killactive, bind = $mainMod, M, exit, #bind = $mainMod, E, exec, $fileManager bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $menu #bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, E, exec, python /home/zeptic/rofi-lutris/rofi-lutris bind = CTRL ALT, S, exec, sh /home/zeptic/zeptittyconf/vimAnywhere-hyprland/copyToClipboardHook.sh bind = CTRL ALT, V, exec, sh /home/zeptic/zeptittyconf/vimAnywhere-hyprland/run.sh # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod, A, workspace, 1 bind = $mainMod, S, workspace, 2 bind = $mainMod, T, workspace, 3 bind = $mainMod, D, workspace, 4 bind = $mainMod, W, workspace, 11 bind = $mainMod, F, workspace, 12 bind = $mainMod, P, workspace, 13 bind = $mainMod, G, exec, grim -g "$(slurp -d)" - | wl-copy bind = $mainMod, O, exec, [workspace 4] alacritty -e sh /home/zeptic/zeptittyconf/.dotfiles/.desktopScripts/startGamescope.sh bind = $mainMod, I, exec, [workspace 11] alacritty -e sh steam bind = $mainMod SHIFT, R, pin # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, A, movetoworkspace, 1 bind = $mainMod SHIFT, S, movetoworkspace, 2 bind = $mainMod SHIFT, T, movetoworkspace, 3 bind = $mainMod SHIFT, D, movetoworkspace, 4 bind = $mainMod SHIFT, W, movetoworkspace, 11 bind = $mainMod SHIFT, F, movetoworkspace, 12 bind = $mainMod SHIFT, P, movetoworkspace, 13 # Example special workspace (scratchpad) #bind = $mainMod, S, togglespecialworkspace, magic #bind = $mainMod SHIFT, S, movetoworkspace, special:magic # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow ############################## ### WINDOWS AND WORKSPACES ### ############################## # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ #windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. ======Config-End======== ```

Description

This issue persists on wayland (hyprland) and when two of my monitors, of different refresh rates are connected. Gamescope seems to be confused as to what refresh rate it should be running at, resulting in constant changing of the refresh rate, causing noticeable stutters in game. This happens both in native and proton games. When I disconnect my second monitor, that is the 60hz monitor, the issue is resolved. However, this is not a viable fix for me as I do indeed, enjoy using both of my monitors.

This issue does not exist in X11. However, I have spent countless hours configuring hyprland to my liking, and enjoy using it a lot. I do not want to switch back to X11.

Below provided are console logs, and the command I use to run gamescope.

Console logs:

[gamescope] [Info]  xdg_backend: Changed refresh to: 239.761hz
[gamescope] [Warn]  xwm: got the same buffer committed twice, ignoring.
[gamescope] [Info]  xdg_backend: Changed refresh to: 60.000hz
[gamescope] [Info]  xdg_backend: Changed refresh to: 239.761hz
[gamescope] [Info]  xdg_backend: Changed refresh to: 60.000hz
[gamescope] [Info]  xdg_backend: Changed refresh to: 239.761hz
[gamescope] [Info]  xdg_backend: Changed refresh to: 60.000hz
[gamescope] [Info]  xdg_backend: Changed refresh to: 239.761hz
[gamescope] [Info]  xdg_backend: Changed refresh to: 60.000hz
[gamescope] [Info]  xdg_backend: Changed refresh to: 239.761hz

Gamescope launch command:

MANGOHUD_CONFIGFILE=$HOME/.config/MangoHud/MangoHud.conf vblank_mode=0 ENABLE_GAMESCOPE_WSI=1 WAYLAND_DISPLAY=wayland-1 gamescope -O DP-1 --prefer-vk-device 8086:56a5 -W 1920 -H 1080 -h 1080 -w 1920 -f --force-grab-cursor --mangoapp

How to reproduce

Have two monitors of varying refresh rates connected.

Crash reports, logs, images, videos

No response

vaxerski commented 1 month ago

is this a regression? can you test 0.39.1?

Also doesnt gamescope have a flag to set the refresh rate

zeptic99 commented 1 month ago

is this a regression? can you test 0.39.1?

Sure, I will test it on that version and get back to you.

Also doesnt gamescope have a flag to set the refresh rate

Although it is missing from the command I have provided, I have tried using it. It is ineffective.

zeptic99 commented 4 weeks ago

Hello, I was unable to downgrade to version 39.1, since doing so involves downgrading all its dependencies, and all other packages that depend on those dependencies. I was unable to find a suitable way to do this on the internet.

However, I came across this comment on my help post in Reddit:

This means Hyprland's presentation time implementation is broken and reports presentation on both displays - so gamescope switches back and forth. It's supposed to only report presentation on one display at a time

Do you think this could be the issue?

In the meantime, I will continue to see if I can figure out a way to get version 39.1 installed (which just so happens the be the version that is just one below the version that I started my hyprland journey with, that being version 40.)

vaxerski commented 4 weeks ago

uhh could be yeah, can you post WAYLAND_DISPLAY=1 logs from gamescope?

zeptic99 commented 4 weeks ago

Do you mean, WAYLAND_DISPLAY=wayland-1, like I have in my prefix? Because WAYLAND_DISPLAY=1 gives me:

❯ sh startGamescope.sh
[gamescope] [Info]  console: gamescope version 3.14.29
Failed to connect to wayland socket: 1.

As for the former, the logs when running "Counter-Strike 2" with gamescope are attached below. alacritty_output1.txt

vaxerski commented 4 weeks ago

err, WAYLAND_DEBUG, was I drunk?

vaxerski commented 3 weeks ago

can you try latest git?

zeptic99 commented 3 weeks ago

Holy *** ****, you did it. You're the Da Vinci of our time—an absolute genius. 🐐

CS2 also launches instantly now, like right after clicking "play" on steam. Dk if it was the recent cs update (i doubt) or your fix. It used to take a solid 5/10 seconds of waiting before.

Unrelated however, I still get:

[gamescope] [Warn]  xwm: got the same buffer committed twice, ignoring.

It starts spamming as soon as I load up a map. Any idea what that might be about? I also get this on other games.

I thank you for your dedication and brilliance

vaxerski commented 3 weeks ago

[gamescope] [Warn] xwm: got the same buffer committed twice, ignoring.

Looks like a log from what an app inside gamescope does to gamescope, shouldn't relate to us.