LibMuse Android example can't connect


#1

Can’t get the demo app to properly connect to the Muse, on two devices where Calm runs just fine (Android 4.4.2 and 5.0.2).
With the Muse device & address showing up in the list, and selecting “Connect”, I receive this error six times:

03-16 13:09:12.749: W/libmuse native(10886): Muse data error: ConfigurationParser: data size is bigger than expected

After that, I receive:


03-16 13:09:12.749: E/libmuse native(10886): Too many data errors. Disconnect.

Within Calm it says the headset is up to date (along with the app itself). Any suggestions on what’s going on here?


#2

Hi Charles,

Thanks for the report. For some reason libmuse cannot parse configuration, which your headband has. It looks like a bug, which happens with some specific headband config. We are going to do a bug-fix release today/tomorrow, which improves error handling. It will allow us to understand what is so specific in your headband config and then fix the parsing problem.


#3

We prepared a libmuse-1.0.3 installer - it is a beta release. libmuse-1.0.2 is stable and it is still recommended for usage.

Charles, can you please download libmuse-1.0.3 and check if it fixes your problem. If not, it should log very informative error. Please, post it here or send it directly to me.


Thank you,
Victor.


#4

No luck, though the error does change:


03-16 20:13:31.811: D/AbsListView(16254): onDetachedFromWindow
03-16 20:13:31.816: W/InputEventReceiver(16254): Attempted to finish an input event but the input event receiver has already been disposed.
03-16 20:13:31.826: E/ViewRootImpl(16254): sendUserActionEvent() mView == null
03-16 20:13:38.586: I/Muse Headband(16254): Muse 00:06:66:66:FB:EF DISCONNECTED -> CONNECTING
03-16 20:13:38.601: D/BluetoothUtils(16254): isSocketAllowedBySecurityPolicy start : device null
03-16 20:13:38.601: W/BluetoothAdapter(16254): getBluetoothService() called with no BluetoothManagerCallback
03-16 20:13:38.606: D/BluetoothSocket(16254): connect(), SocketState: INIT, mPfd: {ParcelFileDescriptor: FileDescriptor[66]}
03-16 20:13:45.011: W/libmuse native(16254): connect() failed
03-16 20:13:45.011: W/libmuse native(16254): java.io.IOException: read failed, socket might closed or timeout, read ret: -1
03-16 20:13:45.011: W/libmuse native(16254):     at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:581)
03-16 20:13:45.011: W/libmuse native(16254):     at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:592)
03-16 20:13:45.011: W/libmuse native(16254):     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:370)
03-16 20:13:45.011: W/libmuse native(16254):     at com.interaxon.libmuse.MusePlatformAndroid.connect(MusePlatformAndroid.java:96)
03-16 20:13:45.011: W/libmuse native(16254):     at com.interaxon.libmuse.Muse$CppProxy.native_connect(Native Method)
03-16 20:13:45.011: W/libmuse native(16254):     at com.interaxon.libmuse.Muse$CppProxy.native_connect(Native Method)
03-16 20:13:45.011: W/libmuse native(16254):     at com.interaxon.libmuse.Muse$CppProxy.connect(Muse.java:228)
03-16 20:13:45.011: W/libmuse native(16254):     at com.interaxon.libmuse.MusePlatformAndroid$1.run(MusePlatformAndroid.java:57)
03-16 20:13:45.011: W/libmuse native(16254):     at java.lang.Thread.run(Thread.java:841)
03-16 20:13:45.231: D/BluetoothUtils(16254): isSocketAllowedBySecurityPolicy start : device null
03-16 20:13:45.231: W/BluetoothAdapter(16254): getBluetoothService() called with no BluetoothManagerCallback
03-16 20:13:45.231: D/BluetoothSocket(16254): connect(), SocketState: INIT, mPfd: {ParcelFileDescriptor: FileDescriptor[68]}
03-16 20:13:48.946: W/libmuse native(16254): Connection was lost or headband is OFF.
03-16 20:13:48.951: I/Muse Headband(16254): Muse 00:06:66:66:FB:EF CONNECTING -> DISCONNECTED
03-16 20:13:48.991: I/Muse Headband(16254): Muse 00:06:66:66:FB:EF DISCONNECTED -> CONNECTED
03-16 20:13:49.011: W/libmuse native(16254): Connection was lost or headband is OFF.
03-16 20:13:49.011: I/Muse Headband(16254): Muse 00:06:66:66:FB:EF CONNECTED -> DISCONNECTED


#5

This is a different problem, which has nothing common with previous. Now it fails on socket creation, which is android API call. Charles, can you please provide Muse Headband firmware version (Calm app can show it), your phone model and Android version you are using?


#6

Samsung SPH L900 Android 4.4.2 API 19
Muse Headband v.7.0.11
Calm app v.1.6.5

Though again, same error sequence occurs on my Android 5.0.2 Tablet. (as in it also only now shows this new error on libmuse 1.0.3)


#7

Charles, I want to reproduce your exact setup to be able to help you. Your problem is very specific and it’s hard to reproduce. Please, provide your headband [B]hardware version[/B] (you can use muse-io on desktop or calm to find it).
And just to confirm: Calm app is working fine for you, right?


#8

So, problem happened only with a specific setup (hardware + firmware + libmuse version) and was solved with 2 actions:

  1. Update firmware version to the latest one (it can be done through Calm app) - most important (especially if you bought your muse long time ago).
  2. Update libmuse to the latest one (we are going to release next libmuse version shortly, which has minor fixes in connection recovery mechanism and muse configuration parsing). For now the most stable and tested version is 1.0.2.

Thanks to Charles for pointing to this issue.