Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android and Guitar Hero controller

I know that the latest versions of Android (Honeycomb and ICS) have support for joysticks and gamepads. Guitar Hero (and Garage Band) controllers are essentially USB HID devices, right?

So my question: Is that possible to receive data (button clicks) from the Guitar Hero (or Rock Band) controllers on Android device? Would the Android understand it as a gamepad input?

P.S. all I need is to detect in my game the input from those five buttons on the plastic guitar fret.

like image 324
Evgeny Vinnik Avatar asked Feb 23 '12 06:02

Evgeny Vinnik


People also ask

Can you get Guitar Hero on Android?

The mobile version of Guitar Hero 5 was developed for Android, BlackBerry, BREW, Java ME and Windows Mobile platforms.

Are Guitar Hero controllers universal?

The Guitar Hero Live console controller will work with any console. The wireless USB receivers, however, are designed to work specifically with one console and cannot be transferred to another.

Is the guitar hero live controller Bluetooth?

Guitar Hero Live Bluetooth controller.


2 Answers

A good starting point would be to review the linux source code for Frets On Fire, which supports some of the Guitar Hero controllers.

Frets on Fire: SourceForge

SVN: https://fretsonfire.svn.sourceforge.net/svnroot/fretsonfire

It looks like it would be difficult to universally support all controllers, from different platforms. Each console has it's own protocol, but it does look like JoyStick to keyboard emulation is possible on the PC with the PS3 controller. There is a config file for the PS3 controller on the second link that may be helpful, it's for JoyToKey (which isn't open source), but some of the values in the config may help you.

like image 80
dmck Avatar answered Nov 11 '22 09:11

dmck


Hey this is a really cool idea. start here:

http://developer.android.com/guide/topics/usb/host.html

Then, check out this sample:

http://developer.android.com/resources/samples/USB/MissileLauncher/index.html

in that sample, there is a method named setDevice(UsbDevice device)

If I were implementing this, I would start with a duplicate of the MissileLauncher project, and modify this setDevice method. I would log everything I could possible find about the UsbDevice device and try experimenting with these conditionals in the setDevice method:

if (ep.getType() != UsbConstants.USB_ENDPOINT_XFER_INT) {
...
if (intf.getEndpointCount() != 1) {

While the MissileLauncher uses this type and this endpointCount, it is very likely the garageband controller will have different values

ALSO

check out the run method to see an example of back and forth communication

DISCLAIMER: I have no idea if this will work. I've also seen blogs stating this cannot be done.

like image 38
edthethird Avatar answered Nov 11 '22 11:11

edthethird