LSL4Unity Game to Openvibe

Come here to discuss about OpenViBE in general!
Post Reply
EvheMary
Posts: 4
Joined: Sat Sep 10, 2022 9:47 pm

LSL4Unity Game to Openvibe

Post by EvheMary »

Hi,
I'm trying to use the hello bidirectional unity game as a reference for making my own game
While the part to send from OpenVibe to Unity is working fine, the other way isn't
from what I see, the script has a reference to liblsl which couldn't be found instead of LSL4Unity
I'm not sure if the LSL4Unity posted in the GitLab is supposed to be used together with the LSL4unity unity package or not (I don't think it is, since the package json didn't list this package) or if something's missing from my installation.
Can someone explain what caused this and how can i fix this?

Thank you in advance

Thomas
Posts: 210
Joined: Wed Mar 04, 2020 3:38 pm

Re: LSL4Unity Game to Openvibe

Post by Thomas »

Hi EvheMary,

The LSL4Unity from the OpenViBE gitlab is a fork from the original LSL4Unity, so they do not work together. You need to use the OpenViBE fork only.
from what I see, the script has a reference to liblsl which couldn't be found instead of LSL4Unity
Can you clarify what script and where in the script you see this ?

Thank you,
Thomas

EvheMary
Posts: 4
Joined: Sat Sep 10, 2022 9:47 pm

Re: LSL4Unity Game to Openvibe

Post by EvheMary »

It was in the controller script of hello-sender game (and the bidirectional too, I guess)
Specifically, all reference to lsl use in this script uses liblsl instead of the lsl4unity

Thomas
Posts: 210
Joined: Wed Mar 04, 2020 3:38 pm

Re: LSL4Unity Game to Openvibe

Post by Thomas »

Hi,

Sorry for the very late reply.

Have you been able to make progress on this?
It seems that your installations of LSL are conflicting.

You could check the install of liblsl on your machine and make sure it does not appear in your Path environment variable.
If it's referenced in the Path variable, it is likely being picked up instead of LSL4Unity.

Let us know how you get on.

Thomas

EvheMary
Posts: 4
Joined: Sat Sep 10, 2022 9:47 pm

Re: LSL4Unity Game to Openvibe

Post by EvheMary »

Hi,

At first, there shouldn't be any liblsl installed on my machine when this error came up.
I then installed one to check.
It's in a conda environment so now they picked it up, but still return error. (I tried the liblsl unity demo, not Openvibe's one, and it seems to work fine)

I'm not using that part for now (so it's just one way, OpenVibe to Unity) since it's a bit confusing to troubleshoot.
I'll follow up if I ever going to use it.
Thanks anyway.

Jedi_monk
Posts: 3
Joined: Fri Mar 17, 2023 3:16 am

Re: LSL4Unity Game to Openvibe

Post by Jedi_monk »

Hi EvheMary and Thomas,

I was reading through your thread. Although I do not have a solution to the question posed but I do have a question which could be similar.
I am trying to send event markers or stimulation from Unity/Oculus to OpenVibe as this will be useful in the stimulation-based epoching of my signal processing pipeline. Can you share any options on how I might achieve this? I tried setting up the Serial COM port marking on the EmotivPRO platform but that was somewhat impossible for me.

Thanks in advance

Thomas
Posts: 210
Joined: Wed Mar 04, 2020 3:38 pm

Re: LSL4Unity Game to Openvibe

Post by Thomas »

Hi,


@Jedi_monk, the Unity application hello-bidirectional that EvheMary is trying to use could be a good starting point to understanding how to send from Unity to LSL.
It is similar to the hello-sender application (that only sends), and you can find it here.

@EvheMary, I think I have a solution to your problem by the way.
After cloning the hello-bidirectionnal code onto you machine, you need to pull the LSL4Unity library which is set as a git submodule of the project, with the following command:

Code: Select all

git submodule update --init --recursive
Or had you already done this step ? Let us know if the problem persists or if this was the solution.

Thank you,
Thomas

EvheMary
Posts: 4
Joined: Sat Sep 10, 2022 9:47 pm

Re: LSL4Unity Game to Openvibe

Post by EvheMary »

Hi

Sorry for the long hiatus. I was working on another part of my project and just came back to this.
I just learn some C sharp and unity basic and after going through the errors, seems like it's just some import problem.
My guess is that in the c sharp script that makes use of Stream Outlet, it tried calling class from non-existent library instead of the LSL4Unity
(e.g. its liblsl.StreamOutlet instead of just StreamOutlet, or liblsl.IRREGULAR_RATE instead of LSL.IRREGULAR RATE (these are found in the controller.cs))
I just fix those issues and now it's working fine.

P.S.
Just in case the errors are when 'using LSL4Unity', it might be because unity couldn't build the library. fix it by going to Edit>Preferences>External Tools>Regenerate Project Files

@jedi_monk Yes, this bidirectional project is a good template to expand for BCI application in unity.

Post Reply