Green and red dotted lines

About the GUI application to design signal processing pipelines
Post Reply
Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Green and red dotted lines

Post by Anne »

Hi!
Finally i have created a driver for a bluetooth EMG system, and i put the data coming from the system in the buffer m_sample.
After i have tried to read the data with the Openvibe Designer, through the creation of a very simple block system constituted from only two blocks: Acquisition Client and Signal Display. The data are effectively visualized, but always appear green and red vertical dotted lines. I have seen in the Stimulation of Signal Display that there are two Stimulation color (of the same colors of the dotted lines) named OVTK_GDF_Incorrect (associated to the green) and OVTK_GDF_Correct (associated to the red).
What are these lines and what does it mean their presence?
And why with the generic oscillator any lines appears?
Thank you in advance,
Anne

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Green and red dotted lines

Post by lbonnet »

Hi Ann,

and thanks for the update !

The 2 stimulations you mentioned are sent automatically by the Acquisition Server if it detects some jittering in the acquisition.
If the driver is drifting from its theorical sampling rate, the Server tries to correct the sample flow.
If it is missing some samples (for example it should acquire at 512 Hz but sends data at 510 Hz), the server adds some samples to catch up.
The "artificial" part is delimited by these 2 stimulations.
If the driver is going too fast than it should, then the stimulation mark where a small cut started (e.g. 10 samples removed).

The Acquisition Server behavior can be configured. The configuration token AcquisitionServer_DriftToleranceDuration is set to 2 milliseconds by default.
It means that a drift of more than 2ms triggers the correction mechanism. You can set this parameter in your personal configuration file.

Anyway, if you have a lot of corrections, it means the driver may have some unstable behavior. This may come for various reasons: the Bluetooth connection, the acquisition device...
If you need high temporal precision it can be a problem.

Hope this helps

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Re: Green and red dotted lines

Post by Anne »

Thank you for your explanation, that is very clear :)
Effectively I have put the data in wrong way, so that explain why the graphic was full of line!
Now I have a new question, because I have some other problems with these lines, and i would like to understand the situation:
while the Openvibe acquisition server is running, sometimes doesn't appear in the Signal display any line (neither green or red, also for very long acquisition), while some other times appear vertical green and red lines.
The strange thing is that during the Signal display if I play the Stop and immediately after the Start button the lines situation can change, for example from the perfect situation (without any vertical lines) to a worse situation with vertical lines, or can happen the opposite.
I would like to understand why this happens because this changing seems to be independent from how i put the data in the m_psample vector, considering that sometimes i can see the perfect Signal display!
Thank you in advance and i hope to have been clear!

Anne

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Green and red dotted lines

Post by lbonnet »

Hi Anne,
while the Openvibe acquisition server is running, sometimes doesn't appear in the Signal display any line (neither green or red, also for very long acquisition), while some other times appear vertical green and red lines.
I'm glad you got it working ! If you device doesn't print any lines it means it is relatively stable.
If a correction appears at random, it may reflect an unexpected event (maybe the bluetooth connection lagged for a short time, I don't know...).
Is it happening a lot ? Is it ever happening directly on a first recording session, or after a while ?
The strange thing is that during the Signal display if I play the Stop and immediately after the Start button the lines situation can change, for example from the perfect situation (without any vertical lines) to a worse situation with vertical lines, or can happen the opposite.
When you press "stop" in the Acquisition Server, openvibe calls the "stop" function of your driver. If you didn't disconnect your driver from the device, it may keep on receiving data. Thus when you start again, some data may be waiting in the buffer. I don't know how you handle the buffer(s) in your driver, but you should always start the data recovery with an empty buffer, for example by dropping every outdated samples before asking for new ones.

I don't know if it is the real source of your problem (as it seems to happen somehow randomly) and if this solution will fit in your implementation but it's worth the try.


Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Re: Green and red dotted lines

Post by Anne »

Hi!
Thank you again for the replay :)
Is it happening a lot ? Is it ever happening directly on a first recording session, or after a while ?
The first session usually is ok (without any lines), but during the other session the things seems to be random (with number of lines very variable).
When you press "stop" in the Acquisition Server, openvibe calls the "stop" function of your driver.
I agree on that, but the problem is that the lines appears when I play the stop button in the Signal Display, while using the block Signal Display in the Openvibe Designer. So, even if is the first session, if I play the "stop" button of the Signal Display, after there are many probability that the vertical lines appear!
I can't understand that, because the Openvibe acquisition server runs in background as usual and the playing of the "stop" button seems to change something.

I don't know if could be interesting, but i'm using 4 channel at 1024 Hz.
Thank you,

Anne

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Green and red dotted lines

Post by lbonnet »

Hi Anne,
I agree on that, but the problem is that the lines appears when I play the stop button in the Signal Display, while using the block Signal Display in the Openvibe Designer. So, even if is the first session, if I play the "stop" button of the Signal Display, after there are many probability that the vertical lines appear!
Ok... so when you stop the scenario in the Designer, and play it again without touching the acquisition Server in background, it seems like there is a lot of correction happening.
It's really strange indeed...
What is your scenario ? Only an acquisition client box and a signal display box ?
don't know if could be interesting, but i'm using 4 channel at 1024 Hz.
1024 Hz is faster than many other device (usually we have 512Hz or lower), but it not a problem.

I assume you are using the default settings of the Acquisition Server (Sample count per block to 32) ?

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Re: Green and red dotted lines

Post by Anne »

Hi!
What is your scenario ? Only an acquisition client box and a signal display box ?
Exactly, only that two blocks
I assume you are using the default settings of the Acquisition Server (Sample count per block to 32) ?
Exactly, I have tried to change, but the better situation is with 32.

Today I have noticed a strange warning:
<<No stencil buffer defined - couldn't pick object... this should never happen>>
I don't know if it's related with the problem.

Today I have noticed that if I play the "Pause" button instead of the "Stop" button, nothing change.

Thank you,

Anne

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Green and red dotted lines

Post by lbonnet »

Hi Anne,
Exactly, I have tried to change, but the better situation is with 32.
It is just the size of each block of samples sent to the Acquisition Client. At 1024 Hz a block of 32 samples represents ~30 ms.
Today I have noticed a strange warning:
<<No stencil buffer defined - couldn't pick object... this should never happen>>
I don't know if it's related with the problem.
This is a gtk related warning. I'm not sure it's related to our problem here :)
However it should not happen... it has been corrected in older version.

What version of openvibe are you using ?
The latest SVN trunk or a tag (0.X.0) ?
Today I have noticed that if I play the "Pause" button instead of the "Stop" button, nothing change.
Ok... I still don't figure out. If you want you can send me (private message please) your source code. I won't be able to test it but I can take a look.

Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

Anne
Posts: 13
Joined: Thu Dec 09, 2010 3:34 pm

Re: Green and red dotted lines

Post by Anne »

Hi!
What version of openvibe are you using ?
The latest SVN trunk or a tag (0.X.0) ?
I'm using the SVN trunk that I have downloaded on november.
If you want you can send me (private message please) your source code. I won't be able to test it but I can take a look.
Thank you very much!! I'll send you the private message!

Anne

Post Reply