-
-
Notifications
You must be signed in to change notification settings - Fork 914
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
Framerates are locked to refresh rate #7019
Comments
thats how it's always been, welcome to wayland |
I'm aware that's how wayland is designed but in specific applications (mostly games) framerates could go above the refresh rate in both wayland and xwayland modes. This still works fine in commits prior to aq as well as other wayland compositors such as sway. VIsual of this working fine in sway: Visual of this not working in Hyprland e2efecc: |
it's up to the app not hyprland, though. |
This behaviour works fine prior to the aq merge in Hyprland as well as other wayland compositors, shouldn't this be re-opened since this is a bug on master? |
still not convinced. What's the test client? |
Easy to reproduce with osu! as basically any modern hardware will run the game at 1000fps, launch option is Hyprland v0.41.2 and sway 1.9 both work fine, Hyprland master does not. |
Why would you want the fps to be higher than the refresh rate anyways? Is there any use even if the monitor cant/wont keep up? Also can you confirm that sway is not just detecting and using a 1000hz refresh rate for your monitor, whereas hyprland uses 240hz? |
there is a benefit in reduced latency |
I always thought that capping the fps at a lower value would lower the latency since the game engine needs to spend less time on computing the frames and has more time for processing input or are you not talking about input latency |
input latency |
ok |
I have the exact same problem. Switched from 0.41.2 to hyprland-git e673220 to try and see if it fixes #6230. |
Can confirm, this seems to only happen when tearing is enabled. |
This was kind of fixed? The problem still exists sometimes after tabbing into another application and back sometimes though. |
It still doesn't work for me. The fps are unlocked when |
It should be unlimited either way. No clue why tearing is the thing breaking this though. Also it seems you're correct, it does still break when tearing. For some reason tearing is completely broken now and decides not to work until re-tabbing in and out several times. |
I thought it should be locked when tearing is off. Isn't that the default behavior of wayland like vaxry said in the first comment?
This doesn't work for me either. With wayland windows, tearing doesn't activate and the fps are unlocked. When the window is a xwayland client, tearing activates and the fps are locked. That is how it is for me. Maybe these are two different problems. I don't know. |
Unless vaxry feels the want to break consistency with every other wayland compositor, no. The framerate should be uncapped in either scenario.
No clue either at this point, these commits need to be tested a lot more it seems as things as critical as the displays only rendering a black screen is apparently being unnoticed until it's merged somehow. |
you can only blame yourself for not testing MRs for that. Everyone who was active in testing new changes reported having no issues. |
While that may be true, you still decided to rush the merge causing issues here. Additionally, some of the issues that were reported and you didn't fix prior to merging, an example being the frame pacing issues. A PR as large as aq I feel should have probably been delayed a bit longer. While I won't tell you how to run your project, I will point out that from a users perspective it's rather unpleasant having changes constantly break something because they weren't tested well enough, this is especially the case with the issue mentioned above with the display rendering a black screen at some point. Please @ me when you have a proposed fix / PR ready for this issue so I can test. Thanks! |
that's what a -git version is for. The critical issues that arose from the MR are blockers for 0.42. This isn't, because tearing has always been wonky and experimental. |
I did some more testing. |
Thats because XWayland afaik directly interops with the compositor (Hyprland), while gamescope doesn't. Gamescope is a microcompositor. It can run as a wayland client, or directly use the DRM if you start it from the tty. When it is run as a wayland client it renders its own clients on its wayland surface (Inside of its Window), just like what Hyprland does when you run Hyprland as a wayland client. A client running in gamescope belongs to gamescope, not Hyprland. As for tearing not activating in gamescope, Hyprland doesn't manage Tearing inside of gamescope. |
It doesnt matter if the game is run with gamescope or without. The client shown by But when the game is wayland it shows always the gamescope compositor.
That means I dont have to mess with hyprlands tearing settings at all when running nested gamescope? |
You mean even if it isnt running within gamescope? That shouldn't be the case...
Well, If tearing is disabled Hyprland will limit the fps at which gamescope renders, but if gamescope limits the fps of its own clients by itself already the tearing setting in Hyprland wont help. You have to make sure that Tearing is enabled both in Hyprland and in gamescope ( If there is even an option for that ) It might be helpful to know what distro you use |
Odd, I'm experiencing the exact opposite behaviour where wayland windows are the ones causing problems with tearing. Can you make sure with |
have yall tried aq-git |
gamescope + wayland client inside --> wayland client without gamescope --> gamescope + xwayland client --> xwayland client without gamescope --> Tested with glxgears for xwayland and vkcube-wayland for wayland. For some reason when running cs2 with gamescope it behaves like this: gamescope + xwayland client --> This is really confusing at this point.
There is
Arch |
Yeah when you run a client nested inside of gamescope that client registers to gamescope, not hyprland, and gamescope in turn registers itself to hyprland. As far as the client running inside of gamescope is concerned there is nothing beyond gamescope. The PID belonging to the gamescope process isn't wrong. About cs2, are you sure that it's running with gamescope? Do you have gamescope in the Steam launch args? Because if not it should create an xwayland client.
xwayland does seem to affect the FPS at which the client can render stuff. |
Yes I have the correct steam launch args. Did some more testing and Only when running games with proton-ge, which afaik uses wayland instead of xwayland, |
???? this doesn't make much sense to me |
It only does that when I launch it through steam. One thing I didn't mention is that I am using the flatpak version of steam. Maybe the flatpak version of gamescope works differently. |
No you see, as far as I understand the PID that |
Yes I understand. When running with Proton Experimental With Proton-GE: It also throws this error with Proton Experimental: But after clicking OK two times the game launches. It seems like it doesnt really start through gamescope when using something other than Proton-GE. |
You could try checking wether gamescope runs at all when starting without proton-ge / with proton experimental. Just to verify. However that would definetly explain the pid thing. |
Yes I can see a gamescope process. |
In that case it seems like gamescope is no-scoping I seriously need to learn how to make good jokes |
Wait but is the window that gets created an xwayland window ? |
Yes, Its pretty clear that this is another issue and that something is wrong with gamescope. I dont know but I think that hyprland has nothing to do with this issue. But I now I dont understand why someone should run games with nested gamescope when it doesnt even support tearing in nested mode. And its causing more problems than it solves. But the other problem still persists. With xwayland windows and tearing enabled the fps is locking to the refresh rate. I think we should focus on that because that seems like its an issue with hyprland. Also this:
Doesnt seem to be correct, because when running the game through proton-ge and without gamescope it still spawns a xwayland client. |
This is probably relevant:
And apart from that it seems hyprland never tells xwayland to start tearing |
I tried looking at the logs and this is what gets spammed: When setting |
I have been seeing those in my own logs too. |
After updating my system and hyprland-git and all of the dependencies the fps are only locked while moving the mouse. |
Which application are you seeing this behaviour in? Framerates are still locked completely on my end with the applications I've tested. |
glxgears and also games like cs2. |
I can't seem to reproduce on either. Are you sure the application is still tearing while your mouse isn't moving? |
|
Everything is working fine when setting |
Funky. In that case I suppose the issue is resolved? |
Depends on what the author of this issue has to say. Also, like the comment I linked says, I dont know if this is something that can be fixed in hyprland or if it is entirely a kernel issue. |
This issue should likely remain opened until it's solved upstream, be it on the kernel or Hyprlands side. @RafGamer If you're willing to build a kernel with that commit and test against Hyprland master that would be helpful to know if this is an issue on Hyprlands side or not as Sway doesn't seem to have this issue but depends on similar patches. |
I mean, I suppose Hyprland/Aquamarine could just spawn a second thread, which dispatches the page-flips synchronously, but I feel like that would be error-prone and a waste of resources |
Even if it works, there are other compositors that don't have this problem and they also don't depend on any kernel patches. So there has to be a way to fix this. |
Not sure about this, wlroots compositors require a similar patch for tearing to work without
Regardless of if this works around the issue or not it's not necessarily a fix, similar to how |
Yeah, I researched it and it seems your right. They all have some sort of problem with tearing and atomic.
Yeah I know, I just wanted to see if the cause of the problem is the same in your case. Also, I dont really know which patches I need, because it seems like some were already merged. EDIT: I found this: https://invent.kde.org/plasma/kwin/-/merge_requests/4800. So does that mean it works in KWin and all the required patches are already merged? Now I'm really confused. |
That might be a patch on the compositors end? Tearing used to work on Hyprland prior to the aq merge so I'm assuming something similar was done on Hyprlands end as well? Regardless, it would be an incorrect approach to apply a "workaround" instead of just waiting for proper support from the kernels side as it's already in development and should be merged sooner or later. |
Yeah, I didn't look closely enough. Seems like the merge request also automatically disables the hardware cursor when tearing is active. |
Regression?
Yes
System Info and Version
System/Version info
Hyprland, built from branch main at commit e2efecc (flake: update aquamarine). Date: Wed Jul 24 00:42:15 2024 Tag: v0.41.2-82-ge2efecc2, commits: 4968flags: (if any)
System Information:
System name: Linux
Release: 6.8.9-273-tkg-eevdf-llvm
Version: #1 SMP PREEMPT_DYNAMIC TKG Sat, 11 May 2024 06:09:58 +0000
GPU information:
0c:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c5) (prog-if 00 [VGA controller])
Description
Framerates are locked at the displays refresh rate. Going to assume this is caused by aq merge.
How to reproduce
May require tearing to be enabled, I haven't tested.
Crash reports, logs, images, videos
No response
The text was updated successfully, but these errors were encountered: