ChrisVeigl / BrainBay

Open Source Biofeedback Software
http://brainbay.lo-res.org
Other
163 stars 52 forks source link

BrainFlow element does not work #31

Closed Otemo closed 2 years ago

Otemo commented 2 years ago

Thank you for supporting Brainflow, I think BrainBay v2.6 could record EEG using openBCI (Ganglion) without going through openBCI-Hub.

Insert Element > Source > Biosignal/EEG Amlifilter > BrainFlow-Compatible

When I try to create a new design file using the above procedure, BrainBay is forced to shut down. Do you have any solution?

ChrisVeigl commented 2 years ago

i have no idea ... this problem does not happen at my end ... please start brainBay.exe -debug from commandline and post the output here.

Otemo commented 2 years ago

Thank you for your reply. I was able to use this element without any problem when I followed your advice and started from the windows command prompt. However, when I run it normally from the windows menu, Brainbay is forced to close when I try to add the BrainFlow element. Here are results when Brainbay is started from commandline.

commandline:-debug initialising Brainflow object ... Brainflow: Board created. Update channels for Device ID -1, device name = Synthetic Board description = {"accel_channels":[17,18,19],"battery_channel":29,"ecg_channels":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"eda_channels":[23],"eeg_channels":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"eeg_names":"Fz,C3,Cz,C4,Pz,PO7,Oz,PO8,F5,F7,F3,F1,F2,F4,F6,F8","emg_channels":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"eog_channels":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"gyro_channels":[20,21,22],"marker_channel":31,"name":"Synthetic","num_rows":32,"package_num_channel":0,"ppg_channels":[24,25],"resistance_channels":[27,28],"sampling_rate":250,"temperature_channels":[26],"timestamp_channel":30} the package number is at channel 0 the sampling rate is 250 Number of rows:32 available channels are as follows: Now trying to add exg channels: chn1:exg chn2:exg chn3:exg chn4:exg chn5:exg chn6:exg chn7:exg chn8:exg chn9:exg chn10:exg chn11:exg chn12:exg chn13:exg chn14:exg chn15:exg chn16:exg Now trying to add eda channels: chn23:eda Now trying to add res channels: chn27:res chn28:res Now trying to add temp channels: chn26:temp Now trying to add accel channels: chn17:accel chn18:accel chn19:accel Now trying to add gyro channels: chn20:gyro chn21:gyro chn22:gyro Now trying to add ppg channels: chn24:ppg chn25:ppg Now trying to add pcount channels: chn0:pcount Now trying to add batt channels: chn29:batt Now trying to add time channels: chn30:time Now trying to add marker channels: chn31:marker Added total number of 32 data channels! Brainflow: Device ID selected: 1 Brainflow: release current Board. Brainflow: delete Board class Brainflow: Board release done. Brainflow: Board created. Update channels for Device ID 1, device name = Ganglion Board description = {"accel_channels":[5,6,7],"ecg_channels":[1,2,3,4],"eeg_channels":[1,2,3,4],"emg_channels":[1,2,3,4],"eog_channels":[1,2,3,4],"marker_channel":14,"name":"Ganglion","num_rows":15,"package_num_channel":0,"resistance_channels":[8,9,10,11,12],"sampling_rate":200,"timestamp_channel":13} the package number is at channel 0 the sampling rate is 200 Number of rows:15 available channels are as follows: Now trying to add exg channels: chn1:exg chn2:exg chn3:exg chn4:exg Now trying to add res channels: chn8:res chn9:res chn10:res chn11:res chn12:res Now trying to add accel channels: chn5:accel chn6:accel chn7:accel Now trying to add pcount channels: chn0:pcount Now trying to add time channels: chn13:time Now trying to add marker channels: chn14:marker Added total number of 15 data channels! Brainflow: start session. Brainflow: Session prepared. Brainflow: Stream started. Sync lost: expected:0 but got: 102 Sync lost: expected:103 but got: 102 Sync lost: expected:104 but got: 103 Sync lost: expected:105 but got: 104 Sync lost: expected:106 but got: 105 Sync lost: expected:107 but got: 106 Sync lost: expected:108 but got: 107 Sync lost: expected:109 but got: 108

Sync lost: expected:159 but got: 158 Sync lost: expected:160 but got: 159 Sync lost: expected:161 but got: 160 Sync lost: expected:162 but got: 161 Sync lost: expected:163 but got: 162 Sync lost: expected:164 but got: 163 Sync lost: expected:165 but got: 164 Brainflow: Stream stopped. Brainflow: session released Brainflow: Exception handler triggered. Brainflow: Exception handler triggered. Brainflow: Exception handler triggered. Brainflow: release current Board. Brainflow: delete Board class Brainflow: Board release done.

ChrisVeigl commented 2 years ago

well.... i have no idea why it works via commandline and fails when started "normally"... however it looks if there is a sync error detected where there is no sync error ;-)

do you recieve correct data (and is this work-around thus useable for you) ? i currently have no time to look at the issue, in 3-4 weeks - when time budget looks better - i'd be happy to test tweaks (and at least correct the sync problem)!

Otemo commented 2 years ago

Many people in Japan have been helped by BrainBay, which you developed.

I have tried it on different laptops and confirmed the same issue. As long as I run it via the command prompt, BraiBay seems to work as well as it ever did with the BrainFlow element. The data also seems to be receiving without problems.

If I notice anything else, I will report it here. Thank you very much.

ChrisVeigl commented 2 years ago

Many people in Japan have been helped by BrainBay, which you developed.

great to hear that :) we should really start a user forum and share designs/experience (finally!)

I have tried it on different laptops and confirmed the same issue. As long as I run it via the command prompt, BrainBay seems to work as well as it ever did with the BrainFlow element.

you mean "without the BrainFlow Element" ? really strange... i tried on 2 different Laptops and 1 Desktop-PC (Win10, Win8.1) and never had that issue.... maybe the console output itself is the problem and it happens only if Git Bash is not installed etc. .... (!)

what happens if you start Brainbay from shell window without the -debug parameter ?

The data also seems to be receiving without problems.

good to know! - but do you constanlty get the sync error (for every data packet) ?

Otemo commented 2 years ago

Thank you for your reply.

you mean "without the BrainFlow Element" ?

Sorry I confused you! I meant that "as long as I run it via the command prompt, BrainBay seems to work as well as it ever did WITHOUT the BrainFlow element".

what happens if you start Brainbay from shell window without the -debug parameter ?

There is no problem in this case either.

but do you constantly get the sync error (for every data packet) ?

I'm going to take a closer look at this one. I will report back later.

Otemo commented 2 years ago

Hi there,

do you constantly get the sync error (for every data packet) ?

Yes. Looks like it. Here is a video. >movie

ChrisVeigl commented 2 years ago

i see... thanks! to me this looks like a problem in the Brainflow API (because i get the sync value from Brainflow - and it is correct for the Simulation device an other devices). Not a big problem though (it creates unnessary CPU low, but as long as the singal comes in correctly it's not a big issue). The question why everything crashes in case the debug console is not open remains ...

ChrisVeigl commented 2 years ago

another question: does the crash also happen when you use the Synthetic Board (simulation device) instead of the Ganglion, e.g. if you load the demo design "OtherDemos\Brainflow_test.con" ?

Otemo commented 2 years ago

I've done three operational tests, including your order. Please see the video here!

3-tests

ChrisVeigl commented 2 years ago

interesting! it works after you loaded a demo configuration! i think this indicates a problem with the path... could you try if it works when you start brainbay directly from the folder where it was installed ? (usually C:\Users\\AppData\Local\BrainBay)

Otemo commented 2 years ago

could you try if it works when you start brainbay directly from the folder where it was installed ?

I tried the procedure you specified. It worked fine!

ChrisVeigl commented 2 years ago

so it's probably just a issue with the default folder, if Brainbay is started via the shortcut.... could you try to adjust the start folder parameter of the shortcut-link by right clicking -> properties, see screenshot ScreenHunter_603 Feb  17 14 50 :

ChrisVeigl commented 2 years ago

i think this really was the reason - i could replicate the problem on another computer! the problem was just in the installer: the working directory was not set correctly... please try to uninstall Brainbay and download the updated version of Setup.exe from the release page: https://github.com/ChrisVeigl/BrainBay/releases/tag/v2.6

Otemo commented 2 years ago

Great! everything works fine now. I will continue to tell as many people in Japan as possible to take advantage of this wonderful program you have developed. Thank you for your continued support.

ChrisVeigl commented 2 years ago

ok great - so we can close the issue! BTW: what about starting a user forum for BrainBay - for exchanging experience and designs ?

Otemo commented 2 years ago

I agree wholeheartedly. I'm in!

ChrisVeigl commented 2 years ago

my question was more like "would you like to start a Brainbay user forum ..." ;-)

Otemo commented 2 years ago

It looks interesting. I don't have much knowledge on how to set up a forum, such as platforms, but I'd like to try it!

ChrisVeigl commented 2 years ago

i just created a forum using phpBB3, see: https://brainbay.iphpbb3.com

i don't have much experience with it - but you could try to add a user and a first topic :-)

Otemo commented 2 years ago

Great! Thanks for setting up the forum. I will make use of it.  By the way, the forum doesn't work for me, I get a "Unauthorized 08815 bl JP" error.

ChrisVeigl commented 2 years ago

hmmm --- did you register as a user ?

Otemo commented 2 years ago

Thank you for your reply For some reason, I can't access the following URL you specified ... https://brainbay.iphpbb3.com/

ChrisVeigl commented 2 years ago

i just asked 2 friends to register and post a test thread, it worked for both - so it seems that the forum works. maybe try to register another time ?