Thursday, November 17, 2005

Griffin AirClick USB + Linux?

I just purchased a Griffin AirClick USB. The application that powers it is a .NET application, so it should run under Mono, right? Well, not quite. Let's look at what I found.

The application itself doesn't do much- it delegates from a USB driver (I'll come back to this) to one of a set of plugins (these are .NET DLLs renamed with the extension "acp". They can be manipulated just like DLLs). The plugins then do something based on the button pushes. The Windows version comes with Interop.PowerPoint.dll and Interop.iTunesLib.dll, which the PowerPoint and iTunes plugins use to delegate to the applications. Thus, the flow of information seems to be: USB to delegate application to plugin to target application. The problem in porting this to Linux is the USB part. The application includes, compiled into the AirClick.exe assembly, the USBSharp class found here, which in turn makes explicit reference to kernel32.dll. Specifically, the file handle and HID device APIs seem to be used. I'm not too good at .NET hacking, so I can't go too much further on this front.

Assuming I can find some way of getting AirClick.exe to recognize the Linux USB stack, what next? Well, in order to be useful, you have to control something. If, for instance, you use it for controlling music, could you control a Mono music player like Banshee? If you want presentation control, use the CLI-UNO bindings to control OpenOffice.org. I now just have to find the API for the plugins...

3 comments:

Dave A said...

Hi,
Did you ever have any luck getting this to work? I created a slightly more hacky 'driver' for the AirClick in Python that you may find interesting/useless/hilarious.
http://minus-zero.org/projects.html#pyclick

Anonymous said...

Chris, please contact Jim Sykes or Deirdre Helfferich ASAP about Rebekah K. Urgent.

Anonymous said...


I compiled hid-example.c, modified it, removed nonblocking (made it blocking) then the last 'read' where it gets the report, thats where it returns 8 bytes. I take the 4th byte along and the bits in there tell you what button is pressed:
#define BUTTON_PLAY (1 << 0) // 0000 0001
#define BUTTON_VUP (1 << 1) // 0000 0010
#define BUTTON_VDOWN (1 << 2) // 0000 0100
#define BUTTON_NEXT (1 << 3) // 0000 0100
#define BUTTON_PREV (1 << 4) // 0000 0100