Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
813 stars 105 forks source link

[OpenXR] Remove simple khronos interaction profile #1431

Closed svillar closed 5 months ago

svillar commented 5 months ago

This PR fixes #1430 by removing the simple khronos interaction profile which is causing unexpected behaviours and interactions with other interaction profiles and hand tracking. In particular when enabled in Meta devices this profile causes all the hand tracking data to become zero, effectively disabling it.

Removing it is not as simple as it might look like. The current code heavily depend on having an active OpenXR interaction profile (also called input mapping in the code) which does make sense for devices with physical controllers. However devices with no controllers should not need any. That's why in order to remove that profile we had first to remove that constraint which required several previous steps, namely:

  1. Do not use input mappings to set the device type (as there might not be interaction profiles)
  2. Do not make the beam creation depend on interaction profiles (as there might be none)
  3. Allow Wolvic to run without active interaction profiles (like in hand tracking devices)
  4. Get rid of the emulated profile we had to ensure there was always an interaction profile

The nice thing about this sequence of patches is that the fix comes in the last patch but none of the previous ones break hand-tracking only devices as the Lynx R1 or the Lenovo A3

svillar commented 5 months ago

Moved to draft as there might be a simpler solution that does not require so many changes.

svillar commented 5 months ago

After reevaluating the alternatives I've decided to push for this solution again. We can make Meta work by simply not adding the simple profile by default, but this PR is a much more generic fix that allows us to, among other things, get rid of the nasty code of emulated interaction profiles. That code was added to circumvent the issue of hand tracking not working just after launching Wolvic because there was no active input mapping. Note that the runtime does only emit the update interaction profile event for physical controllers.

The main issue with that code is that hand tracking works not because we set something up in the runtime, but just because we can trick the Wolvic code to believe that there is an active interaction profile (input mapping).

svillar commented 1 week ago

This was restored by #1618