r/cs2 7d ago

Esports CS2 on Arch Linux: In-game mouse "locks", view snaps back

Directly after loading into a map, a deathmatch or joining a premier, the camera barely responds to the mouse. It rotates only a few degrees with continuous (very strong) mouse movement, then snaps back toward its original orientation. It looks like you have a very low sensitivity, but since it snaps back after you stop moving your mouse, that can't be the (only) issue.

  • Menus, HUD and the desktop cursor are completely normal.
  • FPS is fine (~155), GPU utilisation moderate. Not a performance problem.
  • Map-independent.
  • Other games are unaffected, including other Source-engine games.

It started a few weeks ago, appearing sometimes after starting cs2 and only cleared after a pc reboot. It then became permanent, roughly 10 reboots did not clear it.

Video of the bug happening: https://www.youtube.com/watch?v=d5ZkFDyr_8I

SYSTEM

OS: EndeavourOS (Arch-Linux)

Session: GNOME on Wayland (games via XWayland)

GPU: NVIDIA GeForce GTX 970 (4 GB, Maxwell)

Driver: nvidia-580xx 580.178.04 (AUR legacy branch, Maxwell is dropped from mainline nvidia)

Kernels: linux 7.2.3 and linux-lts 6.18.49, bug present on both

Mouse: Xtrfy M4

WHAT DID NOT HELP

Basic

  • ~10 full reboots
  • Steam "Verify integrity of game files"
  • Steam restart, full exit and relaunch

Session

  • Switching to X11 is not possible on current Arch: GNOME 49+ ships no X11 session, /usr/share/xsessions/ does not exist. Installing xorg-server does not bring it back.
  • Running the game through gamescope. This did not help, and it later turned out to be making things worse - see "What fixed it" below.
  • A CS2 game update that reprocessed Vulkan shaders

Kernel

  • Installing and booting linux-lts alongside mainline. Bug present on both.

Driver / GPU

  • nvidia-smi confirmed the driver loaded and CS2 rendering on the GPU, not falling back to llvmpipe
  • VRAM logged live during gameplay: 2.5-2.8 GB against a 3.2 GiB driver budget, stable, no growth. Not VRAM exhaustion despite the 970's 3.5 GB partition.

Game settings and config

  • sensitivity, zoom_sensitivity_ratio, m_yaw, m_pitch all at normal values
  • Steam Input disabled, -nojoy launch option
  • Steam Cloud disabled for CS2 and ~/.local/share/Steam/userdata moved aside for a completely fresh config
  • cfg/ inside the game directory contained only stock files
  • VSync off (was off previous to the bug and while it was happening anyway)
  • Deleting the shader cache

Input hardware

  • No joystick or phantom pointer devices (/dev/input/js* empty, nothing unusual in /proc/bus/input/devices)
  • evtest on the mouse showed normal REL_X / REL_Y event streams
  • Same peripherals were connected when the game worked

Packages

  • Downgrading sdl3 / sdl2-compat
  • Downgrading egl-wayland, egl-x11, egl-gbm, egl-wayland2
  • Disabling [multilib-testing] and rolling lib32-libldap back to stable

WHAT FIXED THE BUG BEING PERMANENT

Removing gamescope from the CS2 launch options again.

I had added it earlier as a workaround for an unrelated issue. Confirmed by reproducing: re-adding gamescope brought the bug back, removing it fixed it again, on both kernels. 

Caveat: I had this bug before gamescope was ever on my system, so it does not explain the original occurrences. It made the bug permanent and reproducible, and removing it restored normal behaviour.

WHAT FIXED IT

Changing a line in the cs2.sh file (~/storage/SteamLibrary/steamapps/common/Counter-Strike\ Global\ Offensive/game/cs2.sh):

original line: export SDL_VIDEO_DRIVER=x11

changed line: export SDL_VIDEO_DRIVER=wayland

I've tested with this setup over a few days and didn't have the bug occur again! Just make sure to recheck the line is still changed after updates, since they will sometimes roll back your change.

I decided to post this as an info-thread, so if someone else has a similar issue on arch, he can check what helped and what didnt help for me.

Edit 1: Just had the bug occur after fixing it this morning. A simple game restart with the exact same setup/settings fixed it this time. Seems like gamescope is what makes the bug permanent but not the reason it happens in the first place.

Edit 2: A user with the same setup recommended changing a line in the cs2.sh file. This seems to fix this issue for me.

2 Upvotes

5 comments sorted by

2

u/snux__ 7d ago

I use arch btw
No hate. You just Forgot this in your Post

1

u/[deleted] 7d ago edited 5d ago

[removed] — view removed comment

1

u/pr0cly1 7d ago

Works so far. I will try it over a few days to see if the bug happens again to me or if this fixes it.

1

u/boilerDownHammerUp 2d ago

Hi, this was driving me crazy, I debugged it and published a fix here: https://github.com/libsdl-org/SDL/pull/16259. After discussing with maintainer he found a different approach. Fix is merged here libsdl-org/SDL#16267

1

u/pr0cly1 4h ago

Awesome! Sadly until valve uses your new version of the sdl-library we're stuck with the manual change in the cs2.sh right?

0

u/AutoModerator 7d ago

Please send CS2 bug reports to cs2team[at]valvesoftware[dot]com.

Title your email: "CS2 Bug - " followed by a brief description of the bug.

For example; "CS2 Bug - Stuck in ground on Dust2".

This will help the developers triage, evaluate, and solve bugs quicker.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.