Neuroscan command line tool

This forum deals with BCI2000 configuration issues.
Post Reply
rlgmsd
Posts: 4
Joined: 14 Jan 2016, 19:23

Neuroscan command line tool

Post by rlgmsd » 12 Oct 2016, 00:22

Hi,

I am trying to use BCI2000 V3.6 beta (June 8th 2016 Release) with Neuroscan Synamps 2. I intend to use SCAN 4.5 to interface with BCI2000 but I was unable to find the command line tool "neurogetparams.exe" mentioned in (http://www.bci2000.org/wiki/index.php/C ... uroscanADC). It is absent from the "prog" folder where other command-line tools, such as "gUSBampgetinfo.exe",are located. Can anyone help me find this or send me this tool ?

Thank you.
David

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Neuroscan command line tool

Post by pbrunner » 12 Oct 2016, 14:03

David,

BCI2000 v3.6 support auto-config, which means that the function of neurogetparams.exe is implemented within the source module. Hence, if you have the settings at "auto" it will automatically determine the number of channels and sampling rate. If you still want to use the neurogetparams.exe, you can download it from the previous release:

http://bci2000.org/downloads/bin/BCI2000Contrib.exe

Regards, Peter

rlgmsd
Posts: 4
Joined: 14 Jan 2016, 19:23

Re: Neuroscan command line tool

Post by rlgmsd » 14 Oct 2016, 00:59

pbrunner wrote:David,

BCI2000 v3.6 support auto-config, which means that the function of neurogetparams.exe is implemented within the source module. Hence, if you have the settings at "auto" it will automatically determine the number of channels and sampling rate. If you still want to use the neurogetparams.exe, you can download it from the previous release:

http://bci2000.org/downloads/bin/BCI2000Contrib.exe

Regards, Peter


Hi Peter,

Thank you for your reply. I am currently experiencing a problem that happens regardless of my using the neurogetparams.exe : BCI2000 is "waiting" indefinitely after I press the "Set Config".

I take the following steps to start the system:
1. Open Neuroscan Acquire and press the S button for Server Mode, Acquire displays "Server listens at port 3999".
2. Open BCI2000, load the parameter file from running neurogetparams.exe or just leave the parameters as "auto".
3. Press SetConfig

After I press SetConfig, Acquire changes its display to "Client at 127.0.xxx' and BCI2000 shows "Waiting" or "Waiting for Configuration", and this goes on indefinitely. Can you give me some advice on dealing with this ?

Here is some information about my setup:
I am using BCI2000 V3.6 Beta x64 Extension with a windows 7, 64 bit machine. I am using the "Acquire" of SCAN4.5 with Neuroscan Synamps 2. The signal acquisition works well if I use Acquire directly but fails with BCI2000.

Thanks.
David

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Neuroscan command line tool

Post by pbrunner » 14 Oct 2016, 09:46

David,

to further isolate the issue, can you please try to install and run BCI2000 v3.0.5 (see links below). This will tell whether the issue is with BCI2000 v3.6 or with the neuroscan setup. Let me know if this works.

http://bci2000.org/downloads/bin/BCI2000Setup.exe
http://bci2000.org/downloads/bin/BCI2000Contrib.exe

Regards, Peter

rlgmsd
Posts: 4
Joined: 14 Jan 2016, 19:23

Re: Neuroscan command line tool

Post by rlgmsd » 17 Oct 2016, 08:59

pbrunner wrote:David,

to further isolate the issue, can you please try to install and run BCI2000 v3.0.5 (see links below). This will tell whether the issue is with BCI2000 v3.6 or with the neuroscan setup. Let me know if this works.

http://bci2000.org/downloads/bin/BCI2000Setup.exe
http://bci2000.org/downloads/bin/BCI2000Contrib.exe

Regards, Peter

Hi Peter,

Thanks for your reply. I was indeed able to stream the signals to BCI2000 v3.0.5 with 32bit Matlab and NeuroscanClient.exe. I tried to use 500Hz Sampling frequency and 20 Block Size, a setting that works perfectly with g.USBamp, but was experiencing some performance issues. I got the "roundtrip time consistently exceeds block duration (110%) " error.

The part that takes most of the time is my Matlab signal processing and I have already optimized the code as much as I can. But the roundtrip time always keeps approaching the sample block duration during the run and eventually exceeds it. I also notice that the sample block duration is not stable and is fluctuating between 40~60ms (it should be 40ms). All BCI2000 modules and Scan 4.5 are on the same computer so connection should not be an issue. Can you give me some advice on dealing with this ?


Regards,
David

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Neuroscan command line tool

Post by pbrunner » 17 Oct 2016, 10:43

David,

I am glad that you were able to get the BCI2000 v3.0.5 version to work with your Nueroscan device.

The issue with MATLAB is that you are limited in the update rate for two reasons. First there is an overhead in each call to MATLAB, second the MATLAB code itself takes much longer to execute than comparable C++ code. You have two options to overcome this:

(1) Reducing the update rate, which you can achieve by increasing the SampleBlockSize parameter. If you provide feedback on the output of BCI2000, you should aim for at least 10 updates per second, i.e., a SampleBlockSize of 50 in your case.

(2) Improving the performance of the MATLAB code. You can use the "profile on" and "profile viewer" command at the beginning and end of your MATLAB code, repsectively. Running this once will show you how much time each command requires. You then can vectorize your code to improve performance.

In addition to this, I would like to ask you to test the 32-bit BCI2000 v3.6 beta with the same parameters. This would help to assess whether there is an issue in the current code that needs to be addressed.

Regards, Peter

rlgmsd
Posts: 4
Joined: 14 Jan 2016, 19:23

Re: Neuroscan command line tool

Post by rlgmsd » 19 Oct 2016, 00:37

pbrunner wrote:David,

I am glad that you were able to get the BCI2000 v3.0.5 version to work with your Nueroscan device.

The issue with MATLAB is that you are limited in the update rate for two reasons. First there is an overhead in each call to MATLAB, second the MATLAB code itself takes much longer to execute than comparable C++ code. You have two options to overcome this:

(1) Reducing the update rate, which you can achieve by increasing the SampleBlockSize parameter. If you provide feedback on the output of BCI2000, you should aim for at least 10 updates per second, i.e., a SampleBlockSize of 50 in your case.

(2) Improving the performance of the MATLAB code. You can use the "profile on" and "profile viewer" command at the beginning and end of your MATLAB code, repsectively. Running this once will show you how much time each command requires. You then can vectorize your code to improve performance.

In addition to this, I would like to ask you to test the 32-bit BCI2000 v3.6 beta with the same parameters. This would help to assess whether there is an issue in the current code that needs to be addressed.

Regards, Peter

Hi Peter,

Here are my testing results (all based on binary release) :

1. BCI2000 v3.6 32bit + 32bit Matlab 2015b + native 32bit NeuroscanClient.exe :
BCI2000 waits indefinitely, Scan 4.5 recognizes a client but does not transfer any data.

2. BCI2000 v3.6 32bit + 32bit Matlab 2015b + 32bit NeuroscanClient.exe copied from BCI2000 v3.0.5 :
Failed with the warning messages:
DummyApplication: could not make a connection to the next module at 127.0.0.1
SignalSource: connection to the previous module timed out after 20s
SignalSource: application dropped connection unexpectedly

3. BCI2000 v3.6 64bit + 64bit Matlab 2015b + native 64bit NeuroscanClient.exe:
BCI2000 waits indefinitely, Scan 4.5 recognizes a client but does not transfer any data.

4. BCI2000 V3.0.5 + 32bit Matlab 2015b + 32bit V3.0.5 NeuroscanClient.exe :
BCI2000 receives data successfully, but it always fails the roundtrip time check after about 5 minutes. I only have access to Scan 4.5 but not Neuroscan Access SDK and it seems that Scan 4.5 locks the block period to 40ms, i.e. I can only have combinations such as 1000Hz/40 Block size and 500Hz /20 Block size. For my application, I don't want to go below 500Hz, but all supported frequencies above 500Hz fail the timecheck.


I have done all the testings on a very powerful machine running windows 7 64 bit. I have optimized my matlab code as much as I can. Previously, I have used the same Matlab signal processing and application with g.USBamp recording at 600Hz / 30 Block size on BCI2000 V3.6 64bit. Everything worked like a charm and never once did I receive any time warning.

It'll be great if you can give me some advice. I am most interested in solving the problem in test case 2 because BCI2000 v3.6 still seems like a better choice to me.


Thanks.
David

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Neuroscan command line tool

Post by pbrunner » 19 Oct 2016, 16:51

David,

thanks for the extensive testing. I might have to ask you to help me with further isolating the issue. For this I might ask you let me debug the issue on your machine using a TeamViewer remote session. Let me know if that would be possible for you.

In the meantime, I can offer you a workaround to overcome the 50ms block issue. Essentially what is happening is that it takes more than 50ms to complete a block, mostly because the MATLAB code requiring more than that time for each block. This results in the Scan 4.5 software filling up its transmission buffer. You can actually see that in the Scan 4.5 software. The buffer should always be around 0%. If it becomes larger than 0% this means that you are actually processing data with an increasing delay. The workaround that I can offer is, that you are executing your MATLAB code only every other block, i.e., ever 100ms. So the output of every odd block is computed and the output of every even block is the same as the previous block. With this you still create a block cycle longer than 50ms, but you will catch up with the next block, which means that your buffer will hover around 0-1%.

Let me know if this is a suitable workaround for you.

Regards, Peter

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests