Problem with Analog VRPN server

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Problem with Analog VRPN server

Post by toncho11 »

Hi,

I am trying to export EEG signal through VRPN. I have a simple scenario of two boxes "Generic Stream Reader" + "VRPN Analog Server".

When I start it, I get this error:

vrpn_buffer: buffer not large enough

Seems like, although it is possible to connect the two boxes, correct values are not passed to the VRPN server which result in an error.

Is this a bug? Did someone else try it before?

-Anton

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

Re: Problem with Analog VRPN server

Post by lbonnet »

Hi Anton !
I am trying to export EEG signal through VRPN. I have a simple scenario of two boxes "Generic Stream Reader" + "VRPN Analog Server".

When I start it, I get this error:

vrpn_buffer: buffer not large enough

Seems like, although it is possible to connect the two boxes, correct values are not passed to the VRPN server which result in an error.

Is this a bug? Did someone else try it before?
Firstly, the way VRPN is implemented in the openvibe boxes is not clearly suitable for sending large-sized & high-frequency EEG data.

Anyway... I got the same error with a OV file generated using a sinus oscillator which samples per epoch setting is 128 or more.
What sampling frequency are you using ? how many samples per blocks ? Can you send us your ov file for test ?

VRPN has some internal limitation (e.g. 128 channels max), and the size of its internal buffer may be one of them.
I personally never use VRPN servers to send raw EEG data outside openvibe. If you do so, I think that the current implementation of the Analog VRPN Server will flatten the incoming samples into one vector of samples.

For example, if you have 32 samples per block and 8 channels, the VRPN server will produce for each block a vector made of 32*8 = 256 VRPN channels (one value per channel).
Internally you're limited to 128 channels, thus 128 values are dropped.
In this case, on the client size, you're expected to only take the first 8 values as correct ones.
One value per EEG channel and per block are correct and should be used.
(Jozef, Yann, let me know if I'm wrong :) )

I hope this helps !

Laurent
Follow us on twitter >> openvibebci

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

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Problem with Analog VRPN server

Post by yrenard »

Dear Laurent, dear Anton,

indeed, this is correct. VRPN aims at abstracting interaction devices, you should only use it to send processed signals (that is small number of channels, reasonable sampling frequency). For instance, it is used for motor imagery and outputs only the classifier state output (which is basically left/right index) at 16Hz.

Hope this helps,
Yann

toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Re: Problem with Analog VRPN server

Post by toncho11 »

Thank you for your replies!

Suppose I have a trainer+classifier implemented in C# and I would like to test it.

Can I use a scenario of 5 boxes to export signal (if RAW does not work) to feed my C# implementation:

-Generic Stream Reader

- Temporal Filter - GPL
- Signal Average
- Simple DSP

- Analog VRPN server

1. This way I get 11 channel signal and no error! I think it is an 11 channel EEG?

2. Is this scenario OK to simply display the signal?

3. I was wondering which is the right scenario to produce a signal suitable for: feature generation and training of the classifier

Today I was able to use the above scenario to export this 11 channel signal to my test application Adastra and display each channel using a Windows Forms Chart control. You can check the source here: http://code.google.com/p/adastra/source/checkout. Currently it works only with unmodified SVN compiled OpenVibe.

Cheers,
Anton

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

Re: Problem with Analog VRPN server

Post by lbonnet »

Can I use a scenario of 5 boxes to export signal (if RAW does not work) to feed my C# implementation:

-Generic Stream Reader

- Temporal Filter - GPL
- Signal Average
- Simple DSP

- Analog VRPN server
I guess you can... but what's inside the Simple DSP ? (I mean the equation)
The Signal average box computes the average of the incoming buffer on each channel.
Thus if your file outputs 32 samples per block, signal sampled at 512Hz, you end up with a 16Hz signal (one value every 32 samples) more suitable for VRPN.
1. This way I get 11 channel signal and no error! I think it is an 11 channel EEG?
The scenario you describe does not seem to modify the number of channel... So if your file has 11 channels, you should have 11 channels at the end.
You can check that by just adding a signal display after the Generic Stream Reader, it will show you the actual number of channels in the file.
2. Is this scenario OK to simply display the signal?
If you want to display this signal in your C# application, it's indeed better like this :)
With the signal average, the Signal outputed is in fact a vector of values (the average on each channel). The VRPN Analog Server won't modify it in any way, you will get the vector of value directly (no matrix flattened).
3. I was wondering which is the right scenario to produce a signal suitable for: feature generation and training of the classifier
The solution hardly depends on which paradigm you intend to use : motor imagery, focus state, p300, etc.
If you want to start with what's provided in openvibe, you can take a look at the given bci scenarios.
For example, you can use the motor imagery scenarios, but instead of using the Classifier Trainer and Classifier Processor boxes, you put the feature vectors in an Analog VRPN Server.
Your C# app can then take these feature vectors (in this case, it would be the band power on 8-24Hz band) and use it to train and use a C# classifier that will control... whatever you want to control :)


Hope this helps !

Laurent
Follow us on twitter >> openvibebci

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

Post Reply