labstreaminglayer / LSL4Unity

A integration approach of the LabStreamingLayer Framework for Unity3D
Other
83 stars 38 forks source link

LSL4Unity for VR? #47

Open devriesewouter89 opened 1 year ago

devriesewouter89 commented 1 year ago

Hi all I'm trying to understand what the best approach is to integrate LSL into a unity app build for a Pico Neo 3 pro VR headset. The device is running android. I'm not sure: is it best option to use the LSL4Unity plugins or should I check out liblsl-android?

If I try to use LSL4Unity, by building one of the samples, I'm not able to build for android as I get the message: Found plugins with same names, Packages/com.labstreaminglayer.lsl4unity/Plugins/LSL/Windows/x64/lsl.dll and Packages/com.labstreaminglayer.lsl4unity/Plugins/LSL/Windows/x86/lsl.dll. Delete the one of the duplicate plugins.

Two things don't seem right:

  1. I'm not targetting a windows device
  2. I can't delete these plugins: "the operation 'softdelete' is not allowed in an immutable package.

Am I using the plugin the wrong way or should I be using the android library? (which hasn't been updated since some years...)

Thanks a lot! Wouter

cboulay commented 1 year ago

Have you seen https://github.com/labstreaminglayer/PicoNeo2Eye ?

I wrote that before LSL4Unity was revamped as a custom package, so I was mostly using LSL.cs .

I think you're confused about something. You need both a language wrapper and a shared library.

liblsl-Csharp and liblsl-Java are both language wrappers. They each provide an interface into the liblsl shared library for those languages. (We similarly have liblsl-Python, liblsl-Rust, liblsl-Julia, liblsl-Matlab, etc.). Unity doesn't use Java, so you have no need for liblsl-Java.

The language wrappers are useless without a library binary. The library you need depends on the platform you're targeting. Some language wrappers ship with some library binaries, but this doesn't cover all platforms. We have a couple different lsl.dll for windows (x86 and x64), we have a few liblsl.dylib for Mac, and several liblsl.so for different flavours of Linux. In Android, you can use liblsl.so (built for your specific ARM processor), or you can use a .aar file. I have no experience with these.

LSL4Unity is just a convenient packaging of a language wrapper (LSL.cs), a bunch of shared libraries for different platforms (but admittedly not Android), and some sample code.