Problems with ModularEEG Data aquisition
-
- Posts: 5
- Joined: Wed Jul 15, 2009 12:49 pm
Problems with ModularEEG Data aquisition
Hello,
We've built a ModularEEG and I tried to use it with OpenVibe. But there seems a problem in the Acquisition Server which I couldn't track.
I have a serial-USB converter on board. So, I'm able to connect to the device and it says ready in the Acquisition Server. But after I click start,
it disconnects with the error:
" Something bad happened in the callback loop"
The developer of the driver (Chris) told me that this does not happend with his device and his version of the driver. He told me that it probably has
to do with someting that Yann added for the release?
Thanks for help!
Stephan
We've built a ModularEEG and I tried to use it with OpenVibe. But there seems a problem in the Acquisition Server which I couldn't track.
I have a serial-USB converter on board. So, I'm able to connect to the device and it says ready in the Acquisition Server. But after I click start,
it disconnects with the error:
" Something bad happened in the callback loop"
The developer of the driver (Chris) told me that this does not happend with his device and his version of the driver. He told me that it probably has
to do with someting that Yann added for the release?
Thanks for help!
Stephan
Re: Problems with ModularEEG Data aquisition
Dear Stephan,
what version of the firmware do you have ? The ModularEEG EEG driver Chris developed was for P2 only.
Yann
what version of the firmware do you have ? The ModularEEG EEG driver Chris developed was for P2 only.
Yann
-
- Posts: 5
- Joined: Wed Jul 15, 2009 12:49 pm
Re: Problems with ModularEEG Data aquisition
The P2 firmware is uploaded to my modularEEG device.
Stephan
Stephan
Re: Problems with ModularEEG Data aquisition
Dear unidesigner,
the message you are talking about happens when the loop function returns false.
according to the current code :
the function returns false in two cases :
Yann
the message you are talking about happens when the loop function returns false.
according to the current code :
Code: Select all
boolean CDriverOpenEEGModularEEG::loop(void)
{
if(!m_rDriverContext.isConnected()) { return false; }
if(!m_rDriverContext.isStarted()) { return true; }
uint32 l_i32ReceivedSamples=0;
uint32 l_ui32StartTime=System::Time::getTime();
while(l_i32ReceivedSamples < m_ui32SampleCountPerSentBlock && System::Time::getTime()-l_ui32StartTime < 1000)
{
switch(this->readPacketFromTTY(m_i32FileDescriptor))
{
case 0: // No Packet finished
break;
case 1: // Packet with Samples arrived
// m_ui8LastPacketNumber++;
m_ui8LastPacketNumber=m_ui8PacketNumber;
for(uint32 j=0; j<m_oHeader.getChannelCount(); j++)
{
m_pSample[j*m_ui32SampleCountPerSentBlock+l_i32ReceivedSamples]=(float32)m_pChannelBuffer[j]-512.f;
}
l_i32ReceivedSamples++;
break;
case -1: // Timeout, could inidicate communication error
return false;
}
}
if(l_i32ReceivedSamples!=m_ui32SampleCountPerSentBlock)
{
// Timeout
return false;
}
m_pCallback->setSamples(m_pSample);
return true;
}
- - first one is that readPacketFromTTY returns -1, reflecting a timeout
- second one is that the while block takes more than a second to execute, reflecting a different timeout
Yann
Re: Problems with ModularEEG Data aquisition
Hello,
We have the same problem with our Modular EEG. Tha card is well powered. The RS232 Cable sends signals: we have tested with Hyperterminal.
We still have the error: "something bad happen in the callback loop".
We have also tested the acquisition with the software ElectricGuru and we have no signals.
Best Regards,
We have the same problem with our Modular EEG. Tha card is well powered. The RS232 Cable sends signals: we have tested with Hyperterminal.
We still have the error: "something bad happen in the callback loop".
We have also tested the acquisition with the software ElectricGuru and we have no signals.
Best Regards,
Re: Problems with ModularEEG Data aquisition
Dear fleur,
Did you push that "start" button (or whatever its name, I can't remember) on your device before pushing the start button on the acquisition server ?
Yann
Did you push that "start" button (or whatever its name, I can't remember) on your device before pushing the start button on the acquisition server ?
Yann
Re: Problems with ModularEEG Data aquisition
Hello,
We don't find any start button on the openEEG.
Best Regards,
We don't find any start button on the openEEG.
Best Regards,
Re: Problems with ModularEEG Data aquisition
Hello,
We would like to know if we should change the port number?
Best Regards,
We would like to know if we should change the port number?
Best Regards,
-
- Posts: 5
- Joined: Wed Jul 15, 2009 12:49 pm
Re: Problems with ModularEEG Data aquisition
Yes, there is no start button on my openeeg either.
Stephan
Stephan
Re: Problems with ModularEEG Data aquisition
Dear fleur,
Chris Veigl who wrote the driver told me in the past :
there were some "bad things happening" in the aquististion server (i suppose because of a timeout when the device is in pause mode) but when i chose the right sequence (connect to COM port, press play on device, press play in aquisition server, press play in designer) i got a clean 14Hz calibration signal from the device.
We don't have an OpenEEG acquisition machine ourselves so I can't test it.
If you can't handle this on the acquisition server side, maybe you could have a look to the sources of the driver to let us know which part of the function returned false. (Just print something at those return false points).
Yann
Chris Veigl who wrote the driver told me in the past :
there were some "bad things happening" in the aquististion server (i suppose because of a timeout when the device is in pause mode) but when i chose the right sequence (connect to COM port, press play on device, press play in aquisition server, press play in designer) i got a clean 14Hz calibration signal from the device.
We don't have an OpenEEG acquisition machine ourselves so I can't test it.
If you can't handle this on the acquisition server side, maybe you could have a look to the sources of the driver to let us know which part of the function returned false. (Just print something at those return false points).
Yann
Re: Problems with ModularEEG Data aquisition
Thank you unidesigner for this feedback !unidesigner wrote:Yes, there is no start button on my openeeg either.
Glad that you came back to read this post.
Have you tried the older version of the driver that Chris initially released ? Also, he told me he contacted you to provide help but that he did not receive required information. Could you give them to him ?
Yann
-
- Posts: 5
- Joined: Wed Jul 15, 2009 12:49 pm
Re: Problems with ModularEEG Data aquisition
No, I have'nt tried the older version of the driver. I need to take time to look into this.
I don't know what information he meant regarding this.
From the description he gave, it seems that he has a start button on his device. My device is configured
(with serial to usb converter on board) to continously send data, so i no start button is necessary or even available.
it works with bioexplorer.
i'm not sure to which kind of the "bad things happening" is to be attributed.
unidesigner
I don't know what information he meant regarding this.
From the description he gave, it seems that he has a start button on his device. My device is configured
(with serial to usb converter on board) to continously send data, so i no start button is necessary or even available.
it works with bioexplorer.
i'm not sure to which kind of the "bad things happening" is to be attributed.
unidesigner
yrenard wrote:Thank you unidesigner for this feedback !unidesigner wrote:Yes, there is no start button on my openeeg either.
Glad that you came back to read this post.
Have you tried the older version of the driver that Chris initially released ? Also, he told me he contacted you to provide help but that he did not receive required information. Could you give them to him ?
Yann
Re: Problems with ModularEEG Data aquisition
Well, that would help me know if I made a mistake when integrating Chris's driver. Feedback appreciated if you have time.unidesigner wrote:No, I have'nt tried the older version of the driver. I need to take time to look into this. I don't know what information he meant regarding this.
Ok, so do you have an idea if he added this start button for his own device only ?unidesigner wrote:From the description he gave, it seems that he has a start button on his device. My device is configured (with serial to usb converter on board) to continously send data, so i no start button is necessary or even available.
Ok, we definitely have to fix this bug...unidesigner wrote:it works with bioexplorer.
I'd be glade to help any user with OpenEEG hardware to debug/fix this live... join on IRC !
Indeed, the driver does not print any error message. The bad things happening is just the acquisition driver telling that the driver returned an error statusunidesigner wrote:i'm not sure to which kind of the "bad things happening" is to be attributed.
![Wink ;)](./images/smilies/icon_wink.gif)
Anyone, please join on IRC for a live debug session
![Wink ;)](./images/smilies/icon_wink.gif)
Yann
Re: Problems with ModularEEG Data aquisition
Hello,
We have the following problem in the source code:
On the console, the problem are identified:
The source code is (We have put printf in the loop ):
We have the following problem in the source code:
On the console, the problem are identified:
Code: Select all
printf("switch 0: No Packet finished\n");
printf(" l_i32ReceivedSamples!=m_ui32SampleCountPerSentBlock => Timeout");
Code: Select all
boolean CDriverOpenEEGModularEEG::loop(void)
{
printf("enter loop");
if(!m_rDriverContext.isConnected()) { return false; }
printf("connection ok");
if(!m_rDriverContext.isStarted()) { return true; }
uint32 l_i32ReceivedSamples=0;
uint32 l_ui32StartTime=System::Time::getTime();
while(l_i32ReceivedSamples < m_ui32SampleCountPerSentBlock && System::Time::getTime()-l_ui32StartTime < 1000)
{
printf("enter while");
switch(this->readPacketFromTTY(m_i32FileDescriptor))
{
case 0: // No Packet finished
[color=#FFFF00]printf("switch 0: No Packet finished\n");[/color]
break;
case 1: // Packet with Samples arrived
// m_ui8LastPacketNumber++;
printf("switch 1 : Packet with Samples arrived\n");
m_ui8LastPacketNumber=m_ui8PacketNumber;
for(uint32 j=0; j<m_oHeader.getChannelCount(); j++)
{
m_pSample[j*m_ui32SampleCountPerSentBlock+l_i32ReceivedSamples]=(float32)m_pChannelBuffer[j]-512.f;
}
l_i32ReceivedSamples++;
break;
case -1: // Timeout, could inidicate communication error
printf("switch -1 : Timeout\n");
return false;
}
}
if(l_i32ReceivedSamples!=m_ui32SampleCountPerSentBlock)
{
// Timeout
[color=#FFFF00]printf(" l_i32ReceivedSamples!=m_ui32SampleCountPerSentBlock => Timeout");[/color]
return false;
}
m_pCallback->setSamples(m_pSample);
printf("end loop");
return true;
}
Re: Problems with ModularEEG Data aquisition
After some live debugging on the driver, it appears that a problem is happening on Windows. Windows has a rather big buffer for COM ports and doesn't let client applications get the data as often as it should. This results in multiple packets being decoded at the same time. Function readPacketFromTTY returns bigger than 1 values. This case is not considered in the switch/case statement...
I'm working on a patch thanks to someone on IRC.
I'll keep you posted and I hope we'll have a working fix soon
Yann
I'm working on a patch thanks to someone on IRC.
I'll keep you posted and I hope we'll have a working fix soon
Yann