csgo-osx-linux
csgo-osx-linux copied to clipboard
CS2 as fullscreen always tries to launch secondary monitor, tries to use refresh rates of primary monitor
Your system information
- System information from steam (
Steam->Help->System Information) in a gist: https://gist.github.com/delbonis/2c303aa9eda54b691901f6c4c3e1c786 - Have you checked for system updates?: Yes
Please describe your issue in as much detail as possible:
I have a 165Hz monitor which is normally my primary (left) and a 60Hz monitor which is normally my secondary (right), both are 2560x1440. See Ubuntu displays configuration UI screenshot below.
CS2 seems to only want to start to start on the secondary monitor, regardless of which monitors are configured as which in Ubuntu, and then it only provides refresh rate options for the primary monitor. That is to say:
- 165Hz primary, 60Hz secondary: opens on 60Hz monitor, shows refresh rate settings of 165Hz monitor
- 60Hz primary, 165Hz secondary: opens on 165Hz monitor, shows refresh rate settings of 60Hz monitor
In either case, I can enter a game, but there's pretty noticeable latency between moving my mouse and the camera rotating. I'm not sure if that's on the input side or the display output side, I'm not sure how to test that.
I've tried swapping the sockets on my graphics card that the monitors are plugged into, rebooting, etc, behavior is unchanged. I thought it could be some issue with how Linux/Xorg enumerates the displays and swapping the physical inputs could change that but that doesn't seem to be the problem, but I may be wrong.
xrandr output (in first configuration listed above):
$ xrandr
Screen 0: minimum 320 x 200, current 5120 x 1440, maximum 16384 x 16384
DisplayPort-0 connected 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
2560x1440 59.95*+
1920x1200 59.88
1920x1080 60.00 60.00 50.00 59.94
1600x1200 60.00
1680x1050 59.95
1280x1024 75.02 60.02
1440x900 59.89
1366x768 60.00
1280x800 59.95
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 75.03 60.00
832x624 74.55
800x600 75.00 60.32 56.25
720x576 50.00
720x480 60.00 59.94
640x480 75.00 60.00 59.94
720x400 70.08
DisplayPort-1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
2560x1440 59.95 + 165.00* 144.00 120.00 99.95 84.98 23.97
1920x1200 59.95
1920x1080 59.95
1600x1200 59.95
1680x1050 59.95
1280x1024 59.95
1440x900 59.95
1280x800 59.95
1280x720 59.95
1024x768 60.00
800x600 60.32
640x480 60.00 59.94
HDMI-A-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
When unplugging the 60Hz monitor, the game does start on the 165Hz monitor and shows the appropriate refresh rates (up to 164Hz and some other weird ones, but it looks close enough), but it still renders underneath the GNOME window decoration (as below, notice the transparent left bar shows the game underneath it) even when in-game and still has the control latency issue.
Once, when trying to switch to borderless windowed mode in the two monitor configuration it started rapidly switching between my primary and secondary monitors. I ended up having to force reboot because my computer became unusable at that point, and added -fullscreen to be able to play it again. I also had a weird incident where it started as "fullscreen" but was 1920x1080 in the upper left of the primary monitor, I can't really figure out how to reproduce that. Trying to switch it to fullscreen again I had some weird pixel scaling issues that looked like it was rendering at 1920x1080 scaled up to the reported 2560x1440 until I restarted the game.
Ubuntu displays configuration:
Steps for reproducing this issue:
- Have two monitors, possibly needing different refresh rates.
- Use launch options
SDL_AUDIO_DRIVER=pipewire %command% -nojoy -vulkan -fullscreen. - Try to play CS2, in fullscreen. Using
-fullscreenor just the normal setting in the menu doesn't seem to make a difference. - It's weird, as described above.
I have not tried using Wayland yet, will update if it persists.
Wayland:
Weird refresh rate selection issue persists the same as under X. However, the input/control latency issue was gone and some weirdness associated with changing display formats seemingly fixed? Maybe I didn't mess with it long enough for the issues to appear.
However I was able to reproduce the fake fullscreen corner rendering thing.
- 165Hz as primary, 60Hz as secondary.
- Start game, which opens on secondary in fullscreen.
- Leave default 164Hz refresh rate as-is normal. Switch to widowed 1920x1080.
- Drag window to 165Hz primary monitor. The game can be played basically normally at the high refresh rate, albeit in the smaller window and with what being windowed entails.
- Switch to fullscreen 2560x1440, which, amazingly, fullscreens on the 165Hz monitor. I don't think there was the possible resolution scaling issue that I described above but the HUD looked kinda weird. I may have been imagining that.
- Close game.
- Restart game. It reports as being "fullscreen" at 1920x1080 in the upper left as below.
Update: After closing the game again and restarting it, it does the rapidly-switch-monitors thing that it did under X when trying to do borderless windowed and I can't seem to stop it. Although it's not really in danger of making my whole OS unstable anymore so I can force quit it through Steam normally.
Update 2: I can't reproduce this anymore, maybe I wrote down the steps differently than I actually did or the update changed. I've been playing windowed at the second-highest resolution option for now. I think there may still be a couple extra frames of latency somewhere in there that's leading to camera motion still feeling somewhat sluggish, but I don't have the tools to figure out if that's actually true.
Same problem here in Fedora 38 with Wayland and dual monitors. Without -fullscreen launch option it does this strange flicking between monitors thing. But if you are fast, you can time it to bring the steam window up again to close cs2. With -fullscreen option it always launches on the secondary monitor even after dragging the window to my primary monitor and closing it there. Old CSGO would remember my last monitor and start there.
Same problem on pop_os 22.04. I have dual monitors, 60Hz and 165Hz. The game launches on the secondary 60Hz monitor and when I do anything outside of the game window it starts flicking between monitors making it hard to even close the game.
Having the exact same issue on Artix Linux. Why can't we set the preferred display?
Same here. Dual monitors, both 2560x1440. Primary is 160hz, secondary is 60hz. If I disable the secondary monitor the game launches on the primary one ok. Otherwise if I window it, I get the flickering (I can probably upload and link a video if it helps). If I fullscreen, it always opens on the secondary monitor.
I managed to force the correct display using KDE Window Rules.
Having the exact same issue on Artix Linux. Why can't we set the preferred display?
Fellow Artix user 💪
Finally got into a game and it's completely unplayable.... pretty much any movement rubber-bands back to where I spawned.
Same here on NixOS / Gnome / Wayland / Dual monitors (both 2560x1440). If I go with the windowed full screen it keeps jumping between the monitors. With fullscreen enabled it always launches on the secondary monitor. And since it is fullscreen, I can't move it to my primary monitor.
Note: This occurs both on X11 / Wayland.
Fedora 38 + wayland workaround:-
1.) Launch the game (assuming fullscreen), and it will be on your secondary. Change to windowed mode apply and drag to your primary, then set back to fullscreen. Game seems perfectly playable (I had a few stutters, but I have bad internets).
2.) Next time you launch the game, it will launch on your primary, but it some silly resolution on the top left corner. Set it back to your desired res (2560x1440 in my case). However, this will fill the screen but the resolution wont change and you'll have a blocky minecraft looking POS. Quit the game and releaunch. You'll be back on your secondary monitor in fullscreen mode. Go back to step 1 and repeat!
Yeah, a total PITA, bit at least you can play for a little while.
Getting exactly the same issue with 3 monitors. My main one is the middle one and it always tries to open game on the screen to the right and then jumps between the two. (Side note: the same issue happens when launching steam in big picture mode.)
Does using -sdl_displayindex # (#=0,1,2 for display index) fix this for you? We don't have this exposed in the UI but it is supported by the engine.
Does using
-sdl_displayindex #(#=0,1,2 for display index) fix this for you? We don't have this exposed in the UI but it is supported by the engine.
Two monitors here, -sdl_displayindex 0 or -sdl_displayindex 2 did not change anything, but -sdl_displayindex 1 seemed to at least allow me to start the game, albeit on the monitor I don't want it on, and I'm also unable to alt+tab to any other window while the game is running with the switch active.
Does using
-sdl_displayindex #(#=0,1,2 for display index) fix this for you? We don't have this exposed in the UI but it is supported by the engine.
I also have a dual monitor setup with different refresh rates (144Hz and 60Hz). I also experience the fast switching between monitors in fullscreen windowed mode and the game only launching on the secondary monitor in fullscreen mode. The game is also not movable to the primary screen in fullscreen mode.
I tried the -sdl_displayindex option with different indices but the game still always launches on the secondary monitor if in fullscreen mode.
Interestingly, the game now launches fine on the secondary monitor in fullscreen windowed mode with -sdl_displayindex 1. I can also drag the game to the primary display without any issues. With -sdl_displayindex 0 I still get the fast switching between the monitors.
Example launch option I used, e.g. for index 0:
+exec autoexec.cfg -novid -nojoy -vulkan -sdl_displayindex 0
The only way to launch the game on my 144Hz monitor right now is by selecting the 60Hz monitor as primary display in the Gnome display settings.
I've got a bit of a workaround by using gamescope. I installed from here (Pop_OS 22) https://launchpad.net/~samoilov-lex/+archive/ubuntu/gamescope
And then used these launch options in Steam: gamescope -W 1920 -H 1080 -f -- %command% +exec autoexec.cfg -sdlaudiodriver pipewire (adjust -W, -H as required). I set CS2 to then run in fullscreen mode.
I haven't tested it thoroughly: the mouse sensitivity on menus is too low for some reason, but in game it seems fine. Additionally, Alt-F4 to close doesn't work in gamescope.
...From playing a few deathmatch games, the framerate feels bad. Not sure how to fix this- the game shows high enough FPS
After the CS2 update today it does not do the flicking between monitors anymore without any startup parameters. But it still always launches on the secondary monitor. I can then go to the graphics settings, change to window mode, drag the window over and go fullscreen again. -sdl_displayindex does not seem to have an effect.
Another clue about the problem: I have a monitor in which I overwrote the EDID to only present 74hz as compatible, and not 60hz, and I have another one of the same model which is default. Whichever monitor the game loads on, in fullscreen (and not fullscreen windowed) the refresh rate option only shows the frequencies compatible with the primary monitor as set in the GNOME Display Options (or NVIDIA X Server).
Maybe the problem is that SDL not enumerating the displays correctly on all boxes or the game is wrongly assuming the first one applies to every monitor
On older source games, when selecting between fullscreen or windowed, you had the option to choose which monitor you wanted to use for fullscreen. Regardless of the bugs with monitor detection on CS2, I think this option is more user friendly since it doesn't require the user to know the common "Super + Shift + Arrow Keys" shortcut, or in the worse/less informed scenario, set the game to windowed, drag the window, then set it to full screen again.
Same problem here, unable to use my 240hz monitor as the game locks to the refresh rate of my primary 60hz monitor, this was not an issue with CSGO
Recreated on both Debian and Gentoo, both using Gnome 44/45 + X11
OK, Here is how I workarounded this:
First, CS2 is consistent here at least. It always tries to launch on the secondary monitor. If you go the gnome settings and change the primary monitor to the other one, the game will start on the correct monitor. You can also change the primary monitor via xrandr command. So based on this, here is my CS2 startup command:
xrandr --output DP-3 --primary && mangohud %command% && xrandr --output DP-1 --primary
DP-3 is my secondary monitor.
DP-1 is my primary monitor.
&& waits for the commands till exit.
So here is what happens here:
- Change the primary monitor to the left one (my left)
- So the game will start on the right one (the one I stare at directly)
- Start the game with mangohud
- When the game exits, restore the original positions.
And this works. Thanks, Valve.
Note: You can see your active monitors and their names via xrandr | grep -i connected command. Here is mine:
❯ xrandr | grep -i connected
DP-1 connected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
HDMI-1 disconnected (normal left inverted right x axis y axis)
Exactly the same problem here, primary display 165 Hz, secondary 60 Hz. But I am using Linux Mint mate, latest version.
It's definitively a CS2 issue. cs:go did not do this, neither does any other game. I can switch to windowed mode, move the window to the primary display and then switch back to fullscreen. It will then run on the primary display until next time I start the game. However, all sounds are delayed by 1 second. Input is fine. But performance is really really poor. Everything at absolute minimum gives 80 fps (on average, meaning 15 to 140 fps fluctuating) and stuttering with a machine that would give several hundreds of fps on any other game with comparable graphics.
[Edit:]
Some update fixed the performance issue to a large degree, but not perfectly. However, the latest update that added the new gamemode and extra content also totally destroyed the performance. To the degree game freezes, character keeps walking into a wall, and is pressed against the wall for 10 seconds. Or if I'm shooting, empties the entire mag. It spams the console with sound errors. Tried playing with no sound, meaning it goes to a dummy device and is thrown away with no processing, this doesn't help. Console still spams about starved samples 256. So it might have something to do with sound rather than display. As of now [Feb 12, 2024], the game is totally unplayable, like 1 fps, with an AMD 6700.
Same thing here (Fedora 37 / Xorg), game always opens on secondary monitor
Similar behaviour on EndeavourOS, X11 and Wayland, where game launches on secondary monitor and shows primary monitor's refresh rate (165hz) instead of secondary's (60hz). I tried the -sdl_displayindex launch option with no luck.
Same issue with cs2 opening on secondary monitor. Funny thing is Albion online, opens on the correct primary monitor ( same steam launcher )
Nobara 38
Same issue. I tried -sdl_displayindex 0|1|2 with no success. I'm also running it with -fullscreen to prevent the display ping-pong flickering issue.
This is still an issue for me. LinuxMint 21.3 Cinnamon X11 RTX 2060 proprietary drivers.
Running in a Wayland (eg KDE5) DOES fix this (well at least for me), but regardless, I'm sure this isn't intended behavior for X11.
For me it's even worse. It launches on the primary, but as soon as I perform any changes to the video settings it snaps to the secondary (which has a smaller resolution, thus half of the window is not in frame and I can't change the settings) and then it just shuts down my primary monitor forcing me to restart.
To even be allowed to play I need to unplug my secondary monitor whenever I want to start the game
For me it's even worse. It launches on the primary, but as soon as I perform any changes to the video settings it snaps to the secondary (which has a smaller resolution, thus half of the window is not in frame and I can't change the settings) and then it just shuts down my primary monitor forcing me to restart.
To even be allowed to play I need to unplug my secondary monitor whenever I want to start the game
OK so some revelations...
There seems to be a strange issue where only on linux (X11 more than Wayland, however sometimes both) the system ALWAYS treats the left-most monitor as the primary one, despite what is actually selected in the X11 or Wayland config. The ONLY way I've figured out how to fix this is to (I'm not joking) physically switch my monitor setup so that my primary monitor is now the most-left.
This seems MUCH bigger than just a Valve/CS2 issue, this is a desktop Linux issue that needs WAY more publicity.
There seems to be a strange issue where only on linux (X11 more than Wayland, however sometimes both) the system ALWAYS treats the left-most monitor as the primary one, despite what is actually selected in the X11 or Wayland config. The ONLY way I've figured out how to fix this is to (I'm not joking) physically switch my monitor setup so that my primary monitor is now the most-left.
thank you, for me it wasn't the left most but the upper most monitor that started the application regardless of screen priority
There seems to be a strange issue where only on linux (X11 more than Wayland, however sometimes both) the system ALWAYS treats the left-most monitor as the primary one, despite what is actually selected in the X11 or Wayland config. The ONLY way I've figured out how to fix this is to (I'm not joking) physically switch my monitor setup so that my primary monitor is now the most-left.
thank you, for me it wasn't the left most but the upper most monitor that started the application regardless of screen priority
Every time i mention this issue to anyone, they just deny its existence, glad to see others admit that its a problem.
Anyone else confirming this fixed? Loading on primary monitor consistently for me