Is it possible to design an SSVEP visual stimulus for use with the Android Runtime Environment?
I am currently working on a BCI (Brain Computer Interface) project where we use SSVEP visual displays to measure brain activity in the visual cortex. So far we've been using MATLAB and the PsychToolBox to create the stimulus, but I've been tasked with making the whole thing portable. Meaning, I need to figure out how to use the SSVEP stimulus in a mobile device, preferably an android tablet. We had originally thought of making a mobile application, for which we considered using either Java or Python, but after some thought and conversations, my team decided we should use Python because it might mix in better with how we handled data acquisition from the EEG signals. I had found some papers where people used Java to build their app and controlled the stimulus with OpenGL ES, but I am currently looking for other alternatives since we have decided to use Python.
First I found Kivy to make mobile apps, but then I found Expyriment, which seems to be the best solution at the moment, given that I wouldn't have to build an app from the ground up. However, I read on the installation page for expyriment android runtime environment, that it doesn't provide OpenGL support. This scares me as it may seem that maybe I won't be able to pull off something like an SSVEP visual stimulus with Expyriment? Do any of you know if its still possible to achieve this? Could you recommend other tools, alternatives, or tips in general? Any help is greatly appreciated. Thank you.
Comments
Hi there,
Expyriment on Android indeed does not use OpenGL. Mainly because normal OpenGL is not available there, but only a special version of it (OpenGL ES). I believe that the PyOpengl Package can nowadays also target OpenGL ES, or at least parts of it, but I have not investigated this any further. The current version of Expyriment does at least not make use of it. We have recently been discussing how to advance in the Android domain, and there are several open issues currently, which is also why the latest Android version is still based on Expyriment 0.7.0.
In Expyriment we use OpenGL currently for the sole purpose of being able to block on the vertical retrace in order to have millisecond accurate visual presentation timing. Hence, if you need something right now, and you need very tight visual timing (i.e. accurate to 1 ms) I am afraid it might be better to look for something else at the moment. Kivy would indeed be my first suggestion then.
Hope this helps. Let me know if you have any further questions.
Thank you for your response! Okay so what I got from your message is that since Expyriment uses OpenGL in order to be accurate to 1 ms, given that expyriment for android doesn't have OpenGL support, it would be hard / nearly impossible to be accurate to 1 ms with it? And so I should look for other alternatives? Given that this is what you were trying to say, I still fear that a similar problem might arise with Kivy. Do you happen to know if Kivy would be able to support such precise timing? (being able to display images at 4hz-20hz)
I think OpenGL ES provides a similar way of blocking on the vertical retrace. We just have not looked into implementing OpenGL ES support yet. Maybe in the future.
I am not sure how Kivy handles blocking either. Maybe best to ask in their forum (if they have one).