SlimeVR / SlimeVR-OpenVR-Driver

SlimeVR driver for OpenVR
Apache License 2.0
204 stars 46 forks source link

HMD Position -> SlimeVR Server -> Tracker Position is likely always >= 1 frame behind #34

Open kitlith opened 1 year ago

kitlith commented 1 year ago

This issue is exacerbated by any additional latency in the server itself, which is being tracked here: SlimeVR/SlimeVR-Server#511

I think we have a couple routes here:

TheButlah commented 1 year ago

@Louka3000

kitlith commented 1 year ago

The more I think about this the more I go back to my original stance that "correct the HMD position in the driver" does not technically result in correct results. Problem is:

For now, I'm going to take the stance of getting us as close to as on-par with OSC as we can, and then leaving this issue open so we can do the more correct thing in the future.

TheButlah commented 1 year ago

For now, I'm going to take the stance of getting us as close to as on-par with OSC as we can,

I agree that merely doing "adjust translation to be based on current headset position instead of old one" is not a complete fix. But its low hanging fruit, imo. Should just be a new field on the protobuf, and a quick subtraction of translation.

We should still also work on optimizing the actual round trip latency, but the translation adjustment will help perceptually quite a lot, especially in the chest and waist.

kitlith commented 1 year ago

I happened to look at the driver sample included with openvr today and noticed this:

void RunFrame() {
    // In a real driver, this should happen from some pose tracking thread.
    // The RunFrame interval is unspecified and can be very irregular if some other
    // driver blocks it for some periodic task.
    /* <snip> */
}

which answers the question I was thinking of asking about threads vs waiting in RunFrame.

so at the very least receiving positions from the server should be handled in another thread, if not other things. So, #33 is relevant... and apparently I was requested to review it a couple weeks ago. >_>

as-is it doesn't solve this issue, but it could be solved by handling position messages in the bridge thread introduced in that PR immediately instead of pushing into a queue.

There's probably an argument for not waiting for a bridge frame to send HMD positions as well, but shrug

ButterscotchV commented 1 year ago

Has this been resolved now? There have been a lot of changes to attempt to mitigate this.

Erimelowo commented 1 year ago

It’s not solved as @0forks ’s fix had some problems. You can see the delay in my devkit video due to using lock-all. It’s quite obvious.