ChrisVeigl / BrainBay

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

possible route to support both V1 and V2 Muse headbands (via LSL / Brainflow) #24

Closed wjcroft closed 2 years ago

wjcroft commented 5 years ago

Chris, hi.

The Muse LSL package can output an LSL stream from both the original and new model of the Muse. Might be more incentive for LSL support.

And... Consider that if Ganglion access through the Hub ever gets redefined in a future GUI revision -- that LSL output from OpenBCI will always be supported. The devs at OpenBCI are not fond of the support headaches involved in the Hub mechanism, and are considering (long term), in dropping the Hub idea and using low level C library routines to access each type of device. These would likely be linked with the Processing / Java / JNI mechanism.

Here's the Muse LSL,

https://github.com/alexandrebarachant/muse-lsl

Cheers,

William

wjcroft commented 5 years ago

An OpenBCI forum user raised this question yesterday, which prompted my posting this potential avenue to support Muse. As you know, Muse has stopped supporting their SDK library for both old and new Muse hardware. Thus 3rd party solutions such as Muse LSL seem to be the only avenue to get the raw data now.

http://openbci.com/forum/index.php?p=/discussion/2132/muse-headband-and-brainbay

Sadly for apparent economic motivations, Muse is now moving to a subscription model ("Muse Direct") for customers who want raw data access. See above link for more details. Fortunately Muse LSL bypasses this poor customer support policy.

ChrisVeigl commented 5 years ago

thanks for the info! LSL support is definitely on the ToDo stack !

terabera commented 5 years ago

Hello! I own a 2014 Muse and would be deeply grateful if you were able to add support for this device through the OSC stream in Muse Monitor which sends the data in a raw format. I am intending to perform neurofeedback and understand that BrainBay is excellent for the purpose. This feature would mean a lot (!) to me. Muse Monitor it must be because MuseDirect is no longer offered, and Muse Monitor is excellent because it has no delay at all and also filters out electrical noise from the data before streaming it away. There is already an implementation of this in a third party software called Neurovisual. Thank you in advance.

terabera commented 5 years ago

The 2014 Muse has 4 sensors: TP9 + Fp1 + Fp2 + TP10 and it should be an okay device for the purpose, as Myndlift has demonstrated (although they use extra electrode - if you added support for this too I'd be incredibly impressed, but this is no necessity for now). ;)

terabera commented 5 years ago

If you need help with the mere "looking things up"-aspect of implementing this feature, I'd happily contribute since I have access to both a Muse and Muse Monitor (both of which are identical on Muse 2014 and 2016, though not the Muse 2, which does not connect to third party software).

ChrisVeigl commented 5 years ago

Hi terabera,
I'm sorry but as it looks now i won't be able to implement this in the very near future .... I'd really like to add LSL support, but i'm currently covered in other work .... I'll come back to this project as time permits.

terabera commented 5 years ago

Hi Chris, I do not know what LSL is, but I do know that all that is required is an interpretation of the OSC stream. It is possible that other Muses use LSL, but the Muse I have sends its data over the local network in an OSC stream that is easily converted into CSV, MATLAB, MUSE file formats or simply listened to through the stream. Have I missed something?

It seems that the people over at the Muse forum have been able to connect their Muse to Brainbay but I really have no idea how ^_^.

Thanks!

Noah

terabera commented 5 years ago

OSC stream is what I meant to write*

andraderenew commented 3 years ago

Hi @terabera and @ChrisVeigl. To the former I would say thank you for pointing towards neurovisual. I didn't know about it. About LSL is like OSC although the former is for bluetooth and the latter for wifi but you would need Blue Muse for Windows, Muselsl for ubuntu(linux) and UvicMuse for MAC OS (Apple). As far as I have gone is using openvibe with LSL with muselsl in ubuntu 18.04. Blue Muse doesn't seem to work smoothly in Windows (it usually doesn't recognize the muse device). Also brainbay would be nice if it had lsl support. That would do the trick no matter if usb extra electrode or not. I also have access to mind monitor and never use muse direct or old sdk. True that myndlift have proven neurofeedback with few electrodes as 4 in this case with 3 for reference. Neurofeedback or openvibe works fine with 5 electrodes for certain things.

FilexD commented 3 years ago

Hi, the develper of neurovisual just wrote me that he decided to stop working on the code. Maybe some it could be "added" to brainbay?

ChrisVeigl commented 3 years ago

hi,

is the code available somewhere (e.g. github) so that we could have a look ?

regards, chris

Am Do., 19. Aug. 2021 um 16:47 Uhr schrieb FilexD @.***

:

Hi, the develper of neurovisual just wrote me that he decided to stop working on the code. Maybe some it could be "added" to brainbay?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ChrisVeigl/BrainBay/issues/24#issuecomment-901977635, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQFBLQR2ELSYWSNO5XZM3T5UKNVANCNFSM4HN3RLXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

wjcroft commented 3 years ago

Also, regarding supporting various EEG devices, including Muse -- here is the current table of devices with Brainflow support. And Muse 2 and S are on there.

https://brainflow.readthedocs.io/en/stable/SupportedBoards.html

As you can also see, both Ganglion and Cyton are there as well. The previous Ganglion support in BrainBay, depended on the old OpenBCI GUI 'Hub' process. Which now no longer exists. So as far as BrainBay mods that allow additional device types, Brainflow may actually be a better first step than LSL. Although having the LSL at a later date would certainly be welcome. Here is the current LSL list, which tends to have more very high end research equipment. Which generally is less aligned with Maker-community BrainBay users.

https://labstreaminglayer.readthedocs.io/info/supported_devices.html

Regards, William Croft, OpenBCI

andraderenew commented 3 years ago

I didn’t know about brainflow it seems to be a great gift.

I have more experience now with muse and I have used lsl library with uvicmuse or blue muse with the bled dongle that allows to connect usually without much trouble.

Also mind monitor with OSC.

Also I can say I have tried in Bioera a trial version to use muse with OSC (mindmonitor) as some user suggested.

Also I think it would be easier to do with brainflow although if lsl is possible I think is better as it seems to me that LSL library would have a longer life avoiding discontinuity

I am willing to do some testing if muse hardware is required

wjcroft commented 3 years ago

Also I think it would be easier to do with brainflow although if lsl is possible I think is better as it seems to me that LSL library would have a longer life avoiding discontinuity

Brainflow team is now getting long term support funding from OpenBCI and I believe other device companies. So the "longer life" speculation is not applicable.

andraderenew commented 3 years ago

Also I think it would be easier to do with brainflow although if lsl is possible I think is better as it seems to me that LSL library would have a longer life avoiding discontinuity

Brainflow team is now getting long term support funding from OpenBCI and I believe other device companies. So the "longer life" speculation is not applicable.

Perfect then! I didn’t know the details!!

wjcroft commented 3 years ago

Another advantage to Brainflow over LSL: If BrainBay calls the Brainflow library device interface functions, then BrainBay has a DIRECT connection to the device. Without needing any external applications. To contrast, most use of LSL requires another application to source the LSL stream. That stream then goes over TCP and is received by the LSL library in BrainBay.

So LSL usage involves more complexity in setting up the initial LSL streaming application. Then further details in configuring to receive the LSL stream in BrainBay. Finally because of the TCP connections and two apps involved, there is more latency and buffering with an LSL connection. Especially with real-time neurofeedback applications, added latency can affect the timeliness of the feedback process.

William Croft

FilexD commented 3 years ago

hi, is the code available somewhere (e.g. github) so that we could have a look ? regards, chris Am Do., 19. Aug. 2021 um 16:47 Uhr schrieb FilexD @.*** : Hi, the develper of neurovisual just wrote me that he decided to stop working on the code. Maybe some it could be "added" to brainbay? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#24 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQFBLQR2ELSYWSNO5XZM3T5UKNVANCNFSM4HN3RLXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

For technical reasons there is not something like a github deposit for the sofware but I think you have to ask to him. He answered very nicely to me in few hours. On the web site, click on "contact" and it will show his email adress : http://www.mindresearch.xyz

ChrisVeigl commented 3 years ago

Brainflow sounds like an interesting option! First we need investigate what it needs to get BrainBay compiled with MSVC 2019. I suppose there will be problems with some of the included libraries / dlls ....

Next, the C++ examples from the Brainflow project could be integrated into BrainBay - I'm not sure how much effort that would be, but if successful, serveral other devices could be used (not just the Muse headbands).

FilexD commented 3 years ago

Some fresh news about developing with Muse (2): https://anushmutyala.medium.com/muse-101-how-to-start-developing-with-the-muse-2-right-now-a1b87119be5c

wjcroft commented 3 years ago

Chris, hi.

Brainflow sounds like an interesting option! First we need investigate what it needs to get BrainBay compiled with MSVC 2019.

It only needs C++ capability. All the various languages supported are wrappers for the C++ code.

I suppose there will be problems with some of the included libraries / dlls .... ...

I believe any 'manufacturer-supplied-dlls' (object only, no source), are actually quite rare in the collection of devices supported by BrainFlow. And if such dll's are needed for a particular device, they are loaded dynamically, only if that device is used. So using BrainFlow with OpenBCI, Muse, etc., should not hit any unexpected dll issues.

And I also believe the dynamic loading applies also for BrainFlow devices for which the source is available. The device object code is only loaded if that particular device is initialized. So the actual runtime BrainFlow code size is quite small, only including the device you are using.

ChrisVeigl commented 3 years ago

hi William!

I expect dll/library problems because of the legacy of the modules involved in BrainBay (for example old versions of OpenCV and other projects which have been integrated into Brainbay more than 10 years ago, using an outdated version of Visual Studio and a toolset which is not supported anymore).

Nevertheless I want to give it a try - the advantages of a Brainflow interface would be huge, and we could finally get support for the Muse devices (and others), more than 2 years after this issue has been opened!

ChrisVeigl commented 3 years ago

I'm happy to announce a first version of the Brainflow library integration - which should enable Muse compatibility (besides other biosignal acquisition devices)! I could not test this with real hardware by now - so this is really in an "hardcore alpha stage" ;-)

You could give it a try by cloning or downloading the branch https://github.com/ChrisVeigl/BrainBay/tree/VS2019_brainflow respectively the .zip-file https://github.com/ChrisVeigl/BrainBay/archive/refs/heads/VS2019_brainflow.zip

Start brainbay.exe inside the bin folder (better from console/shell window which shows additional infos and error messages), then right-click the eeg-element and select your desired board + edit necessary connection parameters). Then press apply and start the session. (BTW: archive file rec/playback is not supported by now.)

In my case i get a connection error when i want to connect with the Muse (which is obvious because i do not have the device attached ;-) Looking forward to your test results ..

FilexD commented 3 years ago

I have the device and ubuntu. The device can connect (bluetooth) but the command "dmesg -w" can not display any information about it (I've tried with my phone : it displays on the last line of results). The brainflow web site indicates that a BLED112 dongle i needed. I'ma going to buy one and then I will be able to tell you how brainBay works with the headband.

andraderenew commented 3 years ago

I will be at home by mid September and I can try to see if it works. I have muse and also the bled dongle.

On 28 Aug 2021, at 10:57, Chris Veigl @.***> wrote:

I'm happy to announce a first version of the Brainflow library integration - which should enable Muse compatibility (besides other biosignal acquisition devices)! I could not test this with real hardware by now - so this is really in an "hardcore alpha stage" ;-)

You could give it a try by cloning or downloading the branch https://github.com/ChrisVeigl/BrainBay/tree/VS2019_brainflow https://github.com/ChrisVeigl/BrainBay/tree/VS2019_brainflow respectively the .zip-file https://github.com/ChrisVeigl/BrainBay/archive/refs/heads/VS2019_brainflow.zip https://github.com/ChrisVeigl/BrainBay/archive/refs/heads/VS2019_brainflow.zip Start brainbay.exe inside the bin folder (better from console/shell window which shows additional infos and error messages), then right-click the eeg-element and select your desired board + edit necessary connection parameters). Then press apply and start the session. (BTW: archive file rec/playback is not supported by now.)

In my case i get a connection error when i want to connect with the Muse (which is obvious because i do not have the device attached ;-) Looking forward to your test results ..

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChrisVeigl/BrainBay/issues/24#issuecomment-907638003, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMK5BYBCT3TWWVP5PFTT7D2O5ANCNFSM4HN3RLXQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChrisVeigl commented 3 years ago

I have the device and ubuntu. The device can connect (bluetooth) but the command "dmesg -w" can not display any information about it (I've tried with my phone : it displays on the last line of results). The brainflow web site indicates that a BLED112 dongle i needed. I'ma going to buy one and then I will be able to tell you how brainBay works with the headband.

it's mandatory that you have your device running (and that you can see correct live data) before you test the new brainbay/brainflow integration. I also recommend to try it first under Windows. I am not sure how the linux support works in the recent version. might work under wine / mono - but not sure. you could also try inside a virtual machine running Windows. Anyhow i am interested in the results you get - and if you find a way to make it work under Linux.

ChrisVeigl commented 3 years ago

I will be at home by mid September and I can try to see if it works. I have muse and also the bled dongle.

alright - this thread is 2 years old - so no hurry ;-)

ChrisVeigl commented 3 years ago

I will be at home by mid September and I can try to see if it works. I have muse and also the bled dongle.

any news ? - please try to download the zip from the brainflow branch https://github.com/ChrisVeigl/BrainBay/archive/refs/heads/master.zip

and run brainbay from the bin folder, using the shell window (so you can see status messages which appear on the console ...)

andraderenew commented 3 years ago

I will try later tonight and I will let you know with anything!!!

Sent from my iPhone

On 19 Sep 2021, at 19:18, Chris Veigl @.***> wrote:

 I will be at home by mid September and I can try to see if it works. I have muse and also the bled dongle. …

any news ? - please try to download the zip from the brainflow branch https://github.com/ChrisVeigl/BrainBay/archive/refs/heads/master.zip

and run brainbay from the bin folder, using the shell window (so you can see status messages which appear on the console ...)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

andraderenew commented 3 years ago

Please let me know like I were dumb the steps.

I open with the shell brainy inside bin folder

Then what?

I open bluemuse connect it to muse and then what else shall I do in brain bay to let it show me it works.

I tried searching inside Insert Element > Source > Biosignal EEG amplifier and then I don’t see muse or anything similar.

Do I need to use brainflow directly or lsl acquisition servers from openvibe? I think am overthinking this too much. Probably is much simpler.

On 19 Sep 2021, at 21:09, Renew Andrade @.***> wrote:

I will try later tonight and I will let you know with anything!!!

Sent from my iPhone

On 19 Sep 2021, at 19:18, Chris Veigl @.***> wrote:



I will be at home by mid September and I can try to see if it works. I have muse and also the bled dongle. … <x-msg://1/#> any news ? - please try to download the zip from the brainflow branch https://github.com/ChrisVeigl/BrainBay/archive/refs/heads/master.zip https://github.com/ChrisVeigl/BrainBay/archive/refs/heads/master.zip and run brainbay from the bin folder, using the shell window (so you can see status messages which appear on the console ...)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChrisVeigl/BrainBay/issues/24#issuecomment-922507217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMN2VBFG4CAU6LL4EC3UCYLMTANCNFSM4HN3RLXQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChrisVeigl commented 3 years ago

Can you add the signal source -> EEG/Biosignal Amplifier -> BrainFlow-Compatible ( .... muse ...)

When you connect / start the session you should see messages at the console window.

I have no idea what needs to be done to setup / connect your muse device ... I suppse it should be sufficient to connect the dongle (and maybe pair it somehow)... the guys over at Brainflow should know the process.

andraderenew commented 3 years ago

I don’t see that option although I had a previous brain bay program installed which I uninstalled. May be that is interfering with the version I downloaded from the link you gave previously. I am trying again after rebooting my windows. I keep you posted!!

On 19 Sep 2021, at 22:08, Chris Veigl @.***> wrote:

Can you add the signal source -> EEG/Biosignal Amplifier -> BrainFlow-Compatible ( .... muse ...)

When you connect / start the session you should see messages at the console window.

I have no idea what needs to be done to setup / connect your muse device ... I suppse it should be sufficient to connect the dongle (and maybe pair it somehow)... the guys over at Brainflow should know the process.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChrisVeigl/BrainBay/issues/24#issuecomment-922529203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMO7PAP7NQTKRETXBQ3UCY7NJANCNFSM4HN3RLXQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

andraderenew commented 3 years ago

I have rebooted so last old brain bay is gone. Still I don’t see anything like brainflow or muse in brain bay

On 19 Sep 2021, at 22:14, Renew Andrade @.***> wrote:

I don’t see that option although I had a previous brain bay program installed which I uninstalled. May be that is interfering with the version I downloaded from the link you gave previously. I am trying again after rebooting my windows. I keep you posted!!

On 19 Sep 2021, at 22:08, Chris Veigl @. @.>> wrote:

Can you add the signal source -> EEG/Biosignal Amplifier -> BrainFlow-Compatible ( .... muse ...)

When you connect / start the session you should see messages at the console window.

I have no idea what needs to be done to setup / connect your muse device ... I suppse it should be sufficient to connect the dongle (and maybe pair it somehow)... the guys over at Brainflow should know the process.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChrisVeigl/BrainBay/issues/24#issuecomment-922529203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMO7PAP7NQTKRETXBQ3UCY7NJANCNFSM4HN3RLXQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

andraderenew commented 3 years ago

Sorry about earlier I thought it was the latest link but then I came up with previous link 2019 one and I downloaded that one and it does work!!! You don’t need more then the COM port and select the type of muse which in my case is muse 2.

On 19 Sep 2021, at 23:08, Renew Andrade @.***> wrote:

I have rebooted so last old brain bay is gone. Still I don’t see anything like brainflow or muse in brain bay

On 19 Sep 2021, at 22:14, Renew Andrade @. @.>> wrote:

I don’t see that option although I had a previous brain bay program installed which I uninstalled. May be that is interfering with the version I downloaded from the link you gave previously. I am trying again after rebooting my windows. I keep you posted!!

On 19 Sep 2021, at 22:08, Chris Veigl @. @.>> wrote:

Can you add the signal source -> EEG/Biosignal Amplifier -> BrainFlow-Compatible ( .... muse ...)

When you connect / start the session you should see messages at the console window.

I have no idea what needs to be done to setup / connect your muse device ... I suppse it should be sufficient to connect the dongle (and maybe pair it somehow)... the guys over at Brainflow should know the process.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChrisVeigl/BrainBay/issues/24#issuecomment-922529203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMO7PAP7NQTKRETXBQ3UCY7NJANCNFSM4HN3RLXQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

andraderenew commented 3 years ago

Congrats on the hard work btw!!

On 19 Sep 2021, at 23:19, Renew Andrade @.***> wrote:

Sorry about earlier I thought it was the latest link but then I came up with previous link 2019 one and I downloaded that one and it does work!!! You don’t need more then the COM port and select the type of muse which in my case is muse 2.

On 19 Sep 2021, at 23:08, Renew Andrade @. @.>> wrote:

I have rebooted so last old brain bay is gone. Still I don’t see anything like brainflow or muse in brain bay

On 19 Sep 2021, at 22:14, Renew Andrade @. @.>> wrote:

I don’t see that option although I had a previous brain bay program installed which I uninstalled. May be that is interfering with the version I downloaded from the link you gave previously. I am trying again after rebooting my windows. I keep you posted!!

On 19 Sep 2021, at 22:08, Chris Veigl @. @.>> wrote:

Can you add the signal source -> EEG/Biosignal Amplifier -> BrainFlow-Compatible ( .... muse ...)

When you connect / start the session you should see messages at the console window.

I have no idea what needs to be done to setup / connect your muse device ... I suppse it should be sufficient to connect the dongle (and maybe pair it somehow)... the guys over at Brainflow should know the process.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChrisVeigl/BrainBay/issues/24#issuecomment-922529203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMO7PAP7NQTKRETXBQ3UCY7NJANCNFSM4HN3RLXQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChrisVeigl commented 3 years ago

ah okay - great to hear that !!

thanks for testing. i will await William's trial with the OpenBCI baords and then (hopefully) release the new version :-)

andraderenew commented 3 years ago

Great to hear!!!

Sent from my iPad

On 20 Sep 2021, at 12:07, Chris Veigl @.***> wrote:

 ah okay - great to hear that !!

thanks for testing. i will await William's trial with the OpenBCI baords and then (hopefully) release the new version :-)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ChrisVeigl commented 2 years ago

with release 2.6, Brainflow support was added and the Muse devices (and others) should work now :-)