ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.13k stars 2.25k forks source link

Osu!Lazer detecting wrong Hertz count #8963

Open Miacelium opened 4 years ago

Miacelium commented 4 years ago

Describe the bug: I got a 144Hz monitor which is set to 144Hz according to the NVidia X Server Setting GUI but Osu!Lazer only shows/detects my monitor as 60Hz. I am not sure if it's placebo but it feels very laggy (as 60FPS/Hertz usually do).

System: OS: Ubuntu 20.04 (Xubuntu) GPU: NVidia GTX 1060 GPU-Driver: 440.64 CPU: Intel i7-4790k

Screenshots or videos showing encountered issue:

osu!lazer version: 2020.429.0.0?

Logs: database.log network.log performance.log runtime.log

swoolcock commented 4 years ago

Can you please try the SDL backend to see if that helps? Append --sdl command line argument.

Miacelium commented 4 years ago

Can you please try the SDL backend to see if that helps? Append --sdl command line argument.

With the--sdl argument it start in windowed-mode without the option to change the screen-mode and it still reports 60FPS/Hz when vsync is enabled.

EDIT: My information is somewhat faulty. The in-game FPS display shows 60FPS and infinite hz at Draw. I assume it detects my monitor at 60Hz since it's locked at 60FPS with vsync enabled.

peppy commented 4 years ago

does it run at higher frame rates if you change the limited to a non-vsync variant?

Miacelium commented 4 years ago

does it run at higher frame rates if you change the limited to a non-vsync variant?

Yes, when set to unlimited it runs at 1000+ Draw FPS but I can't tell if it's at 60Hz or 144Hz. It feels pretty laggy but I can't tell if it's nocebo.

EDIT: when set to 2x, 4x or 8x it also uses the 60Hz it detected to multiply. On Windows applications can enforce the refresh rate iirc that's why I am unsure if it is the same case here too.

ghost commented 4 years ago

Check your xorg.conf in /etc/X11/ and make sure your monitor refresh rate is set correctly. Afaik if you don't run the nvidia utility as root it won't be able to write the conf file and your changes won't be saved.

Other than that I'd tell you to install gamemode so your game runs better.

Miacelium commented 4 years ago

Check your xorg.conf in /etc/X11/ and make sure your monitor refresh rate is set correctly. Afaik if you don't run the Nvidia utility as root it won't be able to write the conf file and your changes won't be saved. Other than that I'd tell you to install gamemode so your game runs better.

My monitor is properly set to 144Hz, I think. It has an in-built "gaming mode" that shows the current refresh rate and that displays 144 when active.

Starting it through gamemode seems to actually help make it run more smoothly. I didn't know about this program, thank you!

Sorry for closing and reopening the issue, I miss clicked.

treierxyz commented 4 years ago

Do you happen to be running multiple monitors?

If you are, then that caps any kind of VSync to the lowest refresh rate monitor. Xorg doesn't play nicely with mixed refresh rates. It has something to do with Xorg using one virtual screen for all monitors. Try other games with VSync and see if they are locked at 60fps.

I think the only solution in this case is to not use VSync. Wayland is supposed to have better multihead support, like including Multi DPI, but I'm not sure how well it handles mixed refresh rates, plus it might depend on your DE implementing that stuff. NVIDIA Proprietary drivers don't support Wayland, so I can't confirm if it is any better on Wayland.

If you're not running multiple monitors, then I don't know what is causing this.

ghost commented 4 years ago

Are you using the proprietary nvidia drivers? If you are using the nouveau open source drivers performance will be terrible.

I don't know what ubuntu comes preloaded with.

Edit: Also actually make sure your refresh rate is properly set in your xorg.conf located in /etc/X11/ by editing it with a text editor. If the gui utility isn't running as root it won't write out the file and your changes won't be saved. That's why the gui might show 144hz but in reality it didn't save the changes.

LouisNitag commented 3 years ago

I got also the issue with this setup:

OS: Arch Linux, up-to-date GPU: AMD Radeon 5700XT GPU driver: amdgpu CPU: AMD Ryzen 3700X Monitor: Samsung C24FG73FQ, 144Hz FreeSync Osu: 2021.118.1

The monitor is well-configured, running VRRTest give me a nice, smooth movement, at 143Hz without any tearing.

When I launch Osu!, the screen goes to black, like if I change settings, then Osu! shows up. It indicates a refresh rate of 60Hz, with VSync activated. If I run VRRTest again on another desktop, I have a lot of tearing, FreeSync does not work anymore.

When I close Osu!, I get the same black screen, my screen opens a popup with the name of the interface (DP1), and VRRTest is good again at 143Hz.

I suppose Osu! changes the settings of the screen, but does not detect the correct hardware. Any news regarding this issue?

bdach commented 3 years ago

there has been no updates to this issue, therefore no news. this requires specific hardware to develop against. if the fps is changing, then either SDL can't see/comprehend a "143 Hz" display mode from x11, or it doesn't support it.

LouisNitag commented 3 years ago

It seems that's due to Osu! startup. If I apply xrandr --output DisplayPort-0 --mode 1920x1080 --rate 144 after the launch, the correct framerate is displayed in-game. Osu! overwrites some screen settings instead of allowing users set their owns.

This is a bit annoying, but applying xrandr conf fix the bug at runtime, so the game is still playable.

NBBZ commented 3 years ago

ok, i have a very similar issue so here are the details, i am running two monitors, one 144Hz and one 60Hz, osu! is detecting the lowest refresh rate out of the monitors connected (60 in this case) when i raise the frame limit above 60 it still looks very much like 60Hz, and when i unplug the 60Hz monitor and restart xorg, osu! defaults to the refresh rate of the only monitor connected (which is 144Hz), my system is very minimal (im on artix with the spectrWM) so i also know my exact display settings.

on startup i run xrandr --output HDMI-0 --auto --output DP-0 --auto --primary --left-of HDMI-0 --output DP-0 --mode 1920x1080 --rate 144.00

which configures the refresh rate, resolution, and which monitor is primary, i do not think the problem lies with this command though, i honestly have no idea how to fix it either, i just pity the devs for having to code around the neolithic era software known as Xorg.

NEVERMIND I FOUND A FIX A VERY LONG WHILE AGO AND JUST FORGOT ABOUT THIS COMMENT TURN OFF VSYNC IN PICOM CONFIG!!!! IT ALSO RESOLVED A BUNCH OF OTHER ISSUES I HAD

DBChoco commented 2 years ago

I just had the same problem, and found an easy fix. Go to ~/.local/share/osu/framework.ini Around line 7 you should see this: LastDisplayDevice = Second Change the Second to First and you should be good to go.

peppy commented 2 years ago

That variable should update every time you move to game to a different screen. Are you finding that not to be the case?

DBChoco commented 2 years ago

Yes it was not the case for me, the game was locked at 60Hz and couldn't make it change no matter how much I moved the game or changed the window mode. 2021-11-29_09-48 Here is a neofetch, I hope it helps somehow

localcake commented 1 year ago

I've been having the exact same issue as Miacelium and have had his issue for a few months now but I'm on Windows. The game even changes the refresh rate of my monitor to 60hz when I alt-tab off if I had V-Sync enabled.

OS: Windows 10 22H2 GPU: AMD Radeon RX570 GPU driver: AMD CPU: AMD Ryzen 5 3600 Monitor: Pixio 248 Prime, 144Hz FreeSync Osu: 2022.1022.0

NBBZ commented 1 year ago

i found a fix a very long time ago and forgot about this thread, i turned off vsync in my picom config and it fixed this issue and a bunch of other issues i had with refresh rate detection in software

and for the windows commenter, maybe try to change the refresh rate in the amd-equivalent of the nvidia control panel, but im not sure about that

localcake commented 1 year ago

I think this could be an AMD issue since I've tried turning on and off all the different options to do with freesync, vsync and framerate. Thanks for the response though.

NBBZ commented 1 year ago

if you have multipile monitors try unplugging all but the 144Hz one, this usually means that the refresh rate is set to the lowest monitors, and im not sure how to change it with amd on windows

Jordan-Jay commented 1 year ago

Xorg will have problems with multi monitor setups with mixed framerates. Users with multi monitor, multi refresh rate, nvidia-proprietary setups have had good success with Ubuntu's implementation of Wayland as Ubuntu have been working hard to get it playing nicely especially on Nvidia-Proprietary drivers. VSYNC on KDE X11 can successfully grab the refresh rate on 60 HZ when i have it manually set there and on 144 HZ. These seem to be compositor issues others are complaining about which are unrelated to Lazer since it's just grabbing what the compositor is reporting to it. This issue should probably be closed.

Jordan-Jay commented 1 year ago

As of build 2022.501.0 the Hertz can be successfully detected from the compositor this broke from build 2020.1225.0. This issue seems to be the game struggling to identify your monitors refresh rate and then defaulting to 60 Hertz. Which explains why it would work again when players forced the game to recognise their monitors Hertz.

Compositor and Display Settings are the same against two versions and in between versions.

2020.1225.0 Build osu_2022-11-07_20-07-41

2022.509.0 Build osu_2022-11-07_20-12-06

This issue didn't seem to happen on Windowed mode nor Borderless Mode. Early 2022 builds this seemed very temperamental which means switching to Borderless or Windowed and then back to Fullscreen seemed to fix this even on restarts of the game.

As for the PICOM Compositor issues this is related more to User Setup than the game.