Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for gamestick and ouya controller #42

Closed
oxley192 opened this issue Sep 1, 2020 · 41 comments
Closed

Request for gamestick and ouya controller #42

oxley192 opened this issue Sep 1, 2020 · 41 comments

Comments

@oxley192
Copy link

oxley192 commented Sep 1, 2020

I have got a gamestick and a ouya it would be nice to use these controller on the switch I now the gamestick controller is lacking some buttons but couldn't u use a combination of buttons to emulate missing buttons

@ndeadly
Copy link
Owner

ndeadly commented Sep 1, 2020

Ouya controller support has already been requested here #17. I've mostly implemented it and it will be included in the next release. If you want to try it out now there's a build posted in that thread.

Can you provide me more information about the gamestick? I'm not familiar with this controller. Yes, button combos could be used in place of missing buttons, but it's much harder to come up with defaults that everyone is going to agree with, necessitating the need for user configurable layouts. I'm not quite ready to start adding those features yet. If there are some obvious combos to use for certain buttons I'll consider setting them as defaults in the short term.

@ndeadly ndeadly added the feature request New feature or request label Sep 1, 2020
@oxley192
Copy link
Author

oxley192 commented Sep 1, 2020

15989910968783750127183577901552
15989912089098097494428590282398
15989913060794027058706545787675
15989913397183174934318678372341
The gamestick is by playjam I don't really no much else about it but I'll have a look around on line

@ndeadly
Copy link
Owner

ndeadly commented Sep 1, 2020

Interesting. Never seen this before. Thanks for the pics. From the name I thought it was going to have far fewer buttons. Looks like it wouldn't be such a big deal to add a few combos to handle the missing buttons. Is that a battery indicator in the last picture?

I'll need some more info about it in order to make it work. Have you tried pairing it with the console? It won't show up as connected yet, but if it's not doing anything weird it should show up in the pairing database. You can dump that with my btdb.nro app and post the results here so I can find its hardware ID. I'll take a look too and see what else I can find out.

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

The gamestick came out couple of months after the ouya and yes it is a battery indicator in the last picture I have just tried to pair up and nothing happens and there's nothing new posted in btdb.nro

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

I have just tried it with ur experimental one for the ouya and it pairs up but doesn't connect up and btdb.nro found it this time
15990652204073300273042533309125 I think it's the last pro controller on the list because it wasn't on the list last time

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Oh nice. I'm not sure why the Ouya build would have made a difference though. Are those your two controllers in the pics you posted? Could you try and pair the other one too so I can see if that device ID is consistent vs random garbage?

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

1599066170921249237428009834726
Both paired up and device ID is the same with both

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Cool, sounds like that's probably a real hardware ID then. Give me a bit and I'll knock up a skeleton handler for it and we can work through figuring out the button layout. I couldn't really find any existing code for it online.

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Good find. There's a section on button mappings that we might be able to reference. It's not entirely clear on the reporting format though so I think we're going to have to inspect the incoming packets visually, to get our bearings at least.

Here's an initial build with the skeleton handler in place. This should make the controller show up as connected, but you won't get any button presses or anything just yet.
MissionControl-0.1.0-gamestick-experimental.zip

Here's a tool I've used to figure out button layouts in the past. It's kinda crappy and lags about 1sec behind but it gets the job done. It steals the controller events from the system so you need to use the home button on the joycon (attached to the switch) to exit.
hid_report_tool.zip

This tool should print a raw hex dump of the incoming packets. Make sure you only have one controller connected or it will mess up the output. Send me a capture of the screen so I can get an idea of the packet size and ID. Then the idea is to press each of the buttons one at a time and see if you can spot which value it changes. Likewise, push the sticks to their extremes in X and Y and see if you can see which values are maxing out.

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

15990711464974473571744409257790

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

@oxley192 can you get a better picture? Can't really read that (you know you can use the consoles capture button right?) . What's that first digit?

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

03 0f 80 80 80 80 00 00 00 00

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Ok, so it's sending report 0x03. Do those values change when you press the buttons or move the analog sticks?

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

2020090219262101-656BE34E55C9033ADE0F9DE563FAE03C
My fone was playing up when transferring the picture over

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

Yes they do I'll do take a capture for every button and say which button it is

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Ha, if that's how you want to do it that would be great. Otherwise you could just tell me a few and I'll see if I can line it up with what that SDK document you found says

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

Home button big button with the arrow on = 01 00 10 00 00 00 00 00 00

Back button = 01 00 20 00 00 00 00 00 00
Start button = 03 0f 80 80 80 80 00 00 08
Y button = 03 0f 80 80 80 80 00 00 10 00
X button = 03 0f 80 80 80 80 00 00 08 00
A button = 03 0f 80 80 80 80 00 00 01 00
B button = 03 0f 80 80 80 80 00 00 02 00
L1 button = 03 0f 80 80 80 80 00 00 40 00
R1 button = 03 0f 80 80 80 80 00 00 80 00
L3 button = 03 0f 80 80 80 80 00 00 00 20
R3 button = 03 0f 80 80 80 80 00 00 00 40

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Perfect. Could you do the same with the sticks too? It should be enough to just record them in 100% up and 100% right position

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

left analogstick
Up = 03 0f 80 00 80 80 00 00 00 00
Down = 03 0f 80 FF 80 80 00 00 00 00
Left = 03 0f 00 80 80 80 00 00 00 00
Right = 03 0f ff 80 80 80 00 00 00 00

Right analogstick
Up = 03 0f 80 80 80 80 00 00 00 00
Down = 03 0f 80 80 80 ff 00 00 00 00
Left = 03 0f 80 80 00 80 00 00 00 00
Right = 03 0f 80 80 ff 80 00 00 00 00

D pad
Up = 03 00 80 80 80 80 00 00 00 00
Down = 03 04 80 80 80 80 00 00 00 00
Left = 03 06 80 80 80 80 00 00 00 00
Right = 03 02 80 80 80 80 00 00 00 00

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Could you check that start button one is correct? You've got it being the length of the 0x01 reports but with the data of the 0x03 reports. If it's an 0x03 the data you reported clashes with the X button

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

Start button 03 0f 80 80 80 80 00 00 00 08 is wot it comes up with and the x button 03 0f 80 80 80 80 00 00 08 00

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

All good, looks like you missed a 0x00 above.

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

Yep I did

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Made this build that maps the controls according to my interpretation of the info you gave me. Let me know what works and what doesn't.

Do you have some idea of which button combo would be good to simulate the ZL/ZR buttons?

MissionControl-0.1.0-gamestick-experimental.zip

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

The home button , back and start don't seem to work not sure about x and y haven't tried them on a game yet lol but everything things else seem to be working good and I was thinking like the start button and the back buttons for a combo

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

X and y both work it's just home start and back that don't seem to work

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

I might have got the bit ordering of home and back reversed. Try this build.
MissionControl-0.1.0-gamestick-experimental.zip

Not sure why start doesn't work though. I mapped it as the + button FYI.

Here's a visual controller test app I made that might help you to check everything better.

ControllerTest.zip

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

Start button still isn't working but home and bk button now work

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

Ah yeah whoops I read 0x08 as 0x80 for the start button. This build should fix it. I've also added the start button as a modifier for L and R so you should hopefully be able to press ZL and ZR now. Was easier than using the back button because it gets sent in the same report as the rest of the controls

MissionControl-0.1.0-gamestick-experimental.zip

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

Just trying out lz and rz in some games to see if I like the combination but verything else works goods

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

Don't like it cause it doesn't fully work I think it might be better using down on the dpad and the back buttons cos the combination doesn't always work with start

@ndeadly
Copy link
Owner

ndeadly commented Sep 2, 2020

The combination not working might be due to a logic error in my handling code though, so if that's your only complaint it still might be the better choice since those center buttons don't get used so much. Did you notice any pattern to it failing to trigger? I would imagine the case where you might legitimately hit a dpad button with a shoulder button and not want the combo might pop up more frequently

@oxley192
Copy link
Author

oxley192 commented Sep 2, 2020

It's cos the games I was using it on used + for like maps and setting up options so it wasn't working with some shooting games

@ndeadly
Copy link
Owner

ndeadly commented Sep 3, 2020

Ah right, so it was otherwise working as expected? This is where we get into the territory of needing to be user-configurable as everyone is going to have a different idea of what makes sense depending on which games they're playing. Since you're the only one who has requested this controller so far I can make dpad down be the default modifier for the time being if you want.

@ndeadly
Copy link
Owner

ndeadly commented Sep 3, 2020

I made this special build of hid_report_tool that filters out the normal button data. Could you run it and tell me if the controller sends any other data when it connects, or if you plug/unplug a charging cable? I want to see if it reports battery level information so I can add that.

hid_report_tool-gamestick.zip

@oxley192
Copy link
Author

oxley192 commented Sep 3, 2020

It just a blank screen unless I press the home button then it says 01 00 10 00 00 00 00 00 00 or back says 01 00 20
00 00 00 00 00 00 but if I keep back pressed in for about 10 seconds it say 01 00 00 00 00 00 00 00 00 and yes can u dpad down the combination please

@ndeadly
Copy link
Owner

ndeadly commented Sep 4, 2020

Yeah, that's to be expected. Sounds like it doesn't send any additional reports then. I wonder where the battery info is...

Anyway, here's a build with the dpad down combo. See what you think.
MissionControl-0.1.0-gamestick-dpad-down.zip

@oxley192
Copy link
Author

oxley192 commented Sep 4, 2020

That works better thank u

@oxley192
Copy link
Author

oxley192 commented Sep 4, 2020

I found a old Bluetooth controller that's meant to be for the gem box and it linked up if I do that same as before can we see if we can get that working too cause a good controller
15992608886698315926701372665020
15992610277603697810729487811776
15992610461935769632363721832782
15992610688523740728985056605940

@ndeadly
Copy link
Owner

ndeadly commented Sep 5, 2020

Sure, but please create a new issue for this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants