Giter Club home page Giter Club logo

openxr-mixedreality's Introduction

OpenXR Samples for Mixed Reality Developers

This repository contains OpenXR code samples tailored for developers who are familiar with and using the Visual Studio toolchain, e.g. HoloLens 2 developers.

These OpenXR samples use C++17 and D3D11. The same source code works across UWP applications running on HoloLens 2 and Win32 applications running on Windows Desktop with Windows Mixed Reality immersive headsets.

Prepare, build and run the samples

OpenXR preview extensions

The openxr_preview folder contains an additional openxr_msft_preview.h header to offer the following OpenXR extensions that are only available in preview runtime.

  1. XR_EXT_user_presence
  2. XR_MSFT_scene_marker

Please send feedback on preview extensions and samples at GitHub issues. We are planning to incorporate your feedback and finalize these extensions as vendor extensions (MSFT) or cross-vendor extensions (EXT) in the central Khronos OpenXR headers and spec over the coming months.

OpenXR samples and extension usages

OpenXR app best practices for HoloLens 2

The BasicXrApp demonstrates the best practices for an OpenXR app to achieve full frame rate and low latency.

For more detailed information on getting the best visual quality and performance on HoloLens 2, see the best practices for HoloLens 2.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

openxr-mixedreality's People

Contributors

brycehutchings avatar chrisfromwork avatar codereclaimers avatar dgough avatar kbonds avatar mbucchia-msft avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar thetuvix avatar yl-msft avatar zowua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openxr-mixedreality's Issues

Compiling Issue

I loaded up the solution and tried to compile the program. It did compile successfully, but when I ran the program, I got an error.
This is what I got:

Unhandled exception at 0x00007FF9A8F1A388 in BasicXrApp_win32.exe: Microsoft C++ exception: std::logic_error at memory location 0x0000008AAE9CEED8. occurred

How to fix? I am trying to understand how to use OpenXR via this example, but am stuck. Thanks in advance! (Using VS2017 btw)

Deploying an app to the HoloLens Emulator Error

Error 1: Severity Code Description Project File Line Suppression State Error DEP6100: The following unexpected error occurred during bootstrapping stage 'Connecting to the device 'cda37a5e-99ea-de7d-cd42-0bb8e7cd59ad'.': NullReferenceException - Object reference not set to an instance of an object. [0x80004003] BasicXrApp_uwp

Error 2: Severity Code Description Project File Line Suppression State Error DEP0300: Emulator 'HoloLens 2 Emulator 10.0.20346.1002' failed to launch after 300 seconds. BasicXrApp_uwp

Howto access presence/proximity sensors of windows mixed reality HMDs?

Hello,
I'm trying to access the proximity sensor of a HDM using the windows mixed reality openxr runtime to determine if the headset is currently worn or not.

It is possible with the windows mixed reality plugin for SteamVR. There is a "windows mixed reality HMD" device and it has a proximity sensor control that can be mapped to a button like action. So the plugin for steam vr somehow can access the proximity sensor but I didn't find any way to do this via openxr. Is there a way to do this?

I'm sorry if this is not the right place to ask about this. But any help or a tip where to aks this question would be highly appreciated.

Thanks!

HoloLens 2 Direct3D 12 performance considerations

Hi,

As HoloLens 2 OpenXR runtime reports XR_KHR_D3D12_enable extension as supported, I gave it a try adjusting the hello_xr sample from Khronos group to have it running on HoloLens 2 device using either D3D11 or D3D12 API. There's a noticeable drop in performances switching from D3D11 to D3D12: hologram display is far less smooth when moving the head left/right, up/down, for example. Is this something expected w.r.t. HoloLens 2 hardware? It's noteworthy that VPRT isn't implemented in the hello_xr sample, but its D3D11 version nevertheless seems to be on par, performance-wise, with the D3D11-only BasicXrApp sample in this repo that do implement VPRT.

Thanks.

QR codes not updating

I've been experimenting with the samples and also doing my own testing with a Unity-based project using the new XR_MSFTX_scene_marker extension in the preview runtime to detect QR codes.

I'm finding that XRSceneMarkerMSFT objects don't ever seem to update within an XR session. That is, the lastSeenTime and size properties remain constant even if the QR code remains in view (in which case I would expect lastSeenTime to always be recent) and its size is changing over time (in which case I would expect the size property to reflect the changes). This appears to be the case whether the code is first spotted during the session or whether it was an existing code that existed before the session and stuck around.

This can be verified by running the QR sample, resizing a virtual QR code on a screen and observing that the visualization does not change (other than location). When dropping back to the HoloLens shell the system QR code visualization (green outline) immediately becomes responsive to the size changes of the same QR code. Relaunch the sample and observe that the 'most recent' size is now reflected in the visualization but it will not change again (other than location).

Is this intended behaviour or perhaps a bug in the runtime?

BasicXrApp_uwp Error

I am just trying to run BasicXrApp and the app doesn't start and an error occurs.
The error says "Unable to activate Windows Store app. The activation request failed with error 'The app didn't start'"
What happened and how should I do?

Controller model extension with Reverb G2 controllers

Has the XR_MSFT_controller_model extension been tested with the HP Reverb G2 controllers? If so, is the glTF model returned by the Windows Mixed Reality runtime different than the model for the standard WMR controllers?

Thanks for the great samples!

Compatibility Issue with UnityEngine.Windows.Speech namespace ?

Hello, I'm posting this in a few places as I'm not sure exactly who is the culprit for this issue.

I'm making a VR training app and the target platform is Standalone>Windows. I'm using Unity 2020.3 and OpenXR. See below for specific versions.

I have a script that uses the UnityEngine.Windows.Speech namespace that lets me subscribe to the PhraseRecognizedDelegate OnPhraseRecognized event. ( this API is part of the UnityEngine.CoreModule.dll )

My Issue: Everything works great EXCEPT when I have WMR headset connected and the WMR Portal running with Mixed Reality OpenXR runtime.

I have tested that my voice commands DO work fine when running in editor (without WMR headset attached), as a built .exe (again without WMR headset attached), AND even works with Oculus Quest (via Link and the Oculus OpenXR runtime.)

My voice commands DO NOT work with either HP Reverb G1 or G2 and running the WMR portal and the Mixed Reality OpenXR runtime.

I have verified that the microphone device is working as I created a simple echo script that plays what the microphone hears back to me.

As another data point I have an older VR project that I built with Unity 2019.4 with the same target but that uses the Windows Mixed Reality plugin (not OpenXR). The voice commands DO work fine in that app.

So this kinda points me to some problem with the Mixed Reality OpenXR runtime as being compatible with the UnityEngine.CoreModule.dll and specifically with the UnityEngine.Windows.Speech namespace.

Any help with this would be appreciated. Thank you!

SW Versions:
Windows 11 Pro
Unity 2020.3.16
WMR Runtime 107.2109.10010
Packages Include:
XR Plugin Management 4.07
XR Interaction Toolkit 1.0.0-pre.5
OpenXR Plugin 1.2.8
Microsoft Plugins:
Mixed Reality OpenXR Plugin 1.0.2
Mixed Reality Input 0.9.2006
Microsoft Spatializer 1.0.196

Disable/Enable OpenXR Device during runtime

Describe the bug

Hi, I need to switch between mulitple devices during runtime (Desktop, HP Reverb G2 and Hololens 2). Currently, I'm working on the device switch between Desktop and VR. When I disable XR with StopXR() and try to enable it afterwards with StartXR(), then I'm not able to provide Inputs to the motion controllers anymore. The headset is working fine, I'm able to see the controllers but an input is not possible anymore. If there is any ohter way to do this, I would be happy about any advice.

For this I'm using the following code:

    `public void StartXR()
    {
        Debug.Log("Initializing XR...");

        XRGeneralSettings.Instance.Manager.InitializeLoaderSync();
        XRGeneralSettings.Instance.Manager.StartSubsystems();

    }

    public void StopXR()
    {
        Debug.Log("Stopping XR...");

        XRGeneralSettings.Instance.Manager.StopSubsystems();
        XRGeneralSettings.Instance.Manager.DeinitializeLoader();
        Debug.Log("XR stopped completely.");
    }`

I'm looking for something like InputSystem.RemoveDevice(inputDevice) and InputSystem.AddDevice(inputDevice).

Error message

After calling StartXR() (before that StopXR() was executed once) , then I stopped unity and after running unity again the follwing error occurs and inputs to the controller,which are implemented by the new input system, are not possible anymore:

Could not recreate input device 'HP HP Reverb G2 Controller OpenXR (XRInputV1)' with layout 'XRInputV1::HP::HPReverbG2ControllerOpenXR' and variants 'Default' after domain reload
UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[])

InvalidOperationException: Cannot find parent 'devicepose' of control 'devicepose/istracked' in layout 'XRInputV1::HP::HPReverbG2ControllerOpenXR'
UnityEngine.InputSystem.Layouts.InputDeviceBuilder.InsertChildControl (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variant, UnityEngine.InputSystem.InputControl parent, System.Boolean& haveChildrenUsingStateFromOtherControls, UnityEngine.InputSystem.Layouts.InputControlLayout+ControlItem& controlItem) (at Library/PackageCache/[email protected]/InputSystem/Devices/InputDeviceBuilder.cs:557)
UnityEngine.InputSystem.Layouts.InputDeviceBuilder.AddChildControlIfMissing (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.InputControl parent, System.Boolean& haveChildrenUsingStateFromOtherControls, UnityEngine.InputSystem.Layouts.InputControlLayout+ControlItem& controlItem) (at Library/PackageCache/[email protected]/InputSystem/Devices/InputDeviceBuilder.cs:508)
UnityEngine.InputSystem.Layouts.InputDeviceBuilder.AddChildControls (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.InputControl parent, System.Boolean& haveChildrenUsingStateFromOtherControls) (at Library/PackageCache/[email protected]/InputSystem/Devices/InputDeviceBuilder.cs:337)
UnityEngine.InputSystem.Layouts.InputDeviceBuilder.InstantiateLayout (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.Utilities.InternedString name, UnityEngine.InputSystem.InputControl parent) (at Library/PackageCache/[email protected]/InputSystem/Devices/InputDeviceBuilder.cs:193)
UnityEngine.InputSystem.Layouts.InputDeviceBuilder.InstantiateLayout (UnityEngine.InputSystem.Utilities.InternedString layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.Utilities.InternedString name, UnityEngine.InputSystem.InputControl parent) (at Library/PackageCache/[email protected]/InputSystem/Devices/InputDeviceBuilder.cs:102)
UnityEngine.InputSystem.Layouts.InputDeviceBuilder.Setup (UnityEngine.InputSystem.Utilities.InternedString layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.Layouts.InputDeviceDescription deviceDescription) (at Library/PackageCache/[email protected]/InputSystem/Devices/InputDeviceBuilder.cs:51)
UnityEngine.InputSystem.InputDevice.Build[TDevice] (System.String layoutName, System.String layoutVariants, UnityEngine.InputSystem.Layouts.InputDeviceDescription deviceDescription) (at Library/PackageCache/[email protected]/InputSystem/Devices/InputDevice.cs:678)
UnityEngine.InputSystem.InputManager.AddDevice (UnityEngine.InputSystem.Utilities.InternedString layout, System.Int32 deviceId, System.String deviceName, UnityEngine.InputSystem.Layouts.InputDeviceDescription deviceDescription, UnityEngine.InputSystem.InputDevice+DeviceFlags deviceFlags, UnityEngine.InputSystem.Utilities.InternedString variants) (at Library/PackageCache/[email protected]/InputSystem/InputManager.cs:1033)
UnityEngine.InputSystem.InputManager.RestoreDeviceFromSavedState (UnityEngine.InputSystem.InputManager+DeviceState& deviceState, UnityEngine.InputSystem.Utilities.InternedString layout) (at Library/PackageCache/[email protected]/InputSystem/InputManager.cs:3420)
UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)
UnityEngineInternal.Input.NativeInputSystem:Update(NativeInputUpdateType)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])

Furthermore, when I enable/disable XR multiple times I got multiple Instances of those devices as depicted in the image below. When I stop Unity and run Unity again those device duplicates stay. I need to restart unity or remove those device duplicates manually to get it work again:
switch_device

Expected Behavior

run Unity:
run_unity

stop Unity:
stop_unity

To reproduce

Steps to reproduce the behavior:

  1. Setup a Scene with Motion Controllers and HP Reverb enabled
  2. Set up a Second camera
  3. Script - Switch between the VR camera and the Second camera and using the above mentioned code snippet to enable/disable the VR Device
  4. Stop Unity and run Unity again

Your setup (please complete the following information)

  • Unity Version [2020.3.17f1]
  • MRTK Version [v2.7]
  • Mixed Reality OpenXR Plugin [Version 1.1.2]
  • OpenXR [Version 1.2.8]

Target platform (please complete the following information)

  • HP Reverb G2
  • WMR immersive
  • OpenXR

Thanks.

MicrosoftOpenXR Plugin for Unreal Holographic Streaming Crash in Packaged Build

Hello, I'm seeking help with getting an Unreal Project to behave better with Holographic Streaming.
There is ton's of different behavior occurring and I've just kind of concluded that functionality is broken for packaged UE5.0+ applications although it works in-editor VR preview.
This wasn't a problem until we upgrade from UE 4.27.2 to 5.0.0-5.0.3

Windows Mixed Reality Plugin works for a packaged game to use holographic streaming.
MicrosoftOpenXR Plugin does not work for a packaged game to use holographic streaming.

LogHMD: Error: Failed to create all visibility mask meshes for device/views. Abandoning visibility mask.

Assertion failed: PipelineState.bXrFrameStateUpdated

Please see:
https://forums.unrealengine.com/t/openxr-with-msft-remoting-crash-in-ue5-0-3/609163/3
microsoft/Microsoft-OpenXR-Unreal#79
microsoft/Microsoft-OpenXR-Unreal#82

Disabling WMR transition effect

Hey everyone! Hope you all are doing well :)

StereoKit apps load really fast! Faster than the transition effect the the WMR runtime plays when an app starts up! It would be nice if we could disable this effect, or significantly speed it up, or something.

In particular, when doing development I often use dotnet watch for fast iteration. Most changes will "just work" and hot reload while the app is still running, but "rude edits" will cause the app to rebuild and restart. When this happens, probably 90% of the time spent is just waiting for the load effect to finish. This could drastically improve iteration time for SK devs when working with the WMR runtime.

If you'd prefer this sort of feedback in another forum, just let me know where is best!

Failed writing shader header files

Hi, when trying to compile the samples, I get an error related to the shaders:

1>------ Build started: Project: pbr_uwp, Configuration: Debug ARM64 ------
1>failed writing F:\work\OpenXR-MixedReality\obj\Debug\ARM64\pbr_uwp\CompiledShaders\PbrPixelShader.h
1>failed writing F:\work\OpenXR-MixedReality\obj\Debug\ARM64\pbr_uwp\CompiledShaders\PbrVertexShader.h
1>failed writing F:\work\OpenXR-MixedReality\obj\Debug\ARM64\pbr_uwp\CompiledShaders\HighlightPixelShader.h
1>PbrResources.cpp
1>F:\work\OpenXR-MixedReality\shared\pbr\PbrResources.cpp(9,10): fatal error C1083: Cannot open include file: 'PbrPixelShader.h': No such file or directory
1>C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(482,5): error MSB4181: The "CompileXaml" task returned false but did not log an error.
1>Done building project "pbr_uwp.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any idea what's wrong?
The BasicXrApp compiles and runs on Hololens 2 without any problem. Which additional information do you need to help?

Some XrHandles can't be readily used in additional dlls that don't consume the openxr loader

class definitions for items like SpaceHandle use xr* functions that requiring linking against the loader lib. It would be great if these classes could be defined in a manner where xrGetInstanceProcAddr/function pointers can be used, so that these helper handles can be used in dlls that don't link against the loader lib/setup the openxr experience.

This isn't a blocking issue, folks can unblock themselves by using UniqueExtHandles + manually providing the destroy function obtained through xrGetInstanceProcAddr.

XR Error Path Unsupported w/ Pimax Crystal

Using Pimax Crystal and keep getting the following error upon app startup.

xrSuggestInteractionProfileBindings failed with XR_ERROR_PATH_UNSUPPORTED

Controllers are paired and running, and no other SteamVR apps running simultaneously. I swear I've tried everything and can't find any other discussions with this error. Any suggestions? Thank you in advance.

Research mode

Is it possible to access the research mode in OpenXR or does it need to be a WinRT project?

Building with 1.0.3 package has linking errors

When I tried upgrading the NuGet package in this project to the latest version, I received undefined symbols when linking for all of the extension APIs (eg. xrGetD3D11GraphicsRequirementsKHR).

113.2304.14003 Results in terrible image warping in DCS

Hey,

For the last week I've been trying to track down a new issue in DCS of clouds/scenery flickering and warping around massively in low light conditions. Making DCS unplayable for me. I've tried everything I could think of, including rolling back the version of DCS, to no help.

It turned out the issue was caused by the updated to 113.2304.14003.

I'm unsure exactly what new feature is causing this issue. But its definitely related to motion reprojection. Perhaps the new motion vector reprojection?

Whatever has changed has made the motion reprojection extremely unpleasant in DCS, specially when flying at night. It has also made my FPS much more unstable, with regular FPS dips for no reason. I unticked the "Use Latest Preview Runtime" in the OpenXR setttings and rolled back to 112.2211.2002, which has restored my previous performance and motion reprojection behavior.

Please consider adding toggle switches to allow us to enable or disable new reprojection techniques from within the OpenXR toolkit.

Thanks
Ben

12900KF - 64GB DDR5 - RTX 3090 - Reverb G2

Sample no longer works on older dx11 cards as it requires VPAndRTArrayIndexFromAnyShaderFeedingRasterizer

The check for VPAndRTArrayIndexFromAnyShaderFeedingRasterizer is after the CompileShader call which already fails so it is never executed. Even if it was, the message "This sample requires VPRT support. Adjust sample shaders on GPU without VRPT." isn't very helpful as adjust means just rewrite the entire thing to use a geometry shader.
For accesibility, as a basic sample the bar for entry shouldn't be this high. It's supposed to demo OpenXR, it doesn't need to be the world's fastest cube renderer. I would propose a switch to support older cards instead of outright failing.

OpenXR & Radeon 7900XTX & iRacing

When playing Iracing through openXR (mixed reality) the game flashes constantly in red in both eyes, makes its unplayable.
Not sure where and how to report this properly. Could be drivers issue? Or iracing implementation? Or openxr compatibility issue with new AMD cards?

Video: https://youtu.be/yoAwpAsAQ-4

Spatial Anchor Import/Export extension

In a previous preview runtime, an extension to import & export spatial anchors was present. This has however recently been removed from the repository.

Is there any chance it will make a return soon? For our application sharing spatial anchors between devices is a critical component and we would like to use the OpenXR extension.

Run-time error

I tried to run the SampleSceneWin32 sample but I got the following error:
Error [GENERAL | | OpenXR-Loader] : RuntimeManifestFile::FindManifestFiles - failed to find active runtime file in registry
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - unknown error
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - failed to find a valid runtime
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : Failed to find default runtime with RuntimeInterface::LoadRuntime()
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : Failed querying extension properties
Exception thrown at 0x00007FFA78B9A859 in SampleSceneWin32.exe: Microsoft C++ exception: std::logic_error at memory location 0x0000008646AFCE18.
[17-13-10.748871] (t:2f00): Unhandled Exception: XrResult failure [XR_ERROR_INSTANCE_LOST]
Origin: xrEnumerateInstanceExtensionProperties(layerName, 0, &extensionCount, nullptr)
Source: C:\temp\OpenXR-MixedReality-master\shared\XrUtility\XrEnumerate.h:25

Win32 sample app crashes on GTX 960 M as of commit #25

The full error that seems to be the cause of the crash is pasted below. I believe it has to do with the absence of a GPU feature (presumably VPRT) which is required as of commit #20. I also experience issues with the UWP app, but I have not yet confirmed that it's the same issue. Commit #19 functions on my machine and unblocks me for now.

D3D11 ERROR: ID3D11Device::CreateVertexShader: Shader uses ability to feed viewport and/or array index from any shader feeding the rasterizer, but the device does not support this. To check for support, check device caps via the CheckFeatureSupport() API [ STATE_CREATION ERROR #166: CREATEVERTEXSHADER_INVALIDSHADERBYTECODE]
Exception thrown at 0x00007FFB28F2A839 in BasicXrApp_win32.exe: Microsoft C++ exception: _com_error at memory location 0x00000046DBBDDED0.
Exception thrown at 0x00007FFB28F2A839 in BasicXrApp_win32.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000046DBBDDD38.

Why when run BasicXrApp on HoloLens 2 Emulator, It's black sreen?

I compile BasicXrApp on Visual Studio 2017 with Debug/x64, package it to BasicXrApp_uwp_1.0.0.0_x64_Debug.appx, then install it to HoloLens 2 Emulator through Device Portal, and start it. It seems to be launched successful, I can hear the sound, and see the animation, but after that, there is only a black screen on the HoloLens 2 Emulator.

I don't know how to make the HoloLens 2 emulator to show the BasicXrApp.
Any help would be appreciated!
start-basicxrapp-blackscreen

Extended provided samples to use additional external libraries

Hi all,
first of all, thanks a lot for providing this repo.

I am interested in building an app targeting the HoloLens2 that links several existing open source libraries, that are typically built via CMake. There is any existing recommendation or examples regarding this use case? I tried to modify the BasicXrApp provided in this repo to use external libraries provided by vcpkg in https://github.com/iit-danieli-joint-lab/idjl-hololens2-examples/tree/initial/BasicXrAppWithVcpkgDependencies , but I am not sure if this is the best way to proceed in this direction.

Thanks in advance!

Certificate could not be opened: TemporaryKey.pfx

On all the sample apps in Visual Studio 2019 Community edition, every build attempt fails with this error. Is there a work around, or do I have something wrong with my environment that I'm just not seeing?

HoloLens 2 PV camera's frame timestamps reference

Hi,

I want to locate with xrLocateSpace HoloLens 2 PV camera at given frame timestamps. But I don't know how to properly interop between camera timestamps and OpenXR runtime timestamps, such as predicted display times.

For HoloLens 2 PV camera, I'm using MediaFrameReference::SystemRelativeTime timestamps, defined as 100ns interval QPC time, so a fraction of a QPC value if I understand it correctly. Thanks to xrConvertWin32PerformanceCounterToTimeKHR from XR_KHR_win32_convert_performance_counter_time extension, I was hoping to convert the camera timestamps to OpenXR runtime XrTime timestamps for use with xrLocateSpace. But this doesn't work, i.e. I'm getting an invalid location.

Below are the logs of a running session where I'm outputting the timestamps of interest:

  • MediaFrameReference time is the timestamp returned as-is by MediaFrameReference::SystemRelativeTime in MediaFrameReader::FrameArrived event;
  • System QPC time is the timestamp returned by a call to QueryPerformanceCounter in MediaFrameReader::FrameArrived event;
  • System XrTime is the above timestamp converted to XrTime with xrConvertWin32PerformanceCounterToTimeKHR;
  • OpenXR predictedDisplayTime is OpenXR runtime XrTime timestamp.
MediaFrameReference time = 541897815709
System QPC time = 1040444504957
System XrTime = 54189817966510
OpenXR predictedDisplayTime = 54189878473400
OpenXR predictedDisplayTime = 54189895134200
MediaFrameReference time = 541898148908
System QPC time = 1040445144667
System XrTime = 54189851284739
OpenXR predictedDisplayTime = 54189911812200
OpenXR predictedDisplayTime = 54189928482900
MediaFrameReference time = 541898482108
System QPC time = 1040445778477
System XrTime = 54189884295677
OpenXR predictedDisplayTime = 54189945160400
OpenXR predictedDisplayTime = 54189961798100
MediaFrameReference time = 541898815307
System QPC time = 1040446429967
System XrTime = 54189918227447
OpenXR predictedDisplayTime = 54189978474100
OpenXR predictedDisplayTime = 54189995152100
MediaFrameReference time = 541899148507
System QPC time = 1040447063824
System XrTime = 54189951240833
OpenXR predictedDisplayTime = 54190011809100
OpenXR predictedDisplayTime = 54190028465800

If I pass to xrLocateSpace the timestamp returned by MediaFrameReference::SystemRelativeTime, the PV camera isn't located. Expected as it's a QPC time value.

Not shown in the logs, if I pass to xrLocateSpace the above timestamp converted to XrTime with xrConvertWin32PerformanceCounterToTimeKHR, the PV camera isn't located. The resulting XrTime timestamp appears to be based on a very different time reference than OpenXR predicted display time.

If I pass to xrLocateSpace the timestamp returned by the call to QueryPerformanceCounter in MediaFrameReader::FrameArrived event, the PV camera isn't located. Expected as it's a QPC time value.

But if I pass to xrLocateSpace the above timestamp converted to XrTime with xrConvertWin32PerformanceCounterToTimeKHR, the PV camera is successfully located.

I wish I could use the camera timestamp directly (using the appropriate adjustment and/or conversion, of course) rather than having to perform a call to QueryPerformanceCounter to generate a timestamp suitable for use with xrLocateSpace (once converted to XrTime). Any guidance on this or is calling QueryPerformanceCounter in MediaFrameReader::FrameArrived event the right approach? Otherwise, what am I doing wrong with the camera timestamps handling?

If you carefully look at the timestamps returned by MediaFrameReference::SystemRelativeTime, you'll notice there are roughly 1/100th of OpenXR runtime XrTime timestamps. And indeed, if I pass to xrLocateSpace the timestamps returned by MediaFrameReference::SystemRelativeTime multiplied by 100, the PV camera is successfully located. Is this 100 multiplier in any way correlated to the 100ns interval QPC time in MediaFrameReference::SystemRelativeTime documentation? In short, is it expected that I simply have to multiply by 100 the timestamps returned by MediaFrameReference::SystemRelativeTime to pass to xrLocateSpace without having to rely upon xrConvertWin32PerformanceCounterToTimeKHR at all? Does it mean that HoloLens 2 PV camera gives already-suitable-for-use-with-OpenXR timestamps? If yes, is this guaranteed to always be the case for all the WMR devices? What's then the purpose of XR_KHR_win32_convert_performance_counter_time extension?

Thanks.

Too much code is hidden in directory shared, away from sample sources to inhibit the study of the code

  • Most if not all primary code is hidden away in Shared, people who don't use MSVS instead VSC have a hard time following along with ctrl clicking to go to the source
  • Not everyone wants to develop with d3d on windows and your suggestion in the video upfront to define XR_USE_PLATFORM_WIN32 especially with mingw leads to IUnknown undefined errors and confusion
  • Main entry point of the program is not obvious, a lot of the code can be condensed very readably in a single file (outside of pch)
  • 3rd party libraries are in shared so I spent like 5-10 minutes checking for the official source for XrSceneLib and XrUtility but there wasn't any

This repo is a perfect example on why we have standards and conventions.

Is it possible to deploy Win32 applications in HoloLens2/emulator?

Is it possible to deploy and run win32 applications in HoloLens2 devices (or HoloLens2 Emulator).

Reading the MixedReality documentation indicates that it is supported both UWP and Win32 applications using OpenXR for creating Inmersive experiences, but I'm not sure if Win32 is only for Desktop experiences.

Best regards,
David Ávila

XrResult failure [XR_ERROR_PATH_UNSUPPORTED]

When running the BasicXrApp on the HP Reverb G2 an exception is raised:

  ERROR (OpenXR) : [xrSuggestInteractionProfileBindings] Suggested binding '/user/hand/right/input/trigger/value' is not supported by interaction profile '/interaction_profiles/hp/mixed_reality_controller'.
  Ausnahme ausgelöst bei 0x00007FFFD9624ED9 in BasicXrApp_win32.exe: Microsoft C++-Ausnahme: msxr::XrResultException bei Speicherort 0x000000D5D54FE268.
  Ausnahme ausgelöst bei 0x00007FFFD9624ED9 in BasicXrApp_win32.exe: Microsoft C++-Ausnahme: std::logic_error bei Speicherort 0x000000D5D54FE940.

I commented out the following block, then the application works:

            if (m_optionalExtensions.HPMRControllerSupported)
            {
                std::vector<XrActionSuggestedBinding> bindings;
                bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/right/input/trigger/value")});
                bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/left/input/trigger/value")});
                bindings.push_back({m_poseAction.Get(), GetXrPath("/user/hand/right/input/grip/pose")});
                bindings.push_back({m_poseAction.Get(), GetXrPath("/user/hand/left/input/grip/pose")});
                bindings.push_back({m_vibrateAction.Get(), GetXrPath("/user/hand/right/output/haptic")});
                bindings.push_back({m_vibrateAction.Get(), GetXrPath("/user/hand/left/output/haptic")});
                bindings.push_back({m_exitAction.Get(), GetXrPath("/user/hand/right/input/squeeze/value")});
                bindings.push_back({m_exitAction.Get(), GetXrPath("/user/hand/left/input/squeeze/value")});

                XrInteractionProfileSuggestedBinding suggestedBindings{XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING};
                suggestedBindings.interactionProfile = GetXrPath("/interaction_profiles/hp/mixed_reality_controller");
                suggestedBindings.suggestedBindings = bindings.data();
                suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size();
                CHECK_XRCMD(xrSuggestInteractionProfileBindings(m_instance.Get(), &suggestedBindings));
            }

            // Set up suggested bindings for the microsoft/hand_interaction profile.
            if (m_optionalExtensions.MsftHandInteractionSupported)
            {
                std::vector<XrActionSuggestedBinding> bindings;
                bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/right/input/select/value")});
                bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/left/input/select/value")});
                bindings.push_back({m_poseAction.Get(), GetXrPath("/user/hand/right/input/grip/pose")});
                bindings.push_back({m_poseAction.Get(), GetXrPath("/user/hand/left/input/grip/pose")});
                bindings.push_back({m_exitAction.Get(), GetXrPath("/user/hand/right/input/squeeze/value")});
                bindings.push_back({m_exitAction.Get(), GetXrPath("/user/hand/left/input/squeeze/value")});

                XrInteractionProfileSuggestedBinding suggestedBindings{XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING};
                suggestedBindings.interactionProfile = GetXrPath("/interaction_profiles/microsoft/hand_interaction");
                suggestedBindings.suggestedBindings = bindings.data();
                suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size();
                CHECK_XRCMD(xrSuggestInteractionProfileBindings(m_instance.Get(), &suggestedBindings));
            }

Are these controls supposed to be supported by the HP Reverb G2? In case not, the code should check for the device and probably not call the functions.

BasicXrApp::RenderFrame nearly always fails

Platform is Dell 5577 gaming laptop + IIG 630 + nVidia GTX1050 + Win10 1903. Latest video driver installed.
Building from this repo with VS 2019 + vcpkg.

The app has run successfully once, after a reboot. Every other time it has immediately failed with debug message

Unhandled Exception: XrResult failure [XR_ERROR_RUNTIME_FAILURE]
Origin: xrEndFrame(m_session.Get(), &frameEndInfo)
Source: D:\Packages\OpenXR-MixedReality\samples\BasicXrApp\OpenXrProgram.cpp:662

On this same system, Microsoft Edge always fails to enter VR -- it shows the 'launching VR' splash then reverts to flat display (but believes it is still in VR mode). The 'OpenXR Developer Tools' app fails to show anything, but also gives no error indication and seems to think it is working .

SteamVR apps run normally, so I suspect some incompatibility in the WMR OpenXR runtime.

I hope you can help me resolve this

Image files in samples/BasicXrApp/Assets/ broken, prevent build

Hello!

The PNG image files in samples/BasicXrApp/Assets/ are corrupted which prevents building the BasicXrApp.

1>Package.appxmanifest(36,9): error APPX1618: App manifest references the square 150x150 logo image 'Assets\Square150x150Logo.scale-200.png' which is not a valid image file.
1>Package.appxmanifest(40,26): error APPX1618: App manifest references the wide 310x150 logo image 'Assets\Wide310x150Logo.scale-200.png' which is not a valid image file.
1>Package.appxmanifest(37,9): error APPX1618: App manifest references the small logo image 'Assets\Square44x44Logo.scale-200.png' which is not a valid image file.
1>Package.appxmanifest(37,9): error APPX1618: App manifest references the small logo image 'Assets\Square44x44Logo.targetsize-24_altform-unplated.png' which is not a valid image file.
1>Package.appxmanifest(19,6): error APPX1618: App manifest references the store logo image 'Assets\StoreLogo.png' which is not a valid image file.
1>Package.appxmanifest(41,27): error APPX1618: App manifest references the splash screen image 'Assets\SplashScreen.scale-200.png' which is not a valid image file.

These "image files" are actually text files with contents like:

version https://git-lfs.github.com/spec/v1
oid sha256:a41a053b3fc3b0c109720ccd437a19725ae9163ea75990222a12b596b9c7ca76
size 1430

Best regards,
Max

after update 107.2106.1002.0 runtime, scene understanding extenstion doen not work

sorry my english is very not good.

#define XR_MSFT_SCENE_UNDERSTANDING_PREVIEW3_EXTENSION_NAME "XR_MSFT_scene_understanding_preview3"

extension initialization failed.

so i tried like this "#define XR_MSFT_SCENE_UNDERSTANDING_PREVIEW3_EXTENSION_NAME "XR_MSFT_scene_understanding_preview"

extension initialization succeed. but scene understanding example still does not working.

i think scene understanding api may be changed. looks like scene understanding example broken.

plz help...

OpenXR Tools for Windows Mixed Reality should not be sandboxed

The sandboxing means that OpenXR Tool's information does not reflect the user's real configuration, so can be a very misleading debugging tool.

Missing API layers

OpenKneeboard by default installs an OpenXR API layer via HKCU, to avoid unneeded elevation. OpenXR Tools will not include it in the list of API layers - for example, in this screenshot, OpenXR Toolkit is installed via HKLM and appears in both OpenXR tools and OpenXR Explorer, however OpenKneeboard is installed via HKCU and only shows up in OpenXR Explorer:

image

Unrepresentative ACLs

If an 'everyone'-readable/executable API layer is installed, but it is not readable by the restricted package users (which are not part of everyone), OpenXR Tools will hard-fail - for example, if OpenKneeboard is set to install OpenXR for 'all users', the layer files are in C:\ProgramData which does not have the restricted app ACLs, leading to this:

image

two header files missing

I had to add two header files to get BasicXrApp_win32 to compile:

In samples/BasicXrApp/CubeGraphics.cpp:
#include <list>

In samples/BasicXrApp/OpenXrProgram.cpp:
#include <unordered_map>

Cut & Paste error in XrExtensions.h

I think line 61 of XrExtensions.h should be #define FOR_EACH_SPATIAL_ANCHOR_EXPORT_FUNCTION(_) -

The projects don't build with the current version of the openxr-sdk source as XR_MSFT_spatial_anchor_export_preview is not defined - this means that FOR_EACH_SPATIAL_ANCHOR_EXPORT_FUNCTION is never defined (due to the cut & paste error) so the FOR_EACH_EXTENSION_FUNCTION macro definition is invalid .

HoloLens 2 VIEW reference space and spatial graph node space origins

Hello,

When creating a VIEW reference space or a spatial graph node space to track HoloLens 2 PV camera [1], where is physically located the space "origin" on HoloLens 2 device? Is it still the left front VLC camera of the rigNode [2]?

Then, when locating HoloLens 2 VIEW "camera" space (using any of the above) in application space (Microsoft unbounded reference space) with xrLocateSpace, does the returned pose has to take into account the extrinsic transform from camera to rigNode origin, as was the case with the deprecated Perception API (code excerpt in Using Media Foundation section) [3]?

From my experiments, origins of VIEW reference space and spatial graph node space are different. But the observed difference doesn't match the camera's extrinsic transform, so can't really say where's the origin located.

Thanks for any input/suggestion/clarification.

[1] #88 (comment)
[2] https://arxiv.org/abs/2008.11239
[3] https://learn.microsoft.com/en-us/windows/mixed-reality/develop/native/locatable-camera-cpp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.