-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
(fix) Better no-stats vs no-framepace separation #2634
Conversation
alvr/server_openvr/src/lib.rs
Outdated
} else { | ||
None | ||
// Fallback to avoid deadlocking people's systems accidentally | ||
Duration::from_micros(1000) |
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.
Maybe just use from_millis(1)
?
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.
Honestly I was debating dropping it to 500, but sure
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.
Thinking more about it, I think the logic needs to be flipped. first we should check if the session manager is up and use as fallback PRE_HEADSET_STATS_WAIT_INTERVAL. then if enforce_server_frame_pacing is false use a ZERO duration. I think this is fine. by looking at the graphs on Discord, I think that unconditional 1ms wait was causing some unnecessary slowdowns causing the server not to match the framerate of the client
Windows definitely doesn't have the resolution on 1 microsecond sleep... i think it's better to omit the sleep function entirely in that case |
I tested it on 1 microsecond and it seems fine, and to verify I loaded up the most unoptimized VRChat world I could find (~60fps on my 4090) and it seems to stay in the messy spiky client FPS state more often than 45Hz. I know technically it won't actually hit 1 microsecond bc scheduling resolution and such, but really I just want the equivalent of a yield there since SteamVR is a high priority process and it's good to yield when you can I think. |
Actually I'll try a proper yield and see if that's fine or if there's unexpected issues, one sec |
I really want to know how windows even deals with that. Does it just |
Tested the yield and it seems fine, also reordered the checks so that the StatsManager being missing will also sleep 8ms even if frame pacing is off, so no coil whine. |
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.
Looks good now
* Better no-stats vs no-framepace separation * millis * micros * yield
* Better no-stats vs no-framepace separation * millis * micros * yield
No description provided.