Closed PeterGamma closed 4 years ago
Connecting to LSL streams on Matlab: an example with the Muse
Step 1 Next to the already mentioned issue in step 1 that the Muse SDK is not available from http://developer.choosemuse.com anymore, there are further issues concerning the same example.
Step 2 Pair your computer with your Muse headset: James Clutterbuck, developer of the Muse Monitor writes: «The Muse 2 is almost impossible to pair on PC. I've tried many different Bluetooth USB devices and none of them work. It was similar with the 2016 Muse. Only the 2014 Muse is easy to pair on PC. This is why I only made Muse Monitor for Android/iOS. « https://musemonitor.com/forums/viewtopic.php?f=15&t=749
Step 2: connect to your Muse using muse-io James Clutterbuck, developer of the Muse Monitor writes: «Muse-io hasn't worked since 2016 anyway as it only worked with the 2014 Muse « https://musemonitor.com/forums/viewtopic.php?f=15&t=749&start=10
Possible solution to solve all of these issues:
Connect the Muse to the Muse Monitor application via bluetooth
The smartphone has to be in the same Wifi network as the PC which runs Matlab
The Muse Monitor App has an option to OSC (Open Sound Control Network Protocol) data streaming OSC Specification which paramaters Muse Monitor can stream can be seen here: https://musemonitor.com/FAQ.php#oscspec
Joren, computer scientist in the field of Music Informatics https://0110.be/About wrote a manual how to receive OSC in a MatLab: https://0110.be/posts/OSC_in_Matlab_on_Windows%2C_Linux_and_Mac_OS_X_using_Java
Modify the example Matlab OSC client Script in step 2 of the Manual to restore the example.
I complained in the Muse headband forum
about the fact, that the lack of the possibility to download the Muse SDK would destroy the LSL interface of the Swartz Center for Computational Neuroscience.
Now, the Muse SDK is available for download again, but only for chosen people:
from: https://choosemuse.com/development/
«If you are hosting a hackathon, an academic or institutional research project, or working on an educational application for neuroscience or neurotech, we will continue to offer support for your projects to the best of our ability (including the legacy SDK for Muse 2016). Please reach out to our R&D team at research@choosemuse.com.«
So the previous example for the Muse headband for Matlab should work again.
Be aware that there are different models of the Muse headband, and that there are problems with some models to pair them over bluetooth to a desktop PC.
For those models, the following instruction should work:
1. Connect the Muse to the Muse Monitor application via bluetooth
2. The smartphone has to be in the same Wifi network as the PC which runs Matlab
3. The Muse Monitor App has an option to OSC (Open Sound Control Network Protocol) data
streaming
OSC Specification which paramaters Muse Monitor can stream can be seen here: https://musemonitor.com/FAQ.php#oscspec
4. Joren, computer scientist in the field of Music Informatics
wrote a manual how to receive OSC in a MatLab: https://0110.be/posts/OSC_in_Matlab_on_Windows%2C_Linux_and_Mac_OS_X_using_Java
5. Modify the example Matlab OSC client Script in step 2 of the Manual to restore the example.
The Muse Monitor application is is now called Mind Monitor application.
For a discussion about Lab Streaming Layer (LSL), Muse headband and Mind Monitor, see also the following thread in the Mind Monitor forum:
https://mind-monitor.com/forums/viewtopic.php?f=15&t=840&sid=71048d0bba3b36ca4857877dc67f7054
Thanks for the info and the updates.
I just read your posts over and mind-monitor. A few clarifications are needed.
First, though LSL was developed at SCCN, it was not Arnaud Delorme who developed LSL, nor is he one of its primary maintainers. He is responsible for much of EEGLAB, but whether the Muse works with EEGLAB is besides the point. EEGLAB is meant for offline. Maybe you are confusing BCILAB and EEGLAB. But here again, BCILAB isn't really Arno's product.
Second, the documentation recently moved from the Wiki to ReadTheDocs. The fact that you can't find something on the Wiki is expected. During the transition, I guess the link to the matlab_example_with_muse was broken. Sorry about that. The document is still in the repo, but for some reason it isn't rendering. I'll try and fix that.
Nevertheless, you're right that this example will only work as long as the Muse SDK is available and it supports streaming over LSL.
It's rendering properly now: https://labstreaminglayer.readthedocs.io/info/matlab_example_with_muse.html
I'm going to close this issue because there's nothing to be done on the LSL dev team side.
Thank you, Chadwick, that's great!
Thank you, Chadwick, for the information about EEGLAB, BCILAB and Arnauld Delorme. There was a confusion on my side.
The Muse SDK is there again, the link to the matlab_example_with_muse is rendering properly, the issue is closed.
But there are some other problems with the Labstreaminglayer support for the InteraXon Muse:
The Example use with Matlab works only with MU-01 - Muse - Released 2014 – Bluetooth. Newer models of the Muse cannot be paired by bluetooth to a desktop PC, so it does not work.
The SDK cannot be downloaded from InteraXon directly, we have to send a E-Mail there to get it. The SDK can only obtained for chosen people and chosen applications.
Labstreaminglayer support of InteraXon Muse only for a Muse model released 2014 and only for chosen people. Is this a satisfying solution for Labstreaminglayer?
https://mind-monitor.com/forums/viewtopic.php?f=15&t=840&start=10
The documentation here is misleading:
https://labstreaminglayer.readthedocs.io/info/supported_devices.html
For readers of the documentation, there is the expectation that all models of InteraXon Muse has LSL support for all kind of people for all kind of projects.
But in reality there is only LSL support for the Muse model released 2014 and only for chosen people and chosen projects.
Is this a satisfying solution for Labstreaminglayer?
Not really, but it's frustrating for users. There are varying levels of vendor support, e.g. BrainProducts officially don't support their SDK and therefore use with LSL but in the past I've been very happy with requests for technical details. In the end we can't do much except document the vendor support and let people vote with their wallets.
I was able to download the SDK by circumventing the redirect by using a browser that didn't obey:
elinks https://sites.google.com/a/interaxon.ca/muse-developer-site/download
I was also able to clone the entire site with:
wget --mirror --no-parent --convert-links --html-extension https://sites.google.com/a/interaxon.ca/muse-developer-site/
I wasn't able to download via these links, but got file names of SDK archives, and found them here https://github.com/AmbrosIA-Institute/ambrosia-institute.github.io
@trathborne The download links on your mirror site don't appear to work for me; it just shows some XML text about Access Denied: https://i.imgur.com/J8Gl1yK.png
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous caller does not have storage.objects.get access to ix_downloads/libmuse-android-1.3.0/libmuse-android_1.3.0-windows-installer.exe.
</Details>
</Error>
Also, are you sure the versions on the mirror site are the latest ones?
The site says "Download LibMuse v1.3.0 for developing on Android", however, I have a local copy of the LibMuse for Android from 2016, and it says that it is version 6.0.0:
Did they reset the versioning? Or is my local copy from 2016, in fact, newer than the version you were able to find? (if it is, feel free to message and I'll send a copy)
The libraries are indeed not on that site. They are on storage.googleapis.com and I was only interested in the Linux library, so that's the only one I tested:
http://storage.googleapis.com/ix_downloads/musesdk-3.4.1/musesdk-3.4.1-linux-installer.run
I have no idea about any other files, but I sure appreciate @highcat 's link to the github repo!
@highcat I've noticed a few places where the installers are available, but upon downloading the files don't open. Does anyone have a workaround?
@trathborne did you run into this issue as well?
I'm interested in getting it running on macOS
@Datagrdn at a glance the installers for Mac OS contain 32-bit executables. They won't run on Catalina since it has dropped 32-bit support. Bad news.
Maybe there's a way to unpack them on older Mac OS, and then use manually. I.e.
Some Android libs also here. Maybe they will work for 1st version of the Muse headset. https://github.com/hoanghonn/brainmuser/tree/master/brainmuser/libs
Also, these repos may contain Muse protocol implementation, for Muse 2016 and Muse 2 https://github.com/alexandrebarachant/muse-lsl https://github.com/kowalej/BlueMuse
@Datagrdn I only tried to make it work on Linux and I got it working well enough. I use muse-io to stream OSC to a Python program which munges the data into WebSocket messages to my PixelBlaze. Pretty sure this flow will just keep working!
I've since found out about this library: https://github.com/urish/muse-js
You can stream the raw eeg, accelerometer, and gyro data to webpages without need for any software other than your browser! Demo here: https://github.com/kylemath/EEGEdu
Works great for web, Electron, and NodeJS apps. (I use it every day in a custom Electron app)
If you need it for some other language/context, you should be able to use the NodeJS approach, and just route the data to your main program using Sockets or subprocess input/output streams. (there must be a way to accomplish the stream-access in other languages natively, but I don't know the details, so for now just recommend using the muse-js library) [EDIT: You can also just use the muse-js-based muse-lsl)
Makes me wonder why BlueMuse (another route for direct access from PCs) requires a security certificate installation, when muse-js accomplishes the same thing with nothing more than standard browser api's (web-bluetooth).
I suppose it is possible to connect the Muse headband directly to a PC with Arnos software and stream data in real time, no Muse SDK needed.
@PeterGamma , in the video he clearly says that this only works with the Muse1 because the SDK has been discontinued and does not work with Muse2.
@PeterGamma , in the video he clearly says that this only works with the Muse1 because the SDK has been discontinued and does not work with Muse2.
It's worth noting that both BlueMuse and muse-js work for the newer models, Muse 2 and Muse S. (I have a Muse S myself. Not sure about the earlier models, but I'm assuming it works with those too.)
@Chadwick Boulay I know. For the Muse 2, there is the Muse LSL from Alexandre Barachant:
https://github.com/alexandrebarachant/muse-lsl
Alexandre Barachant: who does not want to become the supporter of Interaxons Muse2 as far as LSL is concerned.
As an alternative to the Muse headband, Texas Instruments has the ADS1299 Performance Demonstration Kit with 8 channel EEG which is officially supported by Texas Instturments and has an excellent documentation:
The Muse SDK is available once more from Interaxon, but only for a selected group of people. If you don t belong to this group, or if you use a Muse 2, you are out of luck with official support from Interaxon.
Interaxon, the manufacturer of the Muse headband recommends to use Muse Direct as a replacement for the missing Muse SDK for real time streaming. But this service is a unknown to me personally, there is a IOS App, but no Android App, and I don t know anything about the Muse Direct online service.
Me personally, I would rather choose another device when buying a new one for real time streaming EEG sensor data.
There is the ADS1299 Performance Demonstration Kit from Texas instruments as I mentioned before:
http://www.ti.com/tool/ADS1299EEGFE-PDK
It is only 199 USD for 8 Channel EEG. With a headband and EEG sensors it has about the same price as a Muse headband and has more channels.
There is a short instructional video from Texas Instruments to use the board for ECG:
https://www.youtube.com/watch?v=_LY4hHeG-Hs
The board has a manual which is very detailed and has 64 pages:
https://www.ti.com/lit/pdf/slau443
There are two papers on researchgate.net which tested to board for 8 channels and 32 channels EEG:
For a 8 channels EEG Data Aquisition System:
For 32 channels EEG Data Aquisition System :
These papers conclude that the ADS1299 Performance Demonstration Kit from Texas instruments have a relatively high accuracy, which is comparable to a Neurostyle NS-EEG-D1-System.
The ADS1299 Performance Demonstration Kit has an evaluation software for Microsoft Windows which is descibed as easy-to-use, and it can interface to MATLAB. But I could not find any information whether there is LabStreamingLayer support fot this board.
Here I found a Muse Direct solution for Muse 2 from Michal Michalski, experienced professional software developer:
https://buyuk-dev.com/signal-processing/eeg/muse/osc/2020/03/24/muse2-eeg-osc-streaming.html
But there is only an app for IOS for Muse Direct, and it goes over the Muse Cloud service which is 4 USD/ month.
The issue with the missing Muse SDK is closed, the Muse SDK is available once more from Interaxon, but only for a selected group of people. As an alternative to the Muse headband, I suggested the ADS1299 EEG kit from Texas instruments. There is a discussion about the safety of the TI ADS1299 EEG kit. The kit can be used only battery powered connected to a laptop which is purely battery powered. The safety of this setup is discussed in the EEVblog:
I created a Swift-based iOS / Mac framework for the Muse and Muse 2, including PPG data. It still needs improvements, but I'm successfully using it in my projects. Hope it can be useful to other iOS / Mac developers, or for people building frameworks on other platforms:
Great work, jasonjsnell. Unfortunately, I don t use a iOS / Mac. And instead of PPG data from the Muse 2 I use a Polar OH1 optical heart rate sensor, since it has ECG accuracy. I thought about letting go the Muse headband completely. The Muse headband can be used 24 * 7 with some modifications. But an OpenBCI based headband with 8 channels is more comfortable to wear, especially during sleep.
Thanks Peter, I'll take a look at the Polar sensor.
You are welcome, Jason. You can use the Polar OH1 also for respiratory rate estimation in Matlab. I wrote a comment in Matlab regarding this subject:
https://www.mathworks.com/matlabcentral/fileexchange/55289-respiratory-rate-estimation
and you can use the Polar OH1 for calculation of the heart rate variability for instance in Python. But it needs some coding.
Great, thank you!
You are welcome. I have just seen that the Python toolbox for Heart Rate Variability (HRV) was devoped by Pedro Gomes:
https://pyhrv.readthedocs.io/en/latest/
who publishes with Hugo Placido da Silva from BITalino - Low Cost Biomedical Toolkit. Therefore, I suppose it is a research grade toolbox. I don t know whether the PPG heart rate signal from the Muse 2 is research grade, this has not yet been investigated.
The LabStreamingInterface of the Muse1 headband depends on the Muse SDK:
https://labstreaminglayer.readthedocs.io/info/matlab_example_with_muse.html
The Muse SDK is available again from Interaxon on request, but only for a selected group of people. This has been discussed here in this thread.
The Mind Monitor Android app is compatible with all the Muse headband models. Unfortunately, the app has no LabStreamingLayer interface either:
https://mind-monitor.com/forums/viewtopic.php?f=15&t=840&start=30
but only an OSC interface. There are now Python OSC Examples available for the Mind Monitor app:
https://mind-monitor.com/forums/viewtopic.php?f=15&t=1600
which could eventually be used to connect to LabStreamingLayer.
Two possible solutions:
If you have the latest version of NeuroPype https://www.neuropype.io/ (Academic or Enterprise editions), you can add an OSCInput node and wire that into an LSLOutput node to convert from OSC to an LSL stream. You can also process the data in NeuroPype directly.
You could try using this program: https://github.com/gisogrimm/osc2lsl
Tim
-- Tim Mullen, PhD CEO | Research Director Intheon www.intheon.io
On Fri, May 7, 2021 at 6:34 AM Meditation Research Institute, Switzerland < @.***> wrote:
The LabStreamingInterface of the Muse1 headband depends on the Muse SDK:
https://labstreaminglayer.readthedocs.io/info/matlab_example_with_muse.html
The Muse SDK is available again from Interaxon on request, but only for a selected group of people. This has been discussed here in this thread.
The Mind Monitor Android app is compatible with all the Muse headband models. Unfortunately, the app has no LabStreamingLayer interface either:
https://mind-monitor.com/forums/viewtopic.php?f=15&t=840&start=30
but only an OSC interface. There are now Python OSC Examples available for the Mind Monitor app:
https://mind-monitor.com/forums/viewtopic.php?f=15&t=1600
which could eventually be used to connect to LabStreamingLayer.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/30#issuecomment-834395155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5LRG7NY662J4QZGW7K44TTMPUAHANCNFSM4IE6GLKA .
Thanks, Tim. A missing OSC to LSL bridge is really an issue. The Mind Monitor app has OSC support, the Muse Direct app has OSC support. OSC connected the Muse headband to MuseLab. But MuseLab was as far as I know part of the Muse SDK, and the Muse SDK is gone for all people.
Arnaud Delorme s Neurofeedbacklab would be a great alternative to MuseLab. Neurofeedbacklab requires an LSL interface. An example which connects the Muse Direct app OSC stream or the Mind Monitor app OSC stream to the Neurofeedbacklab app would be helpful:
The Muse headband is attractive for mobile EEG applications. Unfortunately, the Muse SDK is only available for research institutions, etc. And the setup with the Muse SDK only works with Muse 1, and not Muse 2.
There is the Muse LSL from Alexandre Barachand, PhD for the Muse 2:
https://github.com/alexandrebarachant/muse-lsl
The Rasperri PI is attractive as a mobile EEG data aquisition platform. Flavio Frohlich, Associate Professor of Psychiatry, Cell Biology & Physiology, and Biomedical Engineering, Department of Psychiatry, Carolina Center for Neurostimulation UNC Hospitals – Chapel Hill reported issues with the Muse LSL and Rasperri PI 4:
https://github.com/alexandrebarachant/muse-lsl/issues/140
The Muse Headband is the worldwide best selling EEG device, and it is affordable. It is a pity that there is no longer an official support from Interaxon for LSL for everyone. As far as I know, the Muse headband should work now for mobile applications with LSL and the Rasperri PI 4, altough I did not test it.
I am looking for a mobile EEG setup, which can stream EEG sensor data into InfluxDB and visualize it in Grafana, which also can connect to Arnaud Delormes Neurofeedbacklab or BCILAB over LSL. I found that an OpenBCI module with a Wifi shield which supports MQTT is suitable for this purpose:
https://petergamma.org/blog/page/7/
OpenBCI also has Lab Streaming Layer support:
https://docs.openbci.com/docs/06Software/02-CompatibleThirdPartySoftware/LSL
For mobile applications, I will use an OpenBCI module with a wifi shield instead of a Muse Headband, until there is a confirmed and working mobile setup for the Muse Headband.
Hi, I am new to the eeg technology and I find it really hard too to find a reliable EEG headband with a stable SDK... Muse seems to prefer developing their own tech and not sharing their code. What about the NeuroSky MindWave Mobile 2 (just purchased one and pairing is not easy on IOS) and the Macrotellect PRO V2 ? It would be great if we could all work with the same headband to share our research and progress !
You are right, a community can do more than an individual. The Muse seem to work now with the Rasperri PI 3b and LSL:
https://github.com/alexandrebarachant/muse-lsl/issues/140
Me personally, the OpenBCI Cyton board seems to be an interesting alternative to the Muse. OpenBCI already has LSL support, and it also has MQTT support over the WIFI shield. Unfortunately, the WIFI shield is currently not available from OpenBCI, and it is not clear, when the new version comes out. Furthermore, there are issues with the WIFI shield, such as WiFi Shield packet loss and cyclical noise spikes. Nevertheless if OpenBCI MQTT works without issues sooner or later, this path becomes interesting in combination with Home Assistant and InfluxDB. Home Assistant already has 1800 integrations, and I saw that more and more physiological sensors are available in Home Assistant, for instance there is Home Assistant support for Garmin watches for certain parameters. OpenBCI LSL is stable, and I guess OpenBCI MQTT sooner or later too, which is a good basis for community projects.
The SDK community seems to still be active: https://community.choosemuse.com/categories And through requesting on this site, I've gained access to the SDK, as of writing this the newest version seems to be 7.1.1: https://choosemuse.com/pages/developers
I contacted the Muse support to get a copy of the Muse SDK. No luck!
Alternatively, it is possible to stream Muse data to Matlab with Muse Monitor's build in OSC streaming.
http://www.musemonitor.com/forums/viewtopic.php?f=15&t=749&sid=1f538175b41101875e0f88024e281950
but we first have to write a Matab interface for it:
https://ch.mathworks.com/matlabcentral/answers/49153-receiving-osc-messages-in-matlab-64-bit
Here the answer of the Muse support:
Hi Peter,
Thank you for contacting Muse Customer Care and thank you for your enthusiasm about working with Muse. We greatly value the important links you just sent us.
Unfortunately, as you might be aware, we are no longer offering the SDK. The Muse SDK and research tools have helped make Muse into the bestselling EEG system in the world. They have also required a volume of technical support that has been difficult for us to sustain. As we’ve grown, we’ve struggled to provide the kind of support for developers that we believe our community deserves. For this reason, we’ve had to make the difficult decision to stop actively supporting the Muse software development kit (SDK).
As a possibility, we do offer Muse Direct (iOS). We've developed Muse Direct to allow you to record, stream, and visualize the raw data from the Muse. You can connect your Muse to Muse Direct on an iOS device and then stream the data via OSC (using WiFi) to a computer or another device where you can process the data in whatever programming language you'd like.
You can view the data live and also export it to excel as a CSV file. It is important to note however, this raw data can be difficult to interpret without the assistance of multiple samples, an experienced neuroscientist, and written script (code) to analyze it. You may want to consider getting in touch with an experienced EEG Researcher for your project as the processing of this data is quite complex and the support we are able to offer for individuals is limited (why we have chosen to pull the Muse SDK).
We'll continue to work toward providing a more sustainable solution to help make Muse better than ever and to give our community the best possible tools. Until then, thank you sincerely for your patience and your interest in Muse.
Muse Direct Webpage - https://choosemuse.com/muse-direct/ Download for iOS - https://itunes.apple.com/app/muse-direct/id1326341722?mt=8
Thank you, Gabby
Muse Customer Care Interaxon | Brain Sensing Technologies http://www.choosemuse.com T: 1 888 508 MUSE (6873)
If you contact Muse Customer Care via phone, please reference Muse: the Brain Sensing Headband - Support Case # 00116105
ref:_00D41g4dE._5002Murf8L:ref