using the Emotiv with openvibe

Obtaining data from various hardware devices
coristus
Posts: 4
Joined: Wed Nov 08, 2017 9:04 pm

Re: using the Emotiv with openvibe

Post by coristus »

I regretfully bought an epoc+ too, expecting a measuring device. Only to find out, it doesn't work on Linux, and you need a subscription to their, expensive software. They claim to have IP's in place giving us their raw data. That seems a little weird, as any interpretation of raw data would No longer yield raw data.
I would advice anyone Not to buy emotiv and stay far away from their intrusive terms. This tie-in sale is (borderline) illegal, at least in Europe.
I feel robbed and mistreated. If anyone has a solution I would be very appreciative.
Cory

Willux
Posts: 7
Joined: Sun Oct 29, 2017 10:11 pm

Re: using the Emotiv with openvibe

Post by Willux »

@tgaugry

I have finally got an answer from Emotiv. It seems that you need a monthly subscription which gives you a certain amount of sessions.
Before every recording, you need to debit a least 1 session, before you can get the EEG data. Emotiv wouldn't tell me how they know you have debited a certain amount of sessions to the local machine.

I have debited 5 sessions to my local machine, so now I can have 5 sessions on my machine. I used the EEGLogger test project, provided by Emotiv, to see if I actually get data from the headset when I have debited a session and this works. I do, however, see in the EEGLogger application that this code is called:
state = IEE_EngineGetNextEvent(eEvent);

if (state == EDK_OK) {
IEE_Event_t eventType = IEE_EmoEngineEventGetType(eEvent);
IEE_EmoEngineEventGetUserId(eEvent, &userID);

if (eventType == IEE_UserAdded) {
std::cout << "User added" << std::endl;
IEE_DataAcquisitionEnable(userID, true);
readytocollect = true;
}
}

I see something similar in the openvibe acquisition server code, in the loop method of the ovasCDriverEmotivEPOC.cpp file:
if(IEE_EngineGetNextEvent(m_tEEEventHandle) == EDK_OK)
{
IEE_Event_t l_tEventType = IEE_EmoEngineEventGetType(m_tEEEventHandle);

if (l_tEventType == IEE_UserAdded)
{
uint32 l_ui32NewUserID;
IEE_EmoEngineEventGetUserId(m_tEEEventHandle, &l_ui32NewUserID);
m_rDriverContext.getLogManager() << LogLevel_Trace << "[LOOP] Emotiv Driver: User #" << l_ui32NewUserID << " registered.\n";
m_ui32EDK_LastErrorCode = IEE_DataAcquisitionEnable(l_ui32NewUserID, true);
if (m_ui32EDK_LastErrorCode != EDK_OK)
{
m_rDriverContext.getLogManager() << LogLevel_Error << "[LOOP] Emotiv Driver: Enabling acquisition failed. EDK Error Code [" << m_ui32EDK_LastErrorCode << "]\n";
return false;
}
// but we are ready to acquire the samples only if the requested headset is detected
m_bReadyToCollect = m_bReadyToCollect || (m_ui32UserID == l_ui32NewUserID);
}
}
But it seems that this code is never triggered.

When is the loop method called? I didn't look into this deeper, hoping you'd know this by heart.

Kind regards

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

Re: using the Emotiv with openvibe

Post by jtlindgren »

Willux wrote:@tgaugry

I have finally got an answer from Emotiv. It seems that you need a monthly subscription which gives you a certain amount of sessions.
Before every recording, you need to debit a least 1 session, before you can get the EEG data. Emotiv wouldn't tell me how they know you have debited a certain amount of sessions to the local machine.
Ouch, that seems potentially a quite expensive business model for EEG, knowing how much testing and hassle getting these things run might require. I hope such paid sessions do not have to be spent simply to test the system? For example, if you want to see that the raw data is correctly coming through from Acquisition Server, do you have to spend one session?


Best,
Jussi

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

Re: using the Emotiv with openvibe

Post by tgaugry »

Hi,

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,

Willux
Posts: 7
Joined: Sun Oct 29, 2017 10:11 pm

Re: using the Emotiv with openvibe

Post by Willux »

jtlindgren wrote: Ouch, that seems potentially a quite expensive business model for EEG, knowing how much testing and hassle getting these things run might require. I hope such paid sessions do not have to be spent simply to test the system? For example, if you want to see that the raw data is correctly coming through from Acquisition Server, do you have to spend one session?
Hello Jussi

We have spent $ 30 to have a license for a month for testing purposes. It's a monthly subscription, which can be stopped at any time. So basically it costs $ 30 to test for a month.
I do however notice, now that I have finally successfully connected the headset to get data in OpenViBE, that the licenses I have debited to my machine are not used...

I'll do some further testing along with the OpenViBE designer to see if this stays this way and I'll get back to you on Wednesday.

Regard
Pascal

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

Re: using the Emotiv with openvibe

Post by jtlindgren »

Hello Pascal, great to hear that. To help others likely facing the same problem, would you mind sharing the steps you followed to get it eventually to work?


Thanks,
Jussi

Willux
Posts: 7
Joined: Sun Oct 29, 2017 10:11 pm

Re: using the Emotiv with openvibe

Post by Willux »

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

Willux
Posts: 7
Joined: Sun Oct 29, 2017 10:11 pm

Re: using the Emotiv with openvibe

Post by Willux »

jtlindgren wrote:Hello Pascal, great to hear that. To help others likely facing the same problem, would you mind sharing the steps you followed to get it eventually to work?
I just did Jussi ;)
I was writing the answer to tgaugry, because I was discussing the code there.

In short, the headset connects to id 4096, so you need to set the id in the configuration to 4096, but you can't in the GUI, so you need to set this in the config file.

Kind regards
Pascal

d ancau
Posts: 6
Joined: Mon Jan 08, 2018 3:15 pm

looking for help in bci research

Post by d ancau »

I am trying for weeks to connect my Epoc+ device to OpenVibe, in order to start some experiments for my PhD thesis.
Unfortunately I couldn’t succeed and always I got errors concerning the connection. I use an Emotiv Epoc+, I also have a license for EmotivPro which gives me unlimited number of sessions to get raw EEG data. This license comes together with CortexPro and Community SDK, which are activated on my computer. From the messages received from OpenVibe I cannot understand where from this problem comes. Is this connection problem related to OpenVibe configuration or the device does not allow the signal delivering, due to some wrong settings?

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

Re: looking for help in bci research

Post by jtlindgren »

d ancau wrote:I am trying for weeks to connect my Epoc+ device to OpenVibe, in order to start some experiments for my PhD thesis.
Unfortunately I couldn’t succeed and always I got errors concerning the connection. I use an Emotiv Epoc+, I also have a license for EmotivPro which gives me unlimited number of sessions to get raw EEG data. This license comes together with CortexPro and Community SDK, which are activated on my computer. From the messages received from OpenVibe I cannot understand where from this problem comes. Is this connection problem related to OpenVibe configuration or the device does not allow the signal delivering, due to some wrong settings?
Hi, I merged your post to the generic thread about Emotiv. The previous discussion likely touches your problem to some extent. There's unfortunately not much we can do in the OpenViBE office; our Emotiv hardware is old, we have not been lately using them for research, and we don't have the resources to track the changes in the Emotiv SDK(s).

Here is a general doc page about the Emotiv driver.

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

zoodledoop
Posts: 1
Joined: Wed Nov 01, 2017 9:14 pm

Re: using the Emotiv with openvibe

Post by zoodledoop »

Willux wrote:
In short, the headset connects to id 4096, so you need to set the id in the configuration to 4096, but you can't in the GUI, so you need to set this in the config file.
Hi Willux, thank you for your efforts.

Which configuration file are you referring to? Apologies for the stupid question, but I attempted to change the "Headset User ID" property to 4096 in \share\openvibe\applications\acquisition-server\interface-Emotiv-EPOC.ui (on line 206), but I'm still receiving the same error message.

I'm in the same boat as d ancau, who posted above.

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

Re: using the Emotiv with openvibe

Post by CHRISLKF »

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

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

Re: OpenViBE 2.0 soon to be released

Post by CHRISLKF »

Hi all,

I still could not be able to extract data out from Emotiv EPOC+ even with this newer version of OpenViBE. Could anyone suggest any methods or ways to integrate the connection? I have been stuck for few weeks already.

Thanks and Regards,
Chris

(moderator: moved post to general emotiv topic.)

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

Re: using the Emotiv with openvibe

Post by tgaugry »

Hello,

Good day. I have read about your reply in discussion forum saying that u managed to integrate OpenViBE with Emotiv EPOC+. I wish that we could have further discussion because currently I still did not managed to do so. And have been stuck here for few weeks. I am looking forward to your reply! Really Thanks.

Thanks and Regards,
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 !

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

Re: using the Emotiv with openvibe

Post by CHRISLKF »

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

Post Reply