SweggyScotty404 / android-bluez-ime

Automatically exported from code.google.com/p/android-bluez-ime
0 stars 1 forks source link

support for Gamestop Bluetooth Gamepd #142

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
it would be nice to have support for the Gamestop BT Gamepad

Original issue reported on code.google.com by xgeck...@gmail.com on 18 Jan 2012 at 1:58

GoogleCodeExporter commented 9 years ago
I second this! Gamestop is selling this with the Transformer Prime and barely 
anything works with it

Original comment by RobAMa...@gmail.com on 19 Jan 2012 at 9:52

GoogleCodeExporter commented 9 years ago
Is it using standard Bluetooth HID Gamepad?
Does it work with a PC? (I'm in Europe and I cannot find any specs).
If it is standard HID, can you try the debugging instructions in issue #89.
http://code.google.com/p/android-bluez-ime/issues/detail?id=89

Original comment by kenneth@hexad.dk on 24 Jan 2012 at 7:31

GoogleCodeExporter commented 9 years ago
I actually have no clue as to what it uses.  It does not seem to be a well
thought out product.  If there is any way to make it work it seems like a
very nice product.

Original comment by xgeck...@gmail.com on 24 Jan 2012 at 9:17

GoogleCodeExporter commented 9 years ago
i also agree if you can make this app compatible with the gamestop bluetooth 
gamepad myself and plenty of others who cant afford an expensive gamepad will 
be very greatfull. i can imangine it must not be to hard being that i have an 
evo 3d and it works perfect with emulators and most gamepads dont work with 
sense ui. please email me back thanks.

Original comment by dlink1...@gmail.com on 27 Jan 2012 at 3:47

GoogleCodeExporter commented 9 years ago
I returned it yesterday.  It was very poorly supported by GameStop so I
felt it much better to invest in a Logitech F710 I can use with my PC.

Original comment by xgeck...@gmail.com on 27 Jan 2012 at 6:07

GoogleCodeExporter commented 9 years ago
Yes, please add support for the GameStop bluetooth controller.  I would love to 
be able to use the analog sticks with my emulators.  Thanks!!!!

Original comment by shaunma...@gmail.com on 29 Jan 2012 at 4:43

GoogleCodeExporter commented 9 years ago
@dlink1013: Are you saying that it works with some emulators even with Sense UI 
?

I need someone to try the debug build from issue #89 and tell me what messages 
they get before I can support it. I do not have a GameStop controller so I 
cannot do anything until someone gives me some data.

Original comment by kenneth@hexad.dk on 29 Jan 2012 at 4:20

GoogleCodeExporter commented 9 years ago
Yes it works with all emulators even with sense ui. I have the evo 3d cdma
running 2.3 sense 3.0 ui. Ive tryed another app called gamekeyboard that
allows button mapping and the control works with it too. Only problem is
games like modern combat 3 wont work fully e.g cant move camera, cant run
back and to the sides. The app was ment to work wit DOS games but with
trial and error I got it to Semi work with modern combat proving that
indeed the control is capable of working with other games then just
emulators. I hope this helps.

Original comment by dlink1...@gmail.com on 29 Jan 2012 at 6:56

GoogleCodeExporter commented 9 years ago
i ran the debug version with the keyboard hid enabled then ran alogcat while 
pressing buttons on the remote and this is what i got... everything in yellow 
is what appeared when i pressed buttons. also i kept saying unknown error:0

Original comment by dlink1...@gmail.com on 29 Jan 2012 at 8:12

Attachments:

GoogleCodeExporter commented 9 years ago
I gave up on that controller due to the abysmal support from GameStop.
They really did not seem to want to do much beyond seperate me and my money
so I sent it back.

Original comment by xgeck...@gmail.com on 30 Jan 2012 at 7:47

GoogleCodeExporter commented 9 years ago
Well what more can they do. it says it nice and clear on the box it was
ment for some specific games. That doesn't mean it can't work for any
others. I got mine working with gta3, ps1 and n64 emulators and both sonic
episode 4 and sonic CD. its all a matter of button mapping and trial and
error. the main reason I want to get bluez ime to work is because the app
can map more buttons needed for some gameloft games.

Original comment by dlink1...@gmail.com on 30 Jan 2012 at 7:56

GoogleCodeExporter commented 9 years ago
The logcat message shows nothing that is related to BluezIME :(.
If it works with Sense, the it is most likely not a standard Bluetooth HID 
device.
This would also explain why it does not show anything if you use the game 
controller driver.

Can you try to connect it as a Phonejoy controller just to see if something 
else happpens?
It should say "Connected to xxxxxxx" if it works.

Original comment by kenneth@hexad.dk on 2 Feb 2012 at 9:39

GoogleCodeExporter commented 9 years ago
Also, what n64 and ps1 emulator is it working with?

Original comment by kenneth@hexad.dk on 2 Feb 2012 at 9:40

GoogleCodeExporter commented 9 years ago
I'm using fpse and n64iod.

Original comment by dlink1...@gmail.com on 2 Feb 2012 at 12:13

GoogleCodeExporter commented 9 years ago
Nope when I try it says error connection refused. I cade, Wii, and keyboard
hid all say unknown error:0

Original comment by dlink1...@gmail.com on 2 Feb 2012 at 12:26

GoogleCodeExporter commented 9 years ago
Hmm, very strange.

What type of controller setup do you do in fpse and n64oid to get it working 
there?

Original comment by kenneth@hexad.dk on 2 Feb 2012 at 1:30

GoogleCodeExporter commented 9 years ago
Just the normal touch input and within the app I map the keys to my liking.
as for games like grand theft auto 3 and sonic I've been using an app
called game keyboard that kinda works like yours.

Original comment by dlink1...@gmail.com on 2 Feb 2012 at 1:36

GoogleCodeExporter commented 9 years ago
Do you have a link to "game keyboard" ?
How do you set it up in "game keyboard" ?

Original comment by kenneth@hexad.dk on 2 Feb 2012 at 1:51

GoogleCodeExporter commented 9 years ago
U can search it on the market for the latest version or google
gamekeyboard.apk then install with file manager

Original comment by dlink1...@gmail.com on 2 Feb 2012 at 1:57

GoogleCodeExporter commented 9 years ago
The only "gamekeyboard" app I can find is this:
https://market.android.com/details?id=com.locnet.gamekeyboard

But that does not support any controllers?

Original comment by kenneth@hexad.dk on 2 Feb 2012 at 2:09

GoogleCodeExporter commented 9 years ago
Yep that's the app I'm using. The way it works is by the user hardkey
mapping the buttons and saving the settings to different profiles. E.g when
I wanna play sonic I load the profile I configured to work with sonic.
hardkey mapping is different from bluez ime. With game keyboard you press
the button on your remote then set the key for that button. E.g. press up
on analog stick then select d pad up as the action.

Original comment by dlink1...@gmail.com on 2 Feb 2012 at 2:21

GoogleCodeExporter commented 9 years ago
I think we are talking about different things here.
The "gamekeyboard" app does not allow you to connect to anything, you can look 
at the permissions, and see that it does not have any bluetooth permissions, 
and thus cannot connect to any bluetooth device.

Bluez IME is an app that connects to bluetooth controllers, and "gamekeyboard" 
is an on-screen keyboard that also allows you to assign keyboard keypresses to 
the touch areas (very nice idea). But if your GameStop controller works with 
"gamekeyboard", then it means that it is connected with something else, do you 
know what that is?

Original comment by kenneth@hexad.dk on 20 Feb 2012 at 9:32

GoogleCodeExporter commented 9 years ago
All you have to do is pair it with your phone the same way you do with any
Bluetooth device (scan then pair), Then with the gamekeyboard app you can
hard map the keys to your controller. So yea we are talking about the same
app.

Original comment by dlink1...@gmail.com on 20 Feb 2012 at 12:38

GoogleCodeExporter commented 9 years ago
I see, now I understand what you are saying.

That means that your phone supports whatever HID (or other) mode the Gamestop 
is using.
Since you have paired the device, Android will connect to it when you turn it 
on.
Since Android has connected, Bluez IME cannot connect to it, and gets 
connection refused all the time.
The only way around it is to prevent Android from auto-connecting. Usually this 
can be done by long-pressing the Bluetooth entry, and in the menu select 
something like "Disable HID". If your ROM does not have this option, there is 
nothing I can do because I cannot change your ROM, and there is nothing in 
Android that allows an app to do this.

If the auto-connect is prevented, you should be able to get Bluez IME to 
connect, and be able to produce the data I need to support it.

Original comment by kenneth@hexad.dk on 20 Feb 2012 at 2:40

GoogleCodeExporter commented 9 years ago
On my ROM there is a virtual unplug option do you think that would work to get 
program to connect to the controller?

Original comment by abrcrmd...@gmail.com on 2 Jun 2012 at 4:33

GoogleCodeExporter commented 9 years ago
As far as I can tell, the gamestop controller's analog sticks do not perform 
like analog but as dpads. Would your program fix this if it were supported?

Original comment by aaronb...@gmail.com on 13 Sep 2012 at 9:24

GoogleCodeExporter commented 9 years ago
That depends. If the controller emits analog data, then the apps that supports 
BluezIME can use that.
For everything else, they will be converted to emulated keypresses.

Original comment by kenneth@hexad.dk on 14 Sep 2012 at 1:22

GoogleCodeExporter commented 9 years ago
Issue 197 has been merged into this issue.

Original comment by kenneth@hexad.dk on 15 Jan 2013 at 7:34

GoogleCodeExporter commented 9 years ago
Issue 209 has been merged into this issue.

Original comment by kenneth@hexad.dk on 15 Jan 2013 at 7:35

GoogleCodeExporter commented 9 years ago
Any way we can help on this one? I just purchased one of these controllers, and 
they are rather nice.

Original comment by winddrak...@gmail.com on 20 Feb 2013 at 3:14

GoogleCodeExporter commented 9 years ago
If someone is willing to develop the driver, I will happily include it in the 
source and push a new update.
But I do not have the time required to develop it myself.

Original comment by kenneth@hexad.dk on 27 Feb 2013 at 10:27

GoogleCodeExporter commented 9 years ago
Issue 223 has been merged into this issue.

Original comment by kenneth@hexad.dk on 27 Feb 2013 at 10:31

GoogleCodeExporter commented 9 years ago
I just wanted to point out that there are TWO bluetooth gamepads that GS is 
selling. One of them is crap and the other is pretty decent but a bit more 
expensive (Red Samurai v2). The dump from gamepad mode seems to work without 
HID Enabler. I can add a dump from keyboard mode later too, as it also seems to 
work fine without it. My mapped logcat with comments is attached. Everything 
needed should be here. If you need anything else let me know. 

Btw, if you still don't have the time how would I go about doing it myself?

Original comment by darthsly...@gmail.com on 3 May 2013 at 7:03

Attachments:

GoogleCodeExporter commented 9 years ago
Wow, nice detective work.

It seems very simple to work with, the magic header is 0xa1 0x01.

I assume this came from the DataDump Reader, in which case the controller is 
using the SPP protocol, which is easier to work with than HID on Android.

To develop this, I would start with the ZeemoteReader.

Then delete most of the stuff in parseInputData, but keep the loop.
The constant "3" should be replaced with "8", as the messages are 8 bytes.
Now the loop should discard everything that does not start with 0xa1 and 0x01.

You then need a boolean array with 14 entries (on for each button).
When you read a message, you need to figure out if the bit has changed.
Easiest way is to map each button to the bit index and then to some AND with 
the value.

If you detect a button has changed, update the boolean array and send the 
approriate message.

For the analog, you need some of the same, but you need to keep 4 axis values 
(as integers) and 8 button states.
Once analog value moves across the threshold, you send the message and update 
the state as before.

Have you tried developing something before?

Original comment by kenneth@hexad.dk on 3 May 2013 at 9:19

GoogleCodeExporter commented 9 years ago
Ok, I found a little time to make a basis for the driver, based on your 
findings.
Most likely I made a mistake somewhere, as I cannot test it, so I just wrote 
the code without testing.
See r94 and r95 for the update.

Attached is a debug build with the driver, in case someone wants to try it and 
tell me what does not work.

Original comment by kenneth@hexad.dk on 3 May 2013 at 6:35

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Oh wow, I appreciate you whipping something up so fast! Just tested this out, 
something definitely is wrong. 
Left analog controls only left and up (and its a little glitchy) and right 
analog controls only down and right. Select moves up, Start moves left. L3 
moves down, R3 moves right. No other buttons are registering at all, not even 
the dpad.

Once you get gamepad mode sorted, I can try and dump keyboard mode, but it 
seems like its going to be more complicated than gamepad mode.

Yes, this data was obtained via DataDumpReader and yes this controller seems to 
use the SPP protocol.

Developing? Yes I have, but I don't know Java at all (C++ and some assembly), 
and honestly I don't have a whole lot of interest in Java.

Something notable about this controller is the 2 different modes have different 
Bluetooth ID's and addresses. Gamepad mode identifies itself as GS Gamepad, and 
keyboard mode GS Controller, both modes have to be paired separately.  Keyboard 
mode also supports another Red Samurai controller pairing to the main 
controller (they even have player #1 #2 indicators). It has a lithium polymer 
battery and the charging cord(Male miniUSB-B to Male USB-A) uses standard usb 
5v power. In theory one could charge the controller with an OTG adapter or 
MiniUSB to MicroUSB cable if it was needed while you were out and about. It's a 
pity they didn't just use a MicroUSB in the first place.

Also I believe the other GS branded controller GameStop sells (the cheap one) 
is made by a different company, and as such is probably not going to be 
compatible, so you may want to note this is for the Red Samurai only.

Original comment by darthsly...@gmail.com on 4 May 2013 at 1:27

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I tested this in games that actually support the controller (Zenonia and Sonic 
CD). Not sure if this is normal but nothing showed up under 'Button 
configuration'... nothing is configurable (other than selecting the 
profile/etc) as well. Also, given this is a debug build are there logs I can 
dig up for you somewhere?

Original comment by darthsly...@gmail.com on 4 May 2013 at 1:47

GoogleCodeExporter commented 9 years ago
The gamepad works as a wireless keyboard.  That's why it doesn't work straight 
out of the box.  Only certain games are coded for keyboard input.  I'm still 
trying to find correct key mapping for newer games, but I can move right now on 
Modern Combat 4.  If anyone can find a list of key maps for newer FPS 
Shadowgun:Deadzone, Modern Combat 4.  I would forever be greatfull!  

Jonathan Garcia

Original comment by garsha...@gmail.com on 19 May 2013 at 6:34

GoogleCodeExporter commented 9 years ago
PS a Bluetooth manager like BluezIME is used to map the buttons.

Original comment by garsha...@gmail.com on 19 May 2013 at 6:35

GoogleCodeExporter commented 9 years ago
I forgot to add it to the key-mapping section, new build should fix that.
I will have a look to see what the other problems are.

Original comment by kenneth@hexad.dk on 25 May 2013 at 7:12

GoogleCodeExporter commented 9 years ago
I found that I had inversed the bit/keycode map, so I have updated that.

If you want to try working with Android/Java, Google has recently released 
Android Studio, which makes it very simple. Just install, and checkout the 
source (I switched to Git). The .iml file should be enough to open and run 
right away. Otherwise just import from sources, and choose all the default 
settings. Once that is complete, you should be able to debug on device 
immediately.

Original comment by kenneth@hexad.dk on 25 May 2013 at 7:35

Attachments:

GoogleCodeExporter commented 9 years ago
Do you need beta testers? for this code I have this device and a samsung 
gallaxy tab but am thinking about returning this controller since I can't find 
any decent way to use it in the applications I want.

Original comment by Robbyger...@gmail.com on 18 Jul 2013 at 8:32

GoogleCodeExporter commented 9 years ago
I have been really busy and haven't had time to test this out or play with it 
much, a tester would be great.

Original comment by darthsly...@gmail.com on 26 Jul 2013 at 10:19

GoogleCodeExporter commented 9 years ago
Wow i would like to help in testing. Its a real problem with ipega.

Original comment by Bondc...@gmail.com on 19 Aug 2013 at 5:52

GoogleCodeExporter commented 9 years ago
Hello! I just found some more information. When this gamepad is plugged in, it 
is detected as a keyboard... I was suprised at this and tried to connect it to 
my computer, running Windows 7 x86. It indeed connected flawlessly but after 
couple of seconds, the icon "GS controller" dissaeared from Devices and 
Printers and changed to this HID Keyboard icon and dissapeared. To my 
knowledge, Gamestop probably knew this and created a new Version 2 of this 
controller where the analog sticks are actually supported. Also, has anyone 
fixed this problem?

Original comment by lucasmu...@gmail.com on 23 Dec 2013 at 6:09