LSL4Unity icon indicating copy to clipboard operation
LSL4Unity copied to clipboard

dlopen failed

Open tchemaly opened this issue 6 years ago • 9 comments

Although my app works on Unity, it is not working when I build it on the Magic Leap device. I have these errors in mldb:

Plugins: Couldn't open /package/bin/liblsl64.so, error: dlopen failed: "package/bin/liblsl64.so has unexpected e_machine: 62

DllNotFoundException: Unable to load DLL 'liblsl64': The specified module could not be found.

Note that: -my dlls are in Assets>LSL4Unity>Plugins -I have added the following condition to the LSL script in the dll class: #elif UNITY_ANDROID || PLATFORM_LUMIN const string libname = "liblsl64";

tchemaly avatar Dec 03 '19 01:12 tchemaly

I got the same error. Tried changing to liblsl32 but then it complains Plugins: Couldn't open /package/bin/liblsl32.so, error: dlopen failed: "/package/bin/liblsl32.so" is 32-bit instead of 64-bit

cwule avatar Dec 03 '19 05:12 cwule

Are any dependencies missing, i.e. what's the output of ldd /package/bin/liblsl64.so?

tstenner avatar Dec 03 '19 08:12 tstenner

$ ldd liblsl64.so 
 

ldd: warning: you do not have execution permission for ./liblsl64.so.  

linux-vdso.so.1 =>  (0x00007ffc22267000).  

librt.so.1 => /lib64/librt.so.1 (0x00007f344c1c3000).  

libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f344bebc000).  

libm.so.6 => /lib64/libm.so.6 (0x00007f344bbba000). 

libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f344b9a4000). 

libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f344b788000). 

libc.so.6 => /lib64/libc.so.6 (0x00007f344b3bb000). 

/lib64/ld-linux-x86-64.so.2 (0x00007f344c6f9000)

cwule avatar Dec 03 '19 22:12 cwule

I suspect an architecture mismatch. What's the output of file liblsl64.so?

tstenner avatar Dec 04 '19 12:12 tstenner

$ file liblsl64.so liblsl64.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=793a68998fa33198e0385039a13935d7afa1fbad, stripped

cwule avatar Dec 04 '19 17:12 cwule

liblsl64.so: ELF 64-bit LSB shared object, x86-64

I dimly recall that the Magic Leap is an ARM device, so the x64 binaries won't work (more in-depth explanation).

The easiest way would be to recompile liblsl for the magic leap with the standalone_compilation.sh script.

tstenner avatar Dec 05 '19 10:12 tstenner

@tstenner Can you please indicate where I can find the standalone_compilation.sh script and how I can use it? It would be great if there is a resource.

tchemaly avatar Dec 05 '19 19:12 tchemaly

The documentation is a work in progress, e.g. the bit I linked to was added about 2 minutes before my comment.

I don't have a Magic Leap, but if you can SSH into it, you just need to download the liblsl source code (repository, zip), install g++ and then run standalone_compilation_linux.sh.

If the binary is only meant for the magic leap, you could tailor it for this specific processor (CFLAGS="-march=native" ./standalone_compilation_linux.sh)

tstenner avatar Dec 06 '19 08:12 tstenner

The documentation is a work in progress, e.g. the bit I linked to was added about 2 minutes before my comment.

I don't have a Magic Leap, but if you can SSH into it, you just need to download the liblsl source code (repository, zip), install g++ and then run standalone_compilation_linux.sh.

If the binary is only meant for the magic leap, you could tailor it for this specific processor (CFLAGS="-march=native" ./standalone_compilation_linux.sh)

@tstenner Can you kindly share the procedure for Unity 3d for Android Platform (Quest)

Because I am facing issue

DllNotFoundException: lsl LSL.liblsl+StreamInfo..ctor (System.String name, System.String type, System.Int32 channel_count, System.Double nominal_srate, LSL.liblsl+channel_format_t channel_format, System.String source_id) (at Assets/LSL.cs:156) EventLSLOutlet.Start () (at Assets/Scripts/EventLSLOutlet.cs:29)

syeddanishdev avatar Oct 07 '20 22:10 syeddanishdev