Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.2k
output: fix automation for tearing + hw cursor + direct scanout#10020
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
DS doesn't work with SW cursors. Might work with invisible SW cursors if the code allows it. |
abihf commentedApr 23, 2025
is there still any blocking for this PR? I've been using this patch for weeks and it's okay. |
I don't think its finished, gotta look over it still |
@ikalco rebase? |
rebase possible? ty ikalco |
Cloudperry commentedJun 23, 2025
I tried this on top of Hyprlanddd33128 and it didn't seem to work properly. (This is the first time I have tested this PR.) When I started a fullscreen game |
Yeah, just had some time to test too. Results came like this:
|
ikalco commentedJun 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fxzzi btw if you test the new commits out, I changed the activelyTearing and directScanoutTo to be simpler for the edit: |
fxzzi commentedJun 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
likely, tho i've also noticed some strange behaviour on my friends AMD based PC (not tested this PR there yet). On certain games for him (Minecraft 1.8.9, Paradox games like crusader kings 3, hearts of iron 4, etc), if he changes workspace and back to the game, his fps is locked to a low number (like 30 or so) for about 10-15 seconds. Also happens when notifications show on screen etc. I tested a few combinations with him:
I use the exact same setup with my nvidia GPU and don't experience this bug
I'm checking for tearing in a few games.
EDIT: also maybe an nvidia related issue. Sometimes games feel stuttery and it magically fixes by going to a different TTY and back. idk y
vrr seems to be broken tho even if the cursor is invisible. Noticed this on ghost of tsushima. Controller works fine with VRR, but using my mouse causes my monitor OSD to stay at 170 |
ok so the main issue is that the kernel doesn't really like anything changing, including the hw cursor position, while doing a tearing page flip I'll try asking around about tearing and hw cursor, hopefully there are some better workarounds or a kernel mechanism I missed, but this is the best we got for now
not sure if this is the expected the behavior but it's up to the kernel since all we have are switches for tearing and vrr
its probably related to the workaround limiting frames
this is probably related to |
fxzzi commentedJun 26, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
thanks for the explanation, seems the kernel has more to do with ds tearing and vrr than I expected.
yeah, I know, just thought I'd share anyway since it seems to be an issue in relation to them. my apologies :) |
Cloudperry commentedJun 26, 2025
I'm using an AMD gpu with Mesa git and Kernel 6.15.3. I have these tearing related settings:
With the latest commits this PR doesn't cause stuttering or glitches, but still behaves a bit weirdly. When starting a game, tearing gets activated and scanout as well. However direct scanout keeps flipping between on and off unless I constantly move the mouse around. Also moving the mouse out of the game's monitor causes direct scanout to get stuck as off and it won't turn on when the cursor is back on the same monitor. Also it turns permanently off when the game hides the cursor (I was testing an FPS game). |
fxzzi commentedJun 30, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
tested your latest commits with hw cursor stuff disabled: {programs.hyprland.settings={cursor={no_hardware_cursors=1;min_refresh_rate=32;no_break_fs_vrr=1;};};} Still unable to get the two to activate at the same time reliably. The change in syntax for currentTearing and currentScanout also broke agsv1 for me, I think because of the space in the output: (com.github.Aylur.ags:1582): Gjs-WARNING**: 02:36:20.202: JS ERROR: SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 28 column 29 of the JSON data @ resource:///com/github/Aylur/ags/service/hyprland.js:108:30Hyprland@resource:///com/github/Aylur/ags/service/hyprland.js:108:30@resource:///com/github/Aylur/ags/service/hyprland.js:334:25 edit: fwiw i think the false or true is useless, just show 0 / false if no window is actively being teared / ds'd, and then show the window id if there is. should avoid needing a space in the output |
|
So from what I can understand this makes it impossible to tear and ds at the same time? And so this PR is not possible? Because the Hyprland wiki shows disable hw cursors as 2 by default, which says
Or does "disable" here mean to disable no hw cursor, hence enabling it again? |
It means "Disable HW cursors, when tearing" |
fxzzi commentedJun 30, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Very confusing with the double negatives... Anyway Yeah that does kinda of back up my point from what I can see. Currently (outside of the scope of this PR), VRR is fundamentally broken with hw cursor. Invisible hw cursor moving even causes the refresh rate to jump up to max. So we must use SW cursor, which then in turn stops DS from working, and tearing does work in both cursor modes from what I can see.
edit: actually, figured it out. {programs.hyprland.settings={cursor={no_hardware_cursors=0;min_refresh_rate=32;no_break_fs_vrr=1;};};} seemed to work for me (my vrr range goes down to 32) this works OK on latest git, but there seems to be a regression in this PR. When moving the camera with my mouse in minecraft, native wayland, monitor OSD reports half refresh rate. So the game feels choppy. This doesn't occur with latest git. |
For now, yes
that's probably caused by the workaround I tried to make, which is wrong, in this PR |
okie dokie, thank you for explaining. well the PR does at least seem to fix my issue in#10880, but agsv1 is broken here and the mouse workaround is causing the above issue. By any chance could the syntax of currentTearing and currentScanout be changed to remove the space, and the mouse workaround removed (since it didn't work anyway)? I wanted to test if this at least made the behaviour more correct than it was before, I feel it will 🙏🏽 |
Uh oh!
There was an error while loading.Please reload this page.
ikalco commentedJul 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@vaxerski but like@fxzzi said, this does fix some issues + cleans up related code so do you wanna merge those parts? edit: |
Comments from 2018 :woe: Anyway, since this PR has gone slightly off the rails lol I would like to also point out#10452, but idk if it's trivial to add or not |
I am fine with the rest |
1ce4b1e
to5b6bb06
Compareikalco commentedJul 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fxzzi test plz :) edit: |
Sorry 😔 won't be able to test for a few weeks as I'm on holiday Hopefully someone else here is willing to test and we can get these changes into 0.50 :) |
ad08b4f
tode1f8ce
CompareDekomoro commentedJul 9, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Tearing with this pr while using direct scanout appears to be working properly. |
.type = CONFIG_OPTION_CHOICE, | ||
.data = SConfigOptionDescription::SChoiceData{0,"Disabled,Enabled,Auto"}, | ||
.data = SConfigOptionDescription::SChoiceData{0,"Disabled,Enabled"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this should be bool at this point
Uh oh!
There was an error while loading.Please reload this page.
Describe your PR, what does it fix/add?
related#9858 and#9890
this pr tries to fix tearing when its combined with other stuff (ds, hw cursor, maybe more? idk)
also draft cause seems to me some other old mechanisms (pre aq) may still be interfering with new ones
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Is it ready for merging, or does it need work?
draft