1

I am working on an app that performs face recognition on the Hololens 2 using Unity 2021.3.4f1. I'm having trouble debugging with the Hololens while everything works fine when I'm running the app via the editor.

Basically, I take a picture and save it to disk (as in this tutorial) and it should then be read and used by azure's face detection client like so:

        using (Stream faceimagestream = File.OpenRead(filepath))
        {
            detectedFaces = await client.Face.DetectWithStreamAsync(
                faceimagestream, 
                returnFaceAttributes: features, 
                detectionModel: DetectionModel.Detection01, 
                recognitionModel: recognitionModel);
        }

The exception I get when the app stops is an access violation in a reading process, though I already included the capabilities "Picture Library" and "Removable Storage" (as suggested here) in Unity.

However, I cannot really debug anything because debugging stops automatically and I get a "openxr_runtime_debugger.pdb not loaded" screen. I am already using the microsoft symbolserver to search for .pdbs, but it seems like it is nowhere to be found. I also cannot find any information about this specific .pdb file. The only other cue that I have that may have something to do with this issue is a warning in Unity : "Importer(NativeFormatImporter) generated inconsistent result for asset(guid:6475d5bfdd00d214fbd2816e4c83512a) "Assets/XR/Settings/Open XR Package Settings.asset"". It appears after every build, even though I reimported all assets, deleted the library folder, updated the Unity Version from 2020.3.22 to 2021.3.4.

This is the error in Visual Studio: This is the error in Visual Studio

Update:

It seems to work sometimes (!) if I delete the unity build folder before building again AND delete the app on the Hololens.

More debugging information about loading symbols: enter image description here

Leado
  • 25
  • 6
  • 1
    "rebuild the very first time." -> Does it mean rebuilding the Unity Project or Visual Studio Project. Have you tried to delete the Unity Project build folder? You may also try to enable the "Copy PDB files" in Unity player settings to see if this issue can be reproduced. – Seth DU - MSFT Jun 23 '22 at 09:18
  • Thanks for the comment! With rebuilding I referred to the Unity project. I haven't actually tried to rebuild only the VS Project, BUT I enabled the copy pdb files option in the build settings and as far as I could test during the last 40 minutes, the error didn't show up anymore! – Leado Jun 23 '22 at 10:04
  • 1
    @SethDU-MSFT Sorry, nevermind. Maybe there is not even a connection between (re)building/deleting build folder/deleting app on hololens, because I even found a case where the error occured doing all of this (though a minute later than usual). However, it would be helpful to know where to find the information from the "copy pdb files" option. – Leado Jun 23 '22 at 11:49

2 Answers2

0

The solution was to switch back to the MRTK "DefaultHololens2ConfigurationProfile".

Leado
  • 25
  • 6
0

so for this i actually found the issue was within the project settings under the openxr screen you can turn off the runtime Debugger it fixes the issue especially if you need the spatial awareness options

In project settings xr plug-in management openxr turn off the runtime debugger

enter image description here

Wayne Birch
  • 645
  • 6
  • 18
Grump
  • 1