igl icon indicating copy to clipboard operation
igl copied to clipboard

Monado Android enumerates XR_EXT_HAND_TRACKING_EXTENSION_NAME but xrCreateHandTrackerEXT fails.

Open BattleAxeVR opened this issue 7 months ago • 0 comments

Hi there, I get a crash / assert when trying to run the sample on my Android Phone using Monado.

Monado repo maintainers claim that enumerating an extension is NOT sufficient, per the OpenXR specification, to determine if a feature is indeed supported.

https://gitlab.freedesktop.org/monado/monado/-/issues/407

Basically, the way you are checking for OpenXR feature supported or not on a headset appears to be incorrect:

image

https://github.com/facebook/igl/blob/fd30e1ace7374fa495457b3e3a261423532a07e9/shell/openxr/mobile/XrApp.cpp#L840

XrHands.cpp asserts that the return value of xrCreateHandTrackerEXT_ is XR_SUCCESS.

I believe shouldn't do an XR_CHECK but simply return false if there's an error:

https://github.com/facebook/igl/blob/fd30e1ace7374fa495457b3e3a261423532a07e9/shell/openxr/XrHands.cpp#L109

bool XrApp::handsTrackingSupported() returning true if the XR_EXT_HAND_TRACKING_EXTENSION_NAME is incorrect.

The method should be renamed to handTrackingSupported() (singular), and sorry to be pedantic here, probably handTrackingEnumerated(), actually.

Enumerated vs actually Supported are apparently two very different things in OpenXR. I thought one implied the other, as I've been comparing the list of extensions in all my standalone and PC headsets to see what features I have access to, to plan development time and testing time. Ex. some features like Link Sharpening or ET DFR don't exist on PC for Quest Pro over Link, but they do on Quest Pro standalone builds.

handTrackingSupported() should actually return true IFF (if and only if) the system properties boolean state XrSystemHandTrackingPropertiesEXT.supportsHandTracking is true.

Now, I asked Monado to simply NOT enumerate XR_EXT_HAND_TRACKING_EXTENSION_NAME on platforms that don't actually support hand tracking (duh?), but that's not what the specs say. And specs compliance matters, even if those specs are poorly conceived and designed, which I believe they are.

Anyway, what would be great is to fix the isHandTrackingSupported() in this repo to use the system props value, and split it into a isHandTrackingEnumerated() separate function, which is necessary but not sufficient.

On the Monado side of things I also believe they are mistaken when they enumerate a feature the hardware or software doesn't support. It should behave the same as Quest and clearly, following the OpenXR specs to the letter isn't great when the specs are somewhat confusing or ambiguous. But it makes no sense to me at all to enumerate a feature that isn't supported in the first place. Ever.

BattleAxeVR avatar Jul 26 '24 03:07 BattleAxeVR