using the Emotiv with openvibe

Obtaining data from various hardware devices
CHRISLKF
Posts: 6
Joined: Tue Jan 23, 2018 3:27 am

Re: using the Emotiv with openvibe

Post by CHRISLKF »

Actually, we can't test things here in the lab, as we don't have the newest emotiv hardware/SDK. So we can't garantee that it will work.
However, it seems that Willux managed to get things working.
For that you will need :
- to recompile OV2.0 and link it against the new Emotiv SDK instead of the old one.
- Set the default headset id to 4096 instead of 0.

Tell us if that indeed solves your problem !
Hi tgaugry,

Really so glad to hear from you. However, may I know further and more detailed on how to recompile OV2.0 and link it against the new Emotiv SDK instead of the old one? Do you meant by editing the source codes of OV2.0? If so, may I know which files exactly need to be modified and where could I get the link of the source codes?
Regarding to set the default headset id to 4096 instead of 0, may I know where can it be changed? Sorry for all these doubts because I am from Mechanical Engineering background which is not strong in software programming. Really appreciate to hear from you again. Thanks!

Regards,
Chris

tgaugry
Posts: 68
Joined: Thu Feb 09, 2017 10:17 am

Re: using the Emotiv with openvibe

Post by tgaugry »

Hi,

Usually i would answer to follow the instructions from the documentation to compile OpenViBE.
The build is mostly automated.
However you will need to change a few things in the actual code to make things work with the new emotiv software, so i suggest you find a friend/colleague to help you.
You can also contact emotiv to see if they want to contribute a working OpenViBE plugin for their headset.

In the meantime, you can still check the documentation page (above), it should answer most (if not all) of you questions.

Cheers,

jmann18
Posts: 8
Joined: Mon Feb 05, 2018 5:40 pm

Re: using the Emotiv with openvibe

Post by jmann18 »

I was able to change the ID from 0 to 4096 and build the programs, however the emotiv driver does not appear on the drop down list in the sever acquisition client. Could someone please help?

-Thanks

AYDLINN
Posts: 16
Joined: Thu Mar 29, 2018 6:28 am
Location: Bask Country
Contact:

Re: using the Emotiv with openvibe

Post by AYDLINN »

Hi Willus
I really enjoyed by your work.
Could tell more about your way to process to recompile " OV2.0 and link it against the new Emotiv SDK instead of the old one"? :wink:

However, I understand to change the id to the new.

Thanks a lot.


Willux wrote:
tgaugry wrote: It should be called in ovasCAcquisitionServer.cpp, in CAcquisitionServer::loop function, line 499 and 520 ("l_bResult=m_pDriver->loop();")

The code you pasted is originally enclosed in a if, and there is another one before that.
What likely happen is that it enter the function, then exit because `m_rDriverContext.isConnected()`or `(m_rDriverContext.isStarted()` return false.
So it looks like incorrect initialisation to me. (which may be due to the driver code)

Cheers,
Hello

You are right, your code works. I have debugged some more and I could pass all the steps I have pasted before without any problems.

The point were it did however stop, was not after the driver initialisation, but was here: m_bReadyToCollect = m_bReadyToCollect || (m_ui32UserID == l_ui32NewUserID);
The m_ui32UserID was set to the standard 0, the l_ui32NewUserID returned 4096 after trying 5 times. So it seems that the new driver/headset always connects to id 4096.
I tried setting this from within the GUI configuration, but it seems that you limit the entry to 32 there. So I had to set it in the config file and there it works.

Kind regards
Pascal

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: using the Emotiv with openvibe

Post by jtlindgren »

Hello everybody who are interested in solving this problem. Can you try the following and let us know the results?

1) download and extract Thierry's fix attempt which is attached to the following post,

viewtopic.php?f=5&t=9825&p=15379#p15379

2) In that version of the acquisition server, select Emotiv EPOC. Go to the 'Driver Properties'. Give the correct path to the SDK lib. Press Apply and close(!) the server. Now, open the file

Code: Select all

C:\Users\your_name_here\AppData\Roaming\openvibe\openvibe-acquisition-server.conf
with a text editor and there, replace one value as follows,

Code: Select all

AcquisitionServer_Driver_EmotivEPOC_UserID = 4096
3) make sure your device is in the state that it is able to record data (license activated, whatever), but no other apps reserving the device.

4) Start Acquisition Server again, press connect, press play. Do *not* go back to the Driver Properties or the configuration will lose the 4096 that was set.

Let us know the results. The more information we get, the more likely it is we can fix the problem. For example, allowing 4096 in the GUI in the future is trivial to make, but before we jump to do it (or something else), we need to know it works. Since we don't have the modern Emotiv HW / licenses here at Inria Rennes, we really can't test the different solutions ourselves.

As usual, we warmly welcome any possible patches from the community addressing this issue.

Best,
Jussi

jaspreetranjit
Posts: 7
Joined: Fri Dec 25, 2015 5:59 pm

Re: using the Emotiv with openvibe

Post by jaspreetranjit »

I bought the emotiv epoc + 3 years ago and along with it, I bought the research sdk. But now, I subscribed to the monthly emotiv pro to get access to the raw eeg data. However, when I try to connect to acquisition server on openvibe, it says that it timed out at 5000 ms so I am not actually receiving any data from the eeg. Do I have to recompile acquisition server as mentioned in the previous posts on this forum so that I can use it with the new research sdk, or do I need to use EEGLogger to collect the data, which I'm not sure if I will be able to use that collected data with the openvibe scenarios. Just for reference, I am trying to get data for the P300 speller scenarios in openvibe, and I want live data streaming from the eeg, not prerecorded data from eeglogger. Is there a way to ensure compatibillty between the eeg and the acquisition server? If I have to recompile the acquisition server, how should I go about doing that?

Any advice would be greatly appreciated, I am on a bit of a time crunch! Thank you.

CHRISLKF
Posts: 6
Joined: Tue Jan 23, 2018 3:27 am

Re: using the Emotiv with openvibe

Post by CHRISLKF »

Hi jaspreetranjit,

Did u tried what have been told by jtlindgren in the above reply?

jaspreetranjit
Posts: 7
Joined: Fri Dec 25, 2015 5:59 pm

Re: using the Emotiv with openvibe

Post by jaspreetranjit »

Yes, I tried what jtlindgren and now, when I run the new acquisition server, I get the error:

[Error] [LOOP] Emotiv Driver: An error occurred while updating the DataHandle. EDK Error Code [8226]
[Warning] Something bad happened in the loop callback stopping the acquisition.
[Error] Something bad happened in the loop callback stopping the acquisition.

However, I do not get the "Timed out after 5000 milliseconds" error anymore

So my SDK path is linked to emotiv tools which I downloaded from a git repo that was earlier in this blog post. I activated my license using the license activator, but I'm not sure if/how I have to debit a session to actually get raw eeg data or if openvibe knows that I have the monthly subscription to emotiv pro. There has been talk about EEG logger but I'm not sure how to use that or if thats needed for these purposes to get raw eeg data.

Second, I downloaded the new acquisition server but what about the old one? Do i have to go into openvibe's files and replace all the old files associated with the old acquisition server with the new one I just downloaded or should openvibe automatically interface with the newly downloaded acquisition server that I extracted onto my desktop? For example, if I play a scenario in openvibe that requires input from acquisition server, will it point to the new one or the old one and how will it know which one to point to? Is there a step I am missing?

Again, any guidance will be greatly appreciated. Thank you!

Jaspreet Ranjit

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: using the Emotiv with openvibe

Post by jtlindgren »

Hi Jaspreet,

the Acquisition Server provided in Thierry's post in this thread is compatible with the usual Designer versions available such as 1.3 or 2.1. The two communicate over a network protocol which hasn't changed in a while. You can run that 'emotiv rigged' test version of AS from its own folder and the normal Designer from another.

To go further with this we need feedback regarding the behavior of this test version of the server - if it works or not, and what happens. We already know that the normal AS only works with previous versions of the Emotiv SDKs but not the new ones, as described on

http://openvibe.inria.fr/how-to-connect ... -openvibe/


Best,
Jussi

jaspreetranjit
Posts: 7
Joined: Fri Dec 25, 2015 5:59 pm

Re: using the Emotiv with openvibe

Post by jaspreetranjit »

Hello Jussi,
Thank you for your quick response. Is there any specific information I can provide regarding the behavior of the new acquisition server? Regarding my previous post, I have already tried connecting the emotiv headset to the new acquisition server and although it connected properly, it gave me those errors. I was looking at this forum as well: viewtopic.php?f=5&t=9677&start=15 and it seems the problem may be with activation of the license? I'm not entirely sure. Thank you and let me know if I can provide anymore information or if you have any other steps I could take. On a side note, not sure if this matters but I bought the emotiv epoc + with the research edition about 3.5 years ago, now the research sdk that I bought with it seems useless as I no longer have that activation key to download it.

Jaspreet Ranjit

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: using the Emotiv with openvibe

Post by jtlindgren »

That seems tricky. I'm a bit out of ideas. I tried to briefly google what the 8226 error code means, but it wasn't very clear. Perhaps you could ask the company?

Can you use any other tools (open source or otherwise) to verify that the license is activated and you're able to get raw data from the device?

Best,
Jussi

jaspreetranjit
Posts: 7
Joined: Fri Dec 25, 2015 5:59 pm

Re: using the Emotiv with openvibe

Post by jaspreetranjit »

When I emailed the company a while back, they said that emotiv tools license activator, and the website should indicate that the license is activated. I can try running through the activation process again, however, emotiv also has a new feature where we need to debit a session to actually get raw eeg data. I'm not sure where do debit a session, there is a spot to enter a debit number in the license activator within emotiv tools, but i'm not exactly sure if that is doing anything. Even if the process to get raw eeg data was to debit a session, I'm not sure if this will allow us to get live stream data or if we need to record a session and then feed it into openvibe? Since i'm using the p300 scenarios, I would need the live stream.

jaspreetranjit
Posts: 7
Joined: Fri Dec 25, 2015 5:59 pm

Re: using the Emotiv with openvibe

Post by jaspreetranjit »

Hi Jussi,
Seeing as emotiv cannot connect directly to openvibe, I am recording data with emotiv pro and exporting the file as a csv file and modifying it to match the format described here: http://openvibe.inria.fr/csv-file-format-description/ I am tryin g to feed the data into the trainer/classifier of the p300 speller scenario to at least get a training accuracy. However, emotiv's csv file does not have the stimulation id timestamps that actually correlate the flashing sequence to specific times, so the trainer will not work, i would need to add these stimulation ids to the time stamp. Any ideas on how i could get this part to work even though real time streaming will not be possible for the time being?

Jaspreet Ranjit

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: using the Emotiv with openvibe

Post by jtlindgren »

No, unfortunately not any good ones. Signal/marker alignment for P300 is usually necessary to be quite precise as the used signal processing is not robust to time jitter or varying shifts of the signal wrt the flash onset. In your case the knowledge of what time it is when each sample is obtained in relation to the flash time, doesn't seem to be easily obtainable. Even if you were able to obtain the markers and align them against the csv, I'm not sure how online P300 could be achieved with this.


Best,
Jussi

jaspreetranjit
Posts: 7
Joined: Fri Dec 25, 2015 5:59 pm

Re: using the Emotiv with openvibe

Post by jaspreetranjit »

Hi Jussi, fortunately, I found my old laptop with the old research sdk and its all working now. Thanks for your help.

Jaspreet Ranjit

Post Reply