Skip to content

7. Troubleshooting

Diego Saldivar edited this page Nov 27, 2024 · 5 revisions

The Interpreted values (focus, calm, flow) take forever to start working

That is normal, these values are derived from "scored" values, which take a while to sample a history of values to give you a "scored" average. If you'd ike to get some immediate scores, even if they're noisier, change the source of these values in the StupidModel.cs script from scored to relative or even absolute values. I added ann enum you can use to quickly switch between these inputs in the code. I did not expose it directly on the Inspector because I'd like to change this script in the near future.

Unity crashed when I stop and re-start the game very quickly (Desktop Editor)

That is normal, given that the Interaxon SDK takes a few seconds before killing its event listeners. If you re-start too quickly, there will be duplicate listeners and the SDK will crash Unity. Save your scenes frequently and take a handful of seconds before re-starting the game every time. If you absolutely need to iterate very fast and can't wait, either disable the InteraxonInterfacer or create a mockup version that does not connect but still gives out some info. This behaviour is as of yet undocumented in the Android apps.

The Heart Monitor is not giving me a heart rate

Yes, as discussed in the Wiki, I was unable to properly interpret the PPG values into a proper heart rate. ChatGPT says that machine learning is necessary to get a functioning heart rate model. I did not have the time to learn Machine Learning. If you are able to create a heartbeat model, care to share with the community?

I have some JSON error regarding deserialization

Yes, the Windows to Android port pushed me to learn a bit about Unity and Android's relationship with JSON. I believe I put the relevant scripts in order (Serialization.cs is also heavily commented on that front). Still, if you experience Null Pointer Exceptions without a proper explanation at or near a line using JSON to deserialize data from the Muse, check the first error you get from the Logcat and check the top summary and comments I made in Serialization.cs.

The app requests certain permissions, what are they for?

Interaxon rerquires these permissions to be able to stream data into your device. I myself have observed that some of these permissions were not necessary in previous Android versions but, as privacy legislation and technology advance, new permissions must be required even when certain systems are unused. You may require even more permissions depending on what device capabilities your project requires.

When I try to run the game in the editor, it doesn't work and an error pops up.

That is normal. This template is set to work directly on an Android device, meaning it will ask for Android permissions and it will be looking for files and hardware that can only be found on an Android device. My guess is that your Unity Editor is installed on a Windows, Mac or Linux, right? The fastest way to test your game is to Build and Run on a connected device.

This template does not work when I switch to Windows or iOS

That is normal. The Interaxon libraries in this template were set up from its Android model. Although Interaxon supports Windows and iOS, this support does not come automatically out of the box in their Unity examples. Check this section to see which templates are available.