Search Unity

Feature Request Form Factor Unavailable Reloading

Discussion in 'AR' started by holo-aidan, Dec 13, 2022.

  1. holo-aidan

    holo-aidan

    Joined:
    Aug 4, 2021
    Posts:
    5
    Hi,

    I am writing a custom OpenXR runtime to support a remotely connected device. The connection to the remote device is handled within the XrInstance and whilst establishing the connection, calls to xrGetSystem will return XR_ERROR_FORM_FACTOR_UNAVAILABLE. Once established, this will return XR_SUCCESS, if the system information is supported, to continue to create the session and begin rendering.

    The current verified version of Unity's OpenXR Plugin (V1.5.3) handles this return slightly differently. Instead, if a form factor is unavailable it will destroy the instance, unload the runtime, and start from the beginning again (load runtime, create instance, get system). I do not believe this is necessary as the OpenXR documentation states "A return of XR_ERROR_FORM_FACTOR_UNAVAILABLE indicates the form factor is supported but temporarily unavailable; the application may retry xrGetSystem". Additionally, the overview flow chart illustrates that if XR_FORM_FACTOR_UNAVAILABLE is returned, the application should continue to retry xrGetSystem.

    Retrying xrGetSystem, instead of destroying and recreating the instance, would allow runtime developers to carry out additional asynchronous work within the XrInstance before the system is available, such as waiting for a remote device connection.

    Thanks,

    Aidan
     
    AcKeskin likes this.
  2. AcKeskin

    AcKeskin

    Joined:
    Oct 8, 2020
    Posts:
    27
    I am also having this issue.
     
  3. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    Update for followers of this thread: In December I reached out to our OpenXR team with @holo-aidan's note. They have accepted your feature request and are working on this.
     
    AcKeskin and holo-aidan like this.
  4. holo-aidan

    holo-aidan

    Joined:
    Aug 4, 2021
    Posts:
    5
    Thanks for the response, it's good to hear the request has been accepted!

    Will this thread be updated with the progress of the feature request or is there any other platform to track the progress?
     
  5. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    We don't have a mechanism for folks to track progress of our feature development work, but I've asked them to update this thread with the version number(s) where this work will land once they are ready to merge.
     
    holo-aidan likes this.
  6. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    Any update on this?
     
  7. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    This work has been merged and will be released in version 1.7 of our OpenXR package.
     
    holo-aidan and funkyCoty like this.
  8. aquadragon3d

    aquadragon3d

    Unity Technologies

    Joined:
    Sep 20, 2021
    Posts:
    11
    Hi, wanted to update that OpenXR 1.7 has been released. We added a flag OpenXRRuntime.retryInitializationOnFormFactorErrors that if enabled, will retry xrGetSystem if it throws a form factor unavailable error during initialization. Setting this flag to true should get the functionality you're looking for. Please let us know if you have any additional issues. Thanks!
     
    andyb-unity and holo-aidan like this.
  9. holo-aidan

    holo-aidan

    Joined:
    Aug 4, 2021
    Posts:
    5
    @aquadragon3d thanks for the update and the work on this feature request. I will give this a go and let you know if I have any further issues. Thanks again!
     
  10. holo-aidan

    holo-aidan

    Joined:
    Aug 4, 2021
    Posts:
    5
    Hi, I've now had a chance to try out the new flag and unfortunately this does not have the intended behaviour as was described in my initial feature request. With the flag set to true, Unity loads the runtime, creates the instance, calls xrGetSystem, destroys the instance, unloads the runtime and starts again. As per the original request, this does not allow me to do connection establishment within the instance while the application waits for xrGetSystem to return XR_SUCCESS. If the instance is destoryed, and the runtime unloaded, I have a very short window for the remote device to be able to connect and provide it's form factor.

    My preferred process would be for when xrGetSystem returns XR_ERROR_FORM_FACTOR_UNAVAILABLE, a short wait is introduced and xrGetSystem is retried until XR_SUCCESS is returned (or the user closes the application). This process is described within the OpenXR specification here and illustrated on the diagram here.