Uisng Pulse for HoloLens 2 with ARM platform build

Yeah, i’m also trying different things , i’ll let you know if i found any specific reason or information on it.
And i would like to thank you for sticking with me :slight_smile: Thanks.

so this is what i got in vs2019 debug window

Exception thrown at 0x771C9F3B in TestPulse.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x02C6DD98.
Exception thrown at 0x771C9F3B in TestPulse.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x02C6E350.
DllNotFoundException: Unable to load DLL ‘PulseC’: The specified module could not be found.
at Pulse.PulseEngine.Allocate (System.String log_filename, System.Boolean enable_cout, System.String data_dir) [0x00000] in <00000000000000000000000000000000>:0
at Pulse.PulseEngine…ctor (System.String log_filename, System.String data_dir) [0x00000] in <00000000000000000000000000000000>:0
at PulseEngineDriver.Start () [0x00000] in <00000000000000000000000000000000>:0

(Filename: currently not available on il2cpp Line: -1)

Setting up 2 worker threads for Enlighten.
Thread → id: fc8 → priority: 1
Thread → id: 1aa8 → priority: 1

You are actually building an executable and pushing it to the HoloLens right?
It seems like the package that you are building does not have everything it should have.
(i.e. the PulseC.dll)

Its not being found at all…or not being included in the built package

I have seen errors like:
Plugins: Failed to load ‘PulseC’ because one or more of its dependencies could not be loaded.
That means the dlls is there and found and is missing other dlls

But something is not configured right for PulseC to be included into the package…

this is the hierarchy when i open the solution file created by unity, to build it in Hololens 2
i can see the pulseC.dll is there but its in unity data.
do we have .net version of PulseC.dll , cause as my previous experience in Unity and Hololens .net dll’s works great for any platform .

Pulse is basically a (very large) math library written in C++
We provide a .NET API written in C# to interface with the C++
It’s not feasible to rewrite this completely in C#

I am not sure how to get the Unity Data project or if that looks right

When I build a UWP/IL2CPP (regular Windows target)
My built application folder looks like

And the PulseC.dll is located here

Is PulseC.dll still under a Plugins folder under your Assets folder?
(Note all the .NET Pulse dlls have been “compiled” into the executablevby IL2CPP)
But it cannot do that with native dlls, so the native dlll has to be known by the built unity application and put in the right spot by it.

Okay, so yes then these Dll files will not compiled by il2cpp right?
i can see the dll files in plugin folder and in main build folder .

and

Right, native DLLs should not be compiled or modified by IL2CPP

So that looks correct…

When you run your application,
You should get a few log files somewhere around here

The player.log might have something in it
And do you have any pulse logs?

i’m building this app in Hololens device so there is no log file in my PC.
so this is the only debug log i got in visual studio debug window .

[0.152727 / 7.501000] - Finishing first scene loading
[0.001222 / 7.502222] - First level loaded
[0.001039 / 7.503261] - PerformUpdateAndRender started
Windows Mixed Reality spatial locatability state changed to Active.

(Filename: C:\buildslave\unity\build\Runtime/VR/HoloLens/HoloLensWorldManager.cpp Line: 336)

UnloadTime: 6.142396 ms
Exception thrown at 0x776E9F3B in TestPulse.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x028CDFE8.
Exception thrown at 0x776E9F3B in TestPulse.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x028CE6A0.
DllNotFoundException: Unable to load DLL ‘PulseC’: The specified module could not be found.
at Pulse.PulseEngine.Allocate (System.String log_filename, System.Boolean enable_cout, System.String data_dir) [0x00000] in <00000000000000000000000000000000>:0
at Pulse.PulseEngine…ctor (System.String log_filename, System.String data_dir) [0x00000] in <00000000000000000000000000000000>:0
at PulseEngineDriver.Start () [0x00000] in <00000000000000000000000000000000>:0

(Filename: currently not available on il2cpp Line: -1)

Setting up 2 worker threads for Enlighten.
Thread → id: 1978 → priority: 1
Thread → id: 18cc → priority: 1

Where i can find the pulse logs?
can i add debug text somewhere in script to check any specific thing??

Pulse writes log files in the same location as unity
https://docs.unity3d.com/Manual/LogFiles.html

It still seems like the file is just not in the spot where unity expects it.
Which leads me to think that the PulseC.dll is not tagged with the right metadata.
Maybe ensure the ARM tag is 64 bit compatible? ARM64 or something?

I would try messing with the PulseC.dll meta data in Unity (checking various boxes to see if the right dll is getting associated correctly)
Something like:
https://docs.unity3d.com/Manual/PluginInspector.html?_ga=2.4744763.980682975.1584968255-1309518899.1565972938

yeah , you’re right , cause there is no ARM 64 option in unity only ARM , as i shown above.
and also in VS only x64, x86, and ARM. then i added ARM64 in build option and copied all dll’s in plugin folder then i got these errors when i tried to build to device.

I am not sure if you should manually add the ARM64
I am not sure if ARM is assumed to be x86 or not

You might try searching the unity forums or maybe the hololens has something in their documentation on configuring unity properly

Maybe there are some setting in the Player Settings that could help

Something like this?
https://answers.unity.com/questions/1627961/why-is-arm64-greyed-out-how-do-i-turn-it-back-on-t.html

Any chance that this Pulse dll has ARM86/ARM version of dll not the ARM64

I should be able to make one pretty easily
Give me a bit

Here is the ARM build of PulseC.dll
https://data.kitware.com/#collection/59849c788d777f7d33e9c084/folder/5e7a3b4baf2e2eed3569cbda

Actually i checked the old ARM64 plugin it works when i build it using latest unity version and ARM64 setting in Visual studio.
but the ARM32 is not working, and unfortunately i cant port my project to ARM64,
does it only works on ARM64?

The Managed Pulse dlls should work on any platform (ARM or Not, x86 or x64)

I build a ARM32 PulseC and put a link above for it.
Did that not load either?

yeah managed dll will work for all that is sure.
also ARM64 works with unity 2019 ARM64 build that i can confirm.

but the ARM32 is not as i’m getting same dll not found issue , and i need ARM32 only as my project is for ARM32.

i tried ARM32 with different versions of unity still didn’t work for me… :frowning:

As far as I know, I am building an ARM (x86) version.
I have installed support for both versions in MSVC

And am generating the proper visual studio type

It seems to be using the correct compiler:
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/arm/cl.exe

There is also a Hostx64/arm64, so that seems right…

But, in MSVC I noticed this option was set to x64… so I changed it to x86 and built

I have uploaded this new PulseC2.dll here
Just take the 2 off the name…

So I very well might not be properly creating a proper x86 dll
I am not too familiar with the ARM architecture.
I may need to build a ARM64 dll, and configure it to x86…
As I think ARM64 can run x86 built code…
The CPU target architecture is just not as intuitive to set as it is for regular windows builds…

If you can find any articles on properly configuring MSVC for compiling C++ to the architecture configuration project that fits your needs, that would be great!

Or I am just going to have to take a few more swings at settings myself… so try this out and let me know how that goes

Okay , so i just tested this dll and in addition i’m getting this line in VS

Loaded ‘U:\USERS\DefaultAccount\AppData\Local\DevelopmentFiles\Microsoft.MixedReality.WebRTC.UnityVS.Release_ARM.Anand.Mulay\PulseC.dll’. Module was built without symbols.
Unloaded ‘U:\USERS\DefaultAccount\AppData\Local\DevelopmentFiles\Microsoft.MixedReality.WebRTC.UnityVS.Release_ARM.Anand.Mulay\PulseC.dll’

Also i just remembered that when i used ARM64 in unity 2019 its CPU architecture was already ARM64
but when i open this latest dll i need to change it to ARM from x86 , cause unity itself detects the CPU architecture of the dll file.

I’ll also look more for the VS configuration thing for ARM architecture, and get back to you soon…
Thanks