Skip to content
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

server: Fix frame drops in SteamVR/Windows #607

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

0forks
Copy link
Contributor

@0forks 0forks commented Feb 24, 2023

The named pipe thread currently has a 5ms sleep, which leads to inconsistent tracker position updates (drops about half of the frames). This PR improves message timing consistency for OpenVR trackers on Windows by waiting for a data ready event, and runs an update as soon as the HMD position frame is received from the driver.

Comparison before and after:

frametimes.webm

@Eirenliel Eirenliel merged commit 4d8c8aa into SlimeVR:main Feb 24, 2023
@ButterscotchV ButterscotchV added Type: Bug Something isn't working Priority: High Important feature or blocks something important Area: SteamVR Driver Related to the SteamVR Driver Area: Server Related to the server labels Feb 24, 2023
@kitlith
Copy link
Member

kitlith commented Mar 13, 2023

Finally got around to running https://github.com/kitlith/SlimeVR-Latency with this PR merged, which caused some questions, which caused me to run a profiler to check my theory.

This PR isn't setting up the async ReadFile correctly. It's blocking there. This means that the thread doesn't wake until the next time the driver sends a packet. Since this thread is waiting for skeleton calculations to be done by the server, this means that we are persistently a frame behind. The comments from people about this being much better might be because we are consistently a frame behind, instead of fluctuating between 0 and 2, but it could be improved.

When running SlimeVR-Latency, which only sends an update every second, this... takes a second to update, since it's waiting for the driver to send something else.

@0forks
Copy link
Contributor Author

0forks commented Mar 13, 2023

Thank you for pointing this out. This will be fixed by #629.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Server Related to the server Area: SteamVR Driver Related to the SteamVR Driver Priority: High Important feature or blocks something important Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants