Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a package dependency instead of querying for OpenXR #25012

Closed
jdm opened this issue Dec 2, 2019 · 6 comments
Closed

Use a package dependency instead of querying for OpenXR #25012

jdm opened this issue Dec 2, 2019 · 6 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Dec 2, 2019

This will let us remove the restricted capability. cc @paulrouget

Instead of using packageQuery, you can add a PackageDependency to the AppxManifest and the Store will ensure the OpenXR framework is installed:
    <PackageDependency Name="Microsoft.WindowsMixedReality.Runtime" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" MinVersion="0.0.1.0" />

    We use this mechanism to get the framework installed on desktop for Mixed Reality
@jdm jdm added the P-windows label Dec 2, 2019
@jdm jdm added this to To do in UWP port via automation Dec 2, 2019
@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Dec 3, 2019

I've tried that.

But from my testing, it doesn't work when the app is sideloaded (from Visual Studio or from the Device Portal). My guess is that it only installs the dependency when installed from the store?

Let me see what if that's true.

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Dec 3, 2019

Updating the appxmanifest and cleaning the solution is not enough. The GeneratedFiles directory needs to be deleted too.

This, at least, make it so the dependency is properly declared in the final package.

I haven't tested yet.

@jdm jdm added this to To do in Microsoft app store Dec 4, 2019
@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Dec 5, 2019

@jdm can you try this on the emulator? For some reason I can't get my emulator to work anymore.

Before building, it's important to do a mach clean, or just deleted all the generated files under support/hololens/.

The warning prompt will likely still show up, it's normal. Do not install anything and try to run a demo.

diff --git a/support/hololens/ServoApp/Package.appxmanifest b/support/hololens/ServoApp/Package.appxmanifest
index c366444f8f..26c876f473 100644
--- a/support/hololens/ServoApp/Package.appxmanifest
+++ b/support/hololens/ServoApp/Package.appxmanifest
@@ -15,6 +15,7 @@
   </Properties>
   <Dependencies>
     <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+    <PackageDependency Name="Microsoft.WindowsMixedReality.Runtime" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" MinVersion="0.0.1.0" />
   </Dependencies>
   <Resources>
     <Resource Language="x-generate" />
@jdm
Copy link
Member Author

@jdm jdm commented Dec 5, 2019

I deleted all of support/hololens, did a git reset --hard, then built and ran in the emulator. When I loaded one of the demos from the homepage and pressed the Enter XR button, I got:

analog\input\xrruntime\dll\runtimelocator.cpp(94)\MixedRealityRuntime.dll!00007FFF3E0965DD: (caller: 00007FFF3E098760) Exception(1) tid(11e0) 80070002 The system cannot find the file specified.
    Msg:[Failed to locate runtime library] CallContext:[\LoaderNegotiate] 
Exception thrown at 0x00007FFF53EEA839 in ServoApp.exe: Microsoft C++ exception: wil::ResultException at memory location 0x0000004476DF74B0.
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : RuntimeInterface::LoadRuntime skipping manifest file C:\Windows\System32\MixedRealityRuntime.json, negotiation failed with error -6
'ServoApp.exe' (Win32): Unloaded 'C:\Windows\system32\MixedRealityRuntime.dll'
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - failed to find a valid runtime
Error [GENERAL | xrCreateInstance | OpenXR-Loader] : Failed loading runtime information
'ServoApp.exe' (Win32): Unloaded 'P:\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.27323.0_x64__8wekyb3d8bbwe\vcruntime140_1_app.dll'
'ServoApp.exe' (Win32): Unloaded 'U:\USERS\DefaultAccount\AppData\Local\DevelopmentFiles\1d265729-8836-4bd3-9992-4cb111d1068bVS.Debug_x64.image\openxr_loader.dll'
RUST: WARN - webxr_api::registry - XR device error BackendSpecific("ERROR_INSTANCE_LOST")
@jdm
Copy link
Member Author

@jdm jdm commented Dec 5, 2019

According to our contacts, the PackageDependency doesn't trigger when installing to the emulator via Visual Studio.

@jdm
Copy link
Member Author

@jdm jdm commented Dec 5, 2019

That being said, the latest emulator image installed from https://docs.microsoft.com/en-us/windows/mixed-reality/using-the-hololens-emulator (10.0.18362.1034) contains an appropriate openxr runtime (although the existing warning message still appears) that allows me to enter immersive mode. I think the PackageDependency will be good for people sideloading or installing from the store, and anybody developing locally and deploying with visual studio should just be sure to update to the most recent emulator issue.

@jdm jdm moved this from To do to In progress in Microsoft app store Dec 6, 2019
UWP port automation moved this from To do to Done Dec 10, 2019
@jdm jdm moved this from In progress to Done in Microsoft app store Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
UWP port
  
Done
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.