Using Pulse On Magic Leap

I’m trying to run pulse on Magic Leap but the software is running into an issue when it comes to opening the PulseC.so file. I’m using Unity and the package from the Unity Asset Store. The error only occurs when the app is built, everything works correctly when running through the editor.

Hi Roel,

So, what is your unity target for the magic leap?
I usually just build a regular executable on windows and the build directory pretty much looks like the project space.

It looks like the ‘package’ is ok, and its loading the PulseC.so, but its not of the correct machine type.

I have not looked into the magic leap at all and what kind of OS/platform it is running, but I suspect we are going to have to build a pulse library according to the leap target platform.

I will have to look into this, but if you can point me to any doc/site/info, that would help

Will get back to you!

Thanks!

I’m on Unity 2019.2.0f1 and the latest version of Magic Leap v.22. I’ve searched online to see what the errors could mean but couldn’t find anything.

It looks like the magic leap has it’s own custom os and I’ll need to cross compile pulse to that to get it on there

That’s true. It runs Lumin which I believe it built upon Android.

Is there a timeline on when you expect to do a cross compile for the Lumin OS?

I am currently presenting a poster at Defense Tech this week

I was able to grab the Lumin Tools provided on the website
I need to dig into the details and consult with a colleague at Kitware who has some experience cross compiling for the Magic Leap. I plan on meeting up with him next week to discuss what he did.

From there I should have a good plan to get a Pulse library built for Lumin

Awesome. Thanks.

I finally got Pulse cross compiled (windows->lumin) complete.
I do not have a Magic Leap to test this on, here is the PulseC.so

You should be able to replace the PulseC.so provided in the Unity Package (for Ubuntu), with this new PulseC.so and hopefully it works out of the box!

Let me know how it goes!

Thanks, I’ll give the new PulseC a try right now and let you know how that goes.

I updated the PulseC.so file but I’m still getting an error. Have you tried running Pulse on Android before. I wonder if it works on Android it might also work on Magic Leap since Lumin is based on Android.

10-17 08:00:08.726 1592 4 W Unity : Plugins: Couldn’t open /package/bin/PulseC.so, error: dlopen failed: cannot locate symbol “__android_log_write” referenced by “/package/bin/PulseC.so”…
10-17 08:00:08.726 1592 4 W Unity : System.Diagnostics.StackTrace:init_frames(Int32, Boolean)
10-17 08:00:08.726 1592 4 W Unity : System.Diagnostics.StackTrace:.ctor(Int32, Boolean)
10-17 08:00:08.726 1592 4 W Unity : UnityEngine.StackTraceUtility:ExtractStackTrace()
10-17 08:00:08.726 1592 4 W Unity : UnityEngine.GridLayout:DoNothing()
10-17 08:00:08.726 1592 4 W Unity : UnityEngine.GridLayout:DoNothing()
10-17 08:00:08.726 1592 4 W Unity : UnityEngine.GridLayout:DoNothing()
10-17 08:00:08.726 1592 4 W Unity : PulseEngine:Deallocate(IntPtr)
10-17 08:00:08.726 1592 4 W Unity : PulseEngine:Finalize()
10-17 08:00:08.726 1592 4 W Unity : Sirenix.Serialization.BaseFormatter1:SerializeImplementation(T&, IDataWriter) 10-17 08:00:08.726 1592 4 W Unity : UnityEngine.GridLayout:DoNothing() 10-17 08:00:08.726 1592 4 W Unity : UnityEngine.GridLayout:DoNothing() 10-17 08:00:08.726 1592 4 W Unity : UnityEngine.GridLayout:DoNothing() 10-17 08:00:08.726 1592 4 W Unity : UnityEngine.GridLayout:DoNothing() 10-17 08:00:08.726 1592 4 W Unity : UnityEngine.Playables.PlayableDirector:SendOnPlayableDirectorStop() 10-17 08:00:08.726 1592 4 W Unity : UnityEngine.Playables.PlayableDirector:SendOnPlayableDirectorStop() 10-17 08:00:08.726 1592 4 W Unity : 10-17 08:00:08.726 1592 4 W Unity : [.\Runtime/Misc/Plugins.cpp line 282] 10-17 08:00:08.726 1592 4 W Unity : (Filename: .\Runtime/Misc/Plugins.cpp Line: 282) 10-17 08:00:08.726 1592 4 W Unity : 10-17 08:00:08.829 1592 4 E Unity : DllNotFoundException: Unable to load DLL 'PulseC': The specified module could not be found. 10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0 10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0 10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0 10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0 10-17 08:00:08.829 1592 4 E Unity : at PulseEngine.Deallocate (System.IntPtr pulse) [0x00000] in <00000000000000000000000000000000>:0 10-17 08:00:08.829 1592 4 E Unity : at PulseEngine.Finalize () [0x00000] in <00000000000000000000000000000000>:0 10-17 08:00:08.829 1592 4 E Unity : at Sirenix.Serialization.BaseFormatter1[T].SerializeImplementation (T& value, Sirenix.Serialization.IDataWriter writer) [0x00000] in <00000000000000000000000000000000>:0
10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
10-17 08:00:08.829 1592 4 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0

I pushed up a new Pulse.so in my Magic Leap folder here
https://data.kitware.com/#collection/59849c788d777f7d33e9c084/folder/5da739bfd35580e6dc9e9cc5

This android_log deal is needed for the protobufs, I am supposed to link with the -log to get it to incorporate those methods into our binaries.

It looks like I only added that linker flag to executables and not shared objects in the magic leap toolchain file. I added it and built again. Here’s hoping this works.

(I would think the linker would have barfed on me before with out the -log, but it didn’t…)

Looks like Pulse is running on the Magic Leap now and not giving any errors. The only thing now is that it returns 0 or NaN for all the data fields. Trying to figure out why this is happening.

Progress!

Are you running the default Pulse Example?
Or is it your own code? Maybe pulse is not loading a state properly?
Did you replace the states with the states in the provided zip?

Had forgotten to update the state files. Everything is working perfectly now.

1 Like

Awesome!

Those states and that new PulseC.so have our new secondary baroreceptor model in them!
So hemorrhage effects are more accurate now (still working on adding shock)

That’s great to hear as hemorrhage is one of the most important ones for us.

That’s awesome :star_struck: When do we get to release this in the Unity Asset?

@Roel_Palloj: congrats on being our new to-go beta tester now :wink: Glad to see this worked for you!