LSL Stream Delay
fafapv
New Jersey
in OpenBCI_GUI
Hi,
I am using the LSL widget in the GUI (v 5.0.0) to stream data to a custom application in Java. There appears to be a 5 - 10 second delay between an EEG artifact such as a blink and recognition in the Java program. Any ideas as to why this would be happening?
Thanks,
Josh
Comments
Also I am noticing that when I stream using the time plot option, I lose the 16th channel. It appears that the sample number takes its place. Is there any way to fix this so I get data for the 16th channel.
Honestly, it would be better to directly use BrainFlow Java binding instead of trying to stream LSL, just like we do in the GUI.
UDP method might be working better than LSL right now. I would say that we are going to take a closer look at LSL streaming, but this has been done MANY times, and there is rarely enough information to warrant changing the code. In fact, the last time I modified GUI code to "fix" LSL, we broke it! And an LSL maintainer had to come in and explain. I can say that an action item exists to take a closer look at LSL, but please just try another option for now, unless you can fix this and share the fix. I have never seen the delay when streaming LSL, though others have mentioned it, which makes this impossible to debug.
Thanks Richard.
@fafapv, what OS and laptop are you using? Is it possible the delay could be related to your particular computer? Do you have another machine in the area you could try?
re: 16th channel loss; is this occurring only in your LSL stream, or also in OpenBCI_GUI v5 time series display? If the latter, then it is possible your Cyton firmware has glitched and needs refreshing. Which may in turn relate to the delays.
https://docs.openbci.com/docs/02Cyton/CytonProgram
Regards, William
@retiutut and @wjcroft, Thanks for the responses and information. I am using Windows 10 on an HP Pavilion gaming desktop. I have a microsoft surface I could use as well.
The 16th channel loss is occurring only in the LSL stream. I would suspect it is due the specification of 16 channel total and it confusing the sample number as the first channel therefore dropping the actual 16th channel.
It may be worth my time changing over to Brainflow as suggested.
Thanks again,
Josh
This sounds like there could be a coding error on my part from removing the #Chan textfield. I will look into this.
In the past, before they were 'deprecated' (in favor of the new approach with Brainflow) -- there were two Python repos that provided LSL streaming from Cyton serial port connections. It seems it would be helpful, at least for comparisons, if a Brainflow to LSL stream generator program was available. Any plans for that?
https://github.com/openbci-archive
[pyOpenBCI is the newer repo, OpenBCI_Python the original]
One downside to these approaches is that they cannot stream from Ganglion (other than on Linux). Cyton serial port is the main device supported.
William
I'm not very familiar with python and its syntax but I'll give them a look. Thanks for the information.
The Python apps mentioned are self-contained, with operation instructions. Require no Python programming knowledge.
@wjcroft and @retiutut, I had a discussion with my advisor and we both agree it would be a good idea to switch over to using BrainFlow on our end. Do you guys have any documentation to make the process easier? Any suggestions for research material would be greatly appreciated.
@Fafapv Use https://brainflow.readthedocs.io/en/stable/
and
GUI development branch (fully functional w/ BrainFlow java)
https://github.com/OpenBCI/OpenBCI_GUI/tree/development
The idea for Networking Widget is for proof-of-concept and getting started. Complete rigs/systems should try to use one of the BrainFlow bindings.
I think you will find greater success this way, and I also agree with you and your advisor. Take Care!
-RW
Thanks a bunch!
Here are the BrainFlow Java examples: https://brainflow.readthedocs.io/en/stable/Examples.html#java
@retiutut and @wjcroft, sorry one more quick question. Both in BrainFlow and in the openBCI GUI itself I am noticing that the sampling index is only ever an odd number. Does this mean I am losing data or is this normal with the new shift to BrainFlow?
There are two over-the-air radio 'packets' (even and odd) per 16 bit 'sample'.
https://docs.openbci.com/docs/02Cyton/CytonDataFormat#16-channel-data-with-daisy-mdule
William