alvr-org / ALVR

Stream VR games from your PC to your headset via Wi-Fi
MIT License
5.51k stars 488 forks source link

[Linux?] SteamVR crashes if controllers are disabled #1425

Closed galister closed 1 year ago

galister commented 1 year ago

When using ALVR with controllers (the setting) disabled on Linux, SteamVR will crash with -301 after some 5~10 minutes of usage.

Have not confirmed if this is an issue on Windows.

This is on the openxr-client branch.

I made the following changes - to register the controllers even when they're disabled, but don't send any tracking data. IIRC this is what VD does as well, so that's where I got the idea.

https://github.com/galister/ALVR/commit/c1f735cc89f1e8eb05536232e7235accb967fde7

This fixed the crashes and works as expected, allowing the use of lighthouse-tracked controllers via Space Cal without issues. The untracked controllers never show up or affect bindings etc. I tested for 3 hours total and have not seen a single crash.

zmerp commented 1 year ago

I'm surprised we are even trying to set controller values if they are disabled. There is a commit pending in the openxr branch that does the same thing as your commit, but on the Rust side.

galister commented 1 year ago

I don't think it's been trying to set the values, because if it's not registered in SteamVR, it'll fall into this:

    if (this->object_id == vr::k_unTrackedDeviceIndexInvalid) {
        return false;
    }
zmerp commented 1 year ago

So the deal is to always enable controllers? How is that noone else hit this bug yet?

galister commented 1 year ago

Possibly Linux specific? I just fixed space cal the other day - both Linux forks were broken - so can't say that there were a lot of people using ALVR with space cal.

zmerp commented 1 year ago

I would add a new setting enable_dummy_controllers, outside of the controllers Switch block, to be used with controllers disabled.

Timocop commented 1 year ago

This issue happens on Windows as well, especially when 3th party (non ALVR) controllers are added.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.