The Inverse

The Necessity

The Austrian firm g.Tec makes excellent portable biosignal amplifiers and they appear to be quite popular in the BCI community. Unfortunately, their accompanying software is not as commendable. The libraries for accessing the amplifier are sold separately by g.Tec, and are copy-protected using a HASP USB dongle. Amusingly, their protection code seems to be restricted to the higher level libraries : the DLL file that ships for free with their demo app ( and is used by their other libraries ) can be easily leveraged for accessing the amp ( try using the ctypes library in python , coupled with SciPy ).

While designing my senior year project, Myelin, I decided to reverse engineer the amp’s protocol and write a cross-platform library for acquiring data. Using the DLL was not an acceptable solution as our primary development platform was Mac OS X and Linux. Reverse engineering for the sake of interoperability is perfectly legal.

The Library

libBioAmp is written in C++ and uses libusb1.0. It has been tested on Mac OS X ( v10.6 Snow Leopard ) , Ubuntu 9.10 ( Karmic Koala ), and Windows 7. You can easily write MATLAB and LabVIEW wrappers on top the library.

The primary device used during reverse engineering was a UA-2008 model. The protocol, however, appears to be identical for the UB-2009 model. Both versions have been successfully used with our driver.

You can get the Source on GitHub.

The Future

The library is no longer under active development. I’ve graduated and no longer have access to the amplifier. In it’s current state, it is sufficiently feature complete. There are certain features that have not been incorporated into the current version. For instance, the lack of support for slave amplifiers. The only reason for this is that it was not useful for the project, and I was severely time constrained. Technically, it is trivial to implement any of the remaining features.