EnoxSoftware / HoloLensWithOpenCVForUnityExample

HoloLens With OpenCVforUnity Example (Support for Hololens1 and Hololens2)
MIT License
259 stars 50 forks source link

App crash on launch when built with unity 2021 #52

Open pajama opened 1 year ago

pajama commented 1 year ago
Loading native plugins
  Loading opencv_objdetect470.dll
  Loading opencv_aruco470.dll
  Loading opencv_core470.dll
  Loading opencv_photo470.dll
  Loading opencv_bioinspired470.dll
  Loading opencv_ml470.dll
  Loading opencv_face470.dll
  Loading opencv_img_hash470.dll
  Loading opencv_xfeatures2d470.dll
  Loading opencv_bgsegm470.dll
  Loading opencv_imgproc470.dll
  Loading opencv_video470.dll
  Loading opencv_features2d470.dll
  Loading opencv_tracking470.dll
  Loading opencv_xphoto470.dll
  Loading opencv_flann470.dll
  Loading opencv_imgcodecs470.dll
  Loading opencv_plot470.dll
  Loading opencv_phase_unwrapping470.dll
  Loading opencv_highgui470.dll
  Loading opencv_structured_light470.dll
  Loading openxr_loader.dll
  Loading opencv_videoio470.dll
  Loading opencv_calib3d470.dll
  Loading opencv_videostab470.dll
  Loading opencv_ximgproc470.dll
  Loading opencvforunity.dll
Module information:
 Built with Compiler Ver '192829333'
 Built from '2021.3/staging' branch
 Version is '2021.3.19f1 (c9714fde33b6)'
 Master build
 Application type 'D3D'
 OS 'Windows 10 (10.0.20348) 64bit'
[Subsystems] Discovering subsystems at path C:/data/Programs/WindowsApps/contextual-ai-opencv_1.0.1.0_arm64__4tfzbvp8cd0t2/Data/UnitySubsystems
[Subsystems] No descriptors matched for  examples in UnitySubsystems/MicrosoftOpenXRPlugin/UnitySubsystemsManifest.json.
[Subsystems] 1 'inputs' descriptors matched in UnitySubsystems/MicrosoftOpenXRPlugin/UnitySubsystemsManifest.json
[Subsystems] No descriptors matched for  displays in UnitySubsystems/MicrosoftOpenXRPlugin/UnitySubsystemsManifest.json.
[Subsystems] 1 'meshings' descriptors matched in UnitySubsystems/MicrosoftOpenXRPlugin/UnitySubsystemsManifest.json
[Subsystems] No descriptors matched for  examples in UnitySubsystems/UnityOpenXR/UnitySubsystemsManifest.json.
[Subsystems] 1 'inputs' descriptors matched in UnitySubsystems/UnityOpenXR/UnitySubsystemsManifest.json
[Subsystems] 1 'displays' descriptors matched in UnitySubsystems/UnityOpenXR/UnitySubsystemsManifest.json
[Subsystems] No descriptors matched for  meshings in UnitySubsystems/UnityOpenXR/UnitySubsystemsManifest.json.
GfxDevice: creating device client; threaded=1; jobified=0
[XR] [6300] [09:04:12.474][Info   ] Available Layers: (0)
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: Qualcomm(R) Adreno(TM) 630 GPU (ID=0x45373230)
    Vendor:   Qualcomm
    VRAM:     1932 MB
Initialize engine version: 2021.3.19f1 (c9714fde33b6)
XRGeneral Settings awakening...
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.Management.XRGeneralSettings:Awake()

[Subsystems] Loading plugin UnityOpenXR for subsystem OpenXR Display...
[Subsystems] OpenXR XR Plugin successfully registered Provider for OpenXR Display
[Subsystems] OpenXR XR Plugin successfully registered Provider for OpenXR Input
[Subsystems] OpenXR XR Plugin successfully registered Provider for OpenXR Display
[XR] [6300] [09:04:13.292][Info   ] Available Layers: (0)
[Subsystems] Loading plugin UnityOpenXR for subsystem OpenXR Input...
[Subsystems] Loading plugin MicrosoftOpenXRPlugin for subsystem OpenXR Input Extension...
[Subsystems] OpenXR Extension successfully registered Provider for OpenXR Mesh Extension
[Subsystems] OpenXR XR Plugin successfully registered Provider for OpenXR Input
[Subsystems] OpenXR XR Plugin successfully registered Provider for OpenXR Display
[XR] [MROpenXR][Info   ][09:04:13.305165][tid:189c] MeshProvider_RegisterLifecycleProvider
[Subsystems] OpenXR Extension successfully registered Provider for OpenXR Input Extension
[Subsystems] OpenXR Extension successfully registered Provider for OpenXR Mesh Extension
[Subsystems] OpenXR XR Plugin successfully registered Provider for OpenXR Input
[Subsystems] OpenXR XR Plugin successfully registered Provider for OpenXR Display
[XR] [MROpenXR][Info   ][09:04:13.305414][tid:189c] InputProvider_RegisterLifecycleProvider
[XR] [MROpenXR][Info   ][09:04:13.305491][tid:189c] InputProvider_LifecycleInitialize
[Subsystems] Loading plugin MicrosoftOpenXRPlugin for subsystem OpenXR Mesh Extension...
[XR] [MROpenXR][Info   ][09:04:13.307565][tid:189c] MeshProvider_LifecycleInitialize
New input system (experimental) initialized
[XR] [MROpenXR][Info   ][09:04:13.351188][tid:189c] MicrosoftOpenXRPlugin_ReadHolographicWindowAttachment ReadSuccessfully=True
[XR] [MROpenXR][Info   ][09:04:13.357865][tid:1554] SetHolographicWindowAttachment_SpatialInteractionManagerCreated interactionManager=0x20A1B2F3590
[XR] [MROpenXR][Info   ][09:04:13.653836][tid:189c] XrViewConfigurationSettings_OnXrSessionCreated SupportedViewConfigType=XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO SupportedReprojectionModesCount=0
[XR] [MROpenXR][Info   ][09:04:13.653951][tid:189c] XrViewConfigurationSettings_OnXrSessionCreated SupportedViewConfigType=XR_VIEW_CONFIGURATION_TYPE_SECONDARY_MONO_FIRST_PERSON_OBSERVER_MSFT SupportedReprojectionModesCount=0
[XR] [MROpenXR][Info   ][09:04:13.653994][tid:189c] OnSessionCreated GraphicsAPI=XR_TYPE_GRAPHICS_BINDING_D3D11_KHR sessionCreationResult=XR_SUCCESS AppName=contextual-ai-opencv AppVersion=0.1 AppMode=AppMode openXRRuntimeName=Windows Mixed Reality Runtime openXRRuntimeVersion=112.2211.2002 APIVersion=1.0.25 PartA_PrivTags=33554432
The referenced script (Unknown) on this Behaviour is missing!
The referenced script on this Behaviour (Game Object '<null>') is missing!
A scripted object (probably Microsoft.MixedReality.Toolkit.XRSDK.Oculus.Input.OculusXRSDKDeviceManagerProfile?) has a different serialization layout when loading. (Read 72 bytes but expected 108 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
UnloadTime: 1.476823 ms
Unable to register IMixedRealityInputDeviceManager data provider (Windows Mixed Reality Device Manager) because the value of concreteType is null.
This may be caused by code being stripped during linking. The link.xml file in the MixedRealityToolkit.Generated folder is used to control code preservation.
More information can be found at https://docs.unity3d.com/Manual/ManagedCodeStripping.html.
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem:RegisterDataProviderInternal(Boolean, Type, String, SupportedPlatforms, Object[])
Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem:RegisterDataProvider(Type, String, SupportedPlatforms, Object[])
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:CreateDataProviders()
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:Initialize()
Microsoft.MixedReality.Toolkit.<>c:<InitializeAllServices>b__68_0(IMixedRealityService)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServicesInOrder(Action`1)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeAllServices()
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeServiceLocator()
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:RegisterInstance(MixedRealityToolkit, Boolean)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:Awake()

Unable to register IMixedRealityInputDeviceManager data provider (Windows Mixed Reality Eye Gaze Provider) because the value of concreteType is null.
This may be caused by code being stripped during linking. The link.xml file in the MixedRealityToolkit.Generated folder is used to control code preservation.
More information can be found at https://docs.unity3d.com/Manual/ManagedCodeStripping.html.
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem:RegisterDataProviderInternal(Boolean, Type, String, SupportedPlatforms, Object[])
Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem:RegisterDataProvider(Type, String, SupportedPlatforms, Object[])
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:CreateDataProviders()
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:Initialize()
Microsoft.MixedReality.Toolkit.<>c:<InitializeAllServices>b__68_0(IMixedRealityService)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServicesInOrder(Action`1)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeAllServices()
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeServiceLocator()
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:RegisterInstance(MixedRealityToolkit, Boolean)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:Awake()

[XR] [MROpenXR][Info   ][09:04:14.260074][tid:189c] OpenXRContext_OnEvent_XrEventDataSessionStateChanged EventType=XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED session=3 sessionState=XR_SESSION_STATE_IDLE
[XR] [6300] [09:04:14.260][Info   ] OpenXRSession::HandleSessionStateChangedEvent: state XR_SESSION_STATE_UNKNOWN->XR_SESSION_STATE_IDLE session=3 time=44038441166770
[XR] [MROpenXR][Info   ][09:04:14.260609][tid:189c] OpenXRContext_OnEvent_XrEventDataSessionStateChanged EventType=XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED session=3 sessionState=XR_SESSION_STATE_READY
[XR] [6300] [09:04:14.260][Info   ] OpenXRSession::HandleSessionStateChangedEvent: state XR_SESSION_STATE_IDLE->XR_SESSION_STATE_READY session=3 time=44038441178020
[XR] [MROpenXR][Info   ][09:04:14.261993][tid:189c] ViewConfigurationSettings_PrimaryStereoEnabled
[XR] [MROpenXR][Info   ][09:04:14.262277][tid:189c] ViewConfigurationSettings_OnSessionBegan_SecondaryBeginInfo EnabledSecondaryViewConfigurationCount=1
[XR] [MROpenXR][Info   ][09:04:14.262492][tid:189c] ViewConfigurationSettings_OnSessionBegan_EnabledSecondaryViewConfiguration EnabledSecondaryViewConfiguration=XR_VIEW_CONFIGURATION_TYPE_SECONDARY_MONO_FIRST_PERSON_OBSERVER_MSFT
[XR] [MROpenXR][Info   ][09:04:14.262666][tid:189c] LocatableCameraProvider_Registered
[XR] [MROpenXR][Info   ][09:04:14.278503][tid:189c] SetSceneOriginSpace nativeToken=HandTracking oldSpace=0 newSpace=4
[XR] [MROpenXR][Info   ][09:04:14.278633][tid:189c] SetSceneOriginSpace nativeToken=HoloLens oldSpace=0 newSpace=4
[XR] [MROpenXR][Info   ][09:04:14.278674][tid:189c] SetSceneOriginSpace nativeToken=Controller oldSpace=0 newSpace=4
[XR] [MROpenXR][Verbose][09:04:14.278859][tid:189c] MicrosoftOpenXRPlugin_OnSubsystemsStarting NativeLibToken=HandTracking
[XR] [MROpenXR][Info   ][09:04:14.278914][tid:189c] InputProvider_LifecycleStart
[XR] [MROpenXR][Verbose][09:04:14.279198][tid:189c] MicrosoftOpenXRPlugin_OnSubsystemsStarting NativeLibToken=HoloLens
[XR] [MROpenXR][Verbose][09:04:14.279254][tid:189c] MicrosoftOpenXRPlugin_OnSubsystemsStarting NativeLibToken=Controller
EnoxSoftware commented 1 year ago

Thanks for the report. Even my very simple test with a blank project resulted in a crash on startup. It appears that the problem is due to the version of Unity (2021.3.19f1). https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/known-issues#active-blocking-issues

When I built the project with Unity 2021.3.14f1 as a test, the problem did not occur.