sccn / BCILAB

MATLAB Toolbox for Brain-Computer Interface Research
Other
198 stars 120 forks source link

Read input from neuroscan recorder could not work #71

Open Zhang-Mengfan opened 3 years ago

Zhang-Mengfan commented 3 years ago

We select Online Analysis ---> Read input from... --> Neuroscan Recorder in the menu. We use Curry8 to send the data to Netstreaming (TCP/IP). So we input the TCP and port address of Curry8, then the MATLAB command window shows ‘Neuroscan Scan connection established’. However, after that, MATLAB shows "busy", and we could not open any drop-down menu by clicking the button on the bci menu. Also, MATLAB could not run any other commands as well.

MATLAB version: MATLAB R2019a

Curry8: Amplifier: SynAmps2 / RT Configuration: Quik-Cap 64 HV500 Sample Rate: 500 Hz

What could we do to make the real-time streaming work?

chkothe commented 3 years ago

Hi, this is a fairly old API I believe and I'm not sure that it still works properly. However, as an alternative you could try to read from the Lab Streaming Layer (LSL) into BCILAB and use the NeuroScan Acquire LSL Adapter (https://github.com/labstreaminglayer/App-NeuroscanAcquire) to convert between the Acquire software (available from NeuroScan) and LSL. It's a lot of steps but we had recently confirmed that this workflow works (we had tested with NeuroPype for the BCI but I'm assuming that BCILAB should be able to read the data too).

Zhang-Mengfan commented 3 years ago

We tried to read from the Lab Streaming Layer (LSL) into BCILAB by using the NeuroScan Acquire LSL Adapter you suggested above. The NeuroScan Acquire LSL Adapter did work, and Curry8 said "Accepted connection from client...". However, we could not open any drop-down menu by clicking the button on the bci menu after starting reading input from LSL. When we interrupt the program by pressing "control + C", it turned out the code is stuck at "result = lsl_resolve_bypred(lib,opts.data_query); end" in "run_readlsl".

We also downloaded an online stream viewer from https://github.com/labstreaminglayer/App-MATLABViewer/. We run "vis_stream", but it showed an error "There is no stream visible on the network".

We also followed some instructions from https://github.com/sccn/BCILAB/issues/20 and https://openbci.com/forum/index.php?p=/discussion/761/unable-to-input-openbci-lsl-stream-in-bcilab. Such as clearing the Marker Query field, moving the LSL/Apps/MATLABViewer/liblsl-Matlab from LSL's current github repo to replace BCILAB/dependencies/liblsl-Matlab, and downloading a newer version from https://github.com/Epist/bci_focus/blob/master/Server/bin/liblsl64.dylib, but the program is still stuck at the same place.

Do you have any other suggestions?

On the related note, we see that sending the data in Curry 8 to ExamplePlot.m (part of Neuroscan/Curry 8/Matlab) works, as it automatically starts the MATLAB and plots a real-time data streaming figure. Is there any way that BCILAB can read this data directly?

cboulay commented 3 years ago

I don't use BCILAB nor NeuroScan hardware so I can't help there. I just wanted to clear up: that liblsl dylib you pointed to is not "a newer version". The latest version can be obtained here: https://github.com/sccn/liblsl/releases

chkothe commented 3 years ago

Ok that's definitely puzzling -- this would suggest that the acquire LSL app is for some reason not sending the stream. I could imagine a protocol version incompatibility, but debugging that would probably require single-stepping through the code of App-NeuroScanAquire (this is all on Windows right?). So given that none of us over here have NeuroScan hardware at hand right now, maybe the clearest path forward would be to instead take the Curry8 MATLAB example you mentioned and to make a version 2 of run_readneuroscan.m from it to get the data streamed into BCILAB. This could be fairly simple (eg like https://github.com/sccn/BCILAB/blob/devel/code/online_plugins/BioSemi/run_readbiosemi.m#L63-L66), but sometimes these things turn into rabbit holes.

chkothe commented 3 years ago

The other thing worth checking is if a firewall blocks LSL transmission on your PC, which would result in none of the LSL examples working - there is a troubleshooting page on this in the LSL documentation.

Zhang-Mengfan commented 3 years ago

Thank you for your suggestions. We tried to turn off windows firewall for the public and private network, but it still said "There is no stream visible on the network". We inspected the ExamplePlot.m that curry 8 is using to send data to MATLAB. We hope that we can use those data to fit into BCILAB data format. At this point, we do not see a way forward in using TCP/port connection with NeuroScan Acquire LSL Adapter which was supposed to be sending data to MATLAB via LSL because liblsl compiling by build-mex was successful but it didn't change the situation and we still did not see the stream. Are there any laboratories or researchers using NeuroScan + Curry 8 for bcilab successfully?

arnodelorme commented 3 years ago

You need to reinstall the LSL binaries in the dependency folder of BCILAB using the released code at

https://github.com/labstreaminglayer/liblsl-Matlab

BCILAB LSL binaries are outdated