Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse stuttering in games #8670

Open
1 task done
Noiidor opened this issue Dec 7, 2024 · 18 comments
Open
1 task done

Mouse stuttering in games #8670

Noiidor opened this issue Dec 7, 2024 · 18 comments
Labels
bug Something isn't working

Comments

@Noiidor
Copy link

Noiidor commented Dec 7, 2024

Already reported ? *

  • I have searched the existing open and closed issues.

Regression?

No

System Info and Version

System/Version info
Hyprland 0.45.2 built from branch v0.45.2-b at commit 12f9a0d0b93f691d4d9923716557154d74777b0a  ([gha] Nix: update inputs).
Date: 2024-11-19
Tag: v0.45.2, commits: 12f9a0d0b93f691d4d9923716557154d74777b0a
built against aquamarine 0.4.4


flags set:
debug


System Information:
System name: Linux
Node name: nixos
Release: 6.6.63
Version: #1-NixOS SMP PREEMPT_DYNAMIC Fri Nov 22 14:38:37 UTC 2024


GPU information: 
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] [1002:1638] (rev c5) (prog-if 00 [VGA controller])


os-release: ANSI_COLOR="1;34"
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="24.11.20241203.b681065"
CPE_NAME="cpe:/o:nixos:nixos:24.11"
DEFAULT_HOSTNAME=nixos
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
ID_LIKE=""
IMAGE_ID=""
IMAGE_VERSION=""
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 24.11 (Vicuna)"
SUPPORT_END="2025-06-30"
SUPPORT_URL="https://nixos.org/community.html"
VARIANT=""
VARIANT_ID=""
VENDOR_NAME=NixOS
VENDOR_URL="https://nixos.org/"
VERSION="24.11 (Vicuna)"
VERSION_CODENAME=vicuna
VERSION_ID="24.11"


plugins:

======Config-Start======


Config File: /home/noi/.config/hypr/hyprland.conf: Read Succeeded

# #######################################################################################
# AUTOGENERATED HYPR CONFIG.
# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
# #######################################################################################

# This is an example Hyprland config file.
# Refer to the wiki for more information.
# https://wiki.hyprland.org/Configuring/Configuring-Hyprland/

# Please note not all available settings / options are set here.
# For a full list, see the wiki

# You can split this configuration into multiple files
# Create your files separately and then link them to this file like this:
# source = ~/.config/hypr/myColors.conf


################
### MONITORS ###
################

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1


###################
### MY PROGRAMS ###
###################

# See https://wiki.hyprland.org/Configuring/Keywords/

# Set programs that you use
$terminal = kitty
$fileManager = nautilus
$menu = rofi -show drun -show-icons


#################
### AUTOSTART ###
#################

# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:

# exec-once = $terminal
# exec-once = nm-applet &
exec-once = waybar &
exec-once = swww-daemon && swww img ~/wallpaper.png &


#############################
### ENVIRONMENT VARIABLES ###
#############################

# See https://wiki.hyprland.org/Configuring/Environment-variables/

env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24


#####################
### LOOK AND FEEL ###
#####################

# Refer to https://wiki.hyprland.org/Configuring/Variables/

# https://wiki.hyprland.org/Configuring/Variables/#general
general { 
    gaps_in = 0
    gaps_out = 0

    border_size = 0

    # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
    # col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.active_border = rgba(f92672aa)
    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 = 10

    # Change transparency of focused and unfocused windows
    active_opacity = 1.0
    inactive_opacity = 0.98

    # 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 = true

    # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = myBezier, 0.2, 0.9, 0.1, 1.05
    bezier = myBezier2, 0.2, 0.9, 0.1, 1
    bezier = easeInOut, 0.4, 0, 0.5, 0.9
    bezier = easeOut, 0, 0.45, 0.5, 1
    bezier = bezQuick, 0, 1, 0, 1
    bezier = bezDisabled, 1, 1, 1, 1
    bezier = bezLinear, 0, 0, 1, 1

    # animation = disabled, 1, 10, bezDisabled
    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, 4, myBezier2
}

# 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_status = master
}

# 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. :(
    render_unfocused_fps = 60
    initial_workspace_tracking = 2
    vrr = 2
}

cursor {
    no_hardware_cursors = true
    # allow_dumb_copy = 1
    zoom_factor = 1.0 # may be used in future to bind mouse zoom
    no_break_fs_vrr = true
}


#############
### INPUT ###
#############

# https://wiki.hyprland.org/Configuring/Variables/#input
input {
    kb_layout = us,ru
    kb_variant =
    kb_model =
    kb_options = grp:alt_shift_toggle
    kb_rules =

    repeat_delay = 200
    repeat_rate = 25

    follow_mouse = 1

    accel_profile = flat
    scroll_factor = 0.5
    emulate_discrete_scroll = 1
 
    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.

    touchpad {
        natural_scroll = true
    }
}

# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
    workspace_swipe = false
}

binds {
    scroll_event_delay = 0
}

render {
    direct_scanout = 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
}

debug {
    disable_logs = false
}


####################
### 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, F, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, E, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, L, exec, hyprlock
bind = $mainMod, R, exec, pkill waybar && waybar &
bind = $mainMod, RETURN, fullscreen 

# 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, 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, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# 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

# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod ALT, S, movetoworkspace, special:magic
# bind = $mainMod SHIFT, S, movetoworkspace, e+0

# 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


bind = $mainMod SHIFT, S, exec, hyprshot -m region --clipboard-only


##############################
### 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.
windowrulev2 = bordersize 1, floating:1 # Enables borders only for floating windows

# Scratch pad window

# Volume control
windowrulev2 = float, class:(pavucontrol)
windowrulev2 = size 35% 50%, class:(pavucontrol)
windowrulev2 = move 64.5% 4%, class:(pavucontrol)
windowrulev2 = animation slide, class:(pavucontrol)

# TG
windowrulev2 = noanim, title:(Media viewer)
windowrulev2 = float, title:(Media viewer)

# Media
windowrulev2 = float, class:(mpv)
windowrulev2 = float, class:(imv)

# Layer rules
layerrule = blur, waybar

# Games
# windowrulev2 = stayfocused, class:(Loading...)
# windowrulev2 = renderunfocused, class:(War Thunder)
windowrulev2 = bordersize 5, class:(War Thunder)


======Config-End========

Description

After updating from 0.41.2 to 0.45.2, when im playing games, game starts lagging and flickering on mouse movement.
Looks exactly what "no_hardware_cursors" should fix, but this option does not fix it for me. KDE works fine, so its definitely a Hyprland issue.
NixOS, AMD CPU and integrated GPU.

How to reproduce

Start a game, move mouse, game stuttering. Looks like im only one who got this issue even with "no_hardware_cursors" enabled.

Crash reports, logs, images, videos

No response

@Noiidor Noiidor added the bug Something isn't working label Dec 7, 2024
@Noiidor
Copy link
Author

Noiidor commented Dec 7, 2024

btw KDE was also wayland, so its not a wayland issue, i suppose

@vaxerski
Copy link
Member

vaxerski commented Dec 8, 2024

that's a .... huge jump. Bisect please.

@Noiidor
Copy link
Author

Noiidor commented Dec 8, 2024

that's a .... huge jump. Bisect please.

Yep, updated from 24.05 to 24.11 NixOS stable. I will try to find some time and bisect today.

@Noiidor
Copy link
Author

Noiidor commented Dec 8, 2024

that's a .... huge jump. Bisect please.

Tried bisecting, nix build fails. Any idea why? I see 1 error about subdirectory, but not sure what to do about it.

hypr-nix-compile.log

@fufexan
Copy link
Member

fufexan commented Dec 8, 2024

Depending how old of a commit you're trying to build, you may need to change the hyprland url to git+https://github.com/hyprwm/hyprland?submodules=1

You can also just build all commits with that URL, it should work.

@Noiidor
Copy link
Author

Noiidor commented Dec 8, 2024

Depending how old of a commit you're trying to build, you may need to change the hyprland url to git+https://github.com/hyprwm/hyprland?submodules=1

You can also just build all commits with that URL, it should work.

Where exactly should i change hyprland url? Sorry for a dumb question, never compiled hyprland before.

@fufexan
Copy link
Member

fufexan commented Dec 8, 2024

How are you testing now? Do you use the flake package of Hyprland or the one from Nixpkgs?

@Noiidor
Copy link
Author

Noiidor commented Dec 8, 2024

How are you testing now? Do you use the flake package of Hyprland or the one from Nixpkgs?

I followed the guide in Hyprland wiki. Cloned Hyprland repo, started bisecting, then nix build. So im trying to build it from source, isnt it what i suppose to do?
By the way, i tried to rollback input for Hyprland(from Nixpkgs) in my personal flake, but it fails at startup.

@fufexan
Copy link
Member

fufexan commented Dec 8, 2024

yeah, mismatching hyprland and nixpkgs is not fun.

I followed the guide in Hyprland wiki. Cloned Hyprland repo, started bisecting, then nix build.

Ah, right. Then you need to do nix build '.?submodules=1'

@Noiidor
Copy link
Author

Noiidor commented Dec 8, 2024

nix build '.?submodules=1'

Well...same issue
hypr-nix-compile.log

@fufexan
Copy link
Member

fufexan commented Dec 8, 2024

Then it means you didn't also fetch submodules when you cloned the repo.

Do git submodule update --init.

@Noiidor
Copy link
Author

Noiidor commented Dec 8, 2024

git submodule update --init

Also doesnt change anything :(
Now that im thinking of it, it says that subdirectory does not exists, which is very weird, because such dir is clearly exists in repo. Tried to specify absolute path in CMake, instead of relative, but it also "not exists".

@Noiidor
Copy link
Author

Noiidor commented Dec 9, 2024

UPDATE: disabling VSync in-game fixes mouse stuttering, but performance without VSync is not good in Hyprland(in every game this is the case for me). Launching game using gamescope somewhat fixes performance issues, but graphics is slightly worse now.
Im not closing the issue, bug is still present and i cannot bisect, maybe someone will try to find the reason for this bug.

@rabaimorp
Copy link

#8588 and #6914 might have something to do with this, I noticed weird performance issues in those cases as well compared to kde wayland

@moosey-moose
Copy link

UPDATE: disabling VSync in-game fixes mouse stuttering, but performance without VSync is not good in Hyprland(in every game this is the case for me). Launching game using gamescope somewhat fixes performance issues, but graphics is slightly worse now. Im not closing the issue, bug is still present and i cannot bisect, maybe someone will try to find the reason for this bug.

Use Gamescope (https://wiki.archlinux.org/title/Gamescope), it will make a huge difference. I had the same issue when getting started on Hyprland/Arch. Also if you are running through Steam, forcing proton compatibility helps regardless of the game having Linux support, at least IME. Using Gamescope eliminated any mouse stuttering, or weird control issues like game camera spinning wildly.

@Cha1N1
Copy link

Cha1N1 commented Jan 12, 2025

updated to latest commit experience the same kind of mouse stuttering and it looks awful

@bk304
Copy link

bk304 commented Feb 2, 2025

Launch games natively in Wayland fix the problem.
This is not a good solution, but it indicates that the problem is between Hyprland and XWayland, since the wlroots dependency was removed.

@moosey-moose
Copy link

Launch games natively in Wayland fix the problem. This is not a good solution, but it indicates that the problem is between Hyprland and XWayland, since the wlroots dependency was removed.

Ya after switching to SwayWM I am able to play games natively without gamescope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants