123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|722|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Hacking Controllers - Part 2

Page : 1 Prev 2
Next
Thu, 20 Mar 2014, 03:09
spinal
from what I can tell, theres two for each joystick, two for the analog triggers, two for the touchpad (although i guess this depends on how the os interprets the data). the res I haven't got a clue about. also, in the descriptor there are 3 mouse buttons, 15 physical buttons, some dummy ones for padding i guess.

It seems they've just though "what do we need in our controller?" then not even bothered to optimise it in any way. For a start, theres 2 unused mouse buttons, I think the scroll wheel is in there too, a full keyboard when it only uses the cursor keys.

So far, I've got the same functionality from my ps2 controller (minus the menu button) with far less info being sent.

One of these companies that keep spitting out controllers needs to make an OUYA controller.

-=-=-
Check out my excellent homepage!
Thu, 20 Mar 2014, 09:03
spinal
** Update **

Right, of all the things I didn't try, this should probably have been top of my list. I changed my vendor and product ID to mach those of an OUYA controller (0x2836, 0x01) and guess what? Correct! The bloody thing works correctly. not only that, but all of the button numbers match up too.

So my current test is just the plain Joystick example (google lufa), with a slightly changed descriptor as the joystick demo only allows two axis. The buttons are as follows -

X (left thumbstick, 0-0xFFFF, so the rest position is actually 0x8000)
Y (left thumbstick, same range)
Rx (right thumbstick, same range)
Ry (right thumbstick, same range)
Z (left trigger, same range, annoyingly on my pad this wobbles around 20% even when released)
Rz (right trigger, same range)
Button 0 (0)
Button 1 (U)
Button 2 (Y)
Button 3 (A)
Button 4 (left bumper)
Button 5 (right bumper)
Button 6 (left thumbstick click)
Button 7 (right thumbstick click)
Button 8 (dpad up)
Button 9 (dpad down)
Button 10 (dpad left)
Button 11 (dpad right)
Button 12 (left trigger, when pressed at all)
Button 13 (right trigger, when pressed at all)
Button 14 (central button press and release - can't detect when this button is pressed only)
Button 15 (central button hold - triggers after about two seconds)

source -- https://ouyaforum.com/showthread.php?3185-Ouya-controller-input-on-computer-macosx

No need to shoehorn in any keyboard keys or anything like that, the dpad is detected from buttons 8 through 11.
I haven't attempted anything special with the menu button yet, currently I just have it triggering button 14 when pressed.

-=-=-
Check out my excellent homepage!
Fri, 21 Mar 2014, 00:55
spinal
Bah, broke the PS2 controller. Hopefully just the wires, they're the stupid kind with the string in them.

-=-=-
Check out my excellent homepage!
Fri, 21 Mar 2014, 01:30
steve_ancell
Good excuse for some sacred soldering iron time.
Thu, 27 Mar 2014, 02:01
spinal
Fixed! It was a wiring thing. Walked round to my local Maplin, where they wanted £2.49 for a couple of meters of wire, thought better of it, wend to the DiscountUK next door to it and got a SCART lead for 99p, thats about 20 times as much wire for less than half the price!
Anyway, completely rewired the controller, got it working nice a good



The Analog button was repurposed to change modes between gamepad and mouse, maybe I'll add a keyboard mode also, who knows. The LED changes colour to indicate which mode it's in, red for gamepad, green for mouse and blue for nothing, haven't added that one yet
Once I got it detecting an an official OUYA controller, I discovered one small issue. Only the first 16 buttons are used by the OUYA, meaning the start and select buttons are completely unrecognised
Maybe I'll add a couple of keypresses or something...
The purple button is the menu button.

-=-=-
Check out my excellent homepage!
Thu, 27 Mar 2014, 04:06
Jayenkai
I'll assume that the green glows in the dark..?

Kinda nice, but.. Really stand-out-ish blue splodge up there!!!
Still, a damn sight better than I'd've ever managed to do. Mine would be cobbled together from random Lego bits, huge chunks of Meccano for the triggers, and other oddities that I could find lying around the room!!

.. And fantastic job on the wire-bargain, too, btw

-=-=-
''Load, Next List!''
Mon, 31 Mar 2014, 14:50
Dither
Wow, that's amazing! Great work.

I have an Ouya (received it as a birthday gift from a friend). I hardly have time to play games these days but I did try some of the emulators and the controller latency was quite noticeable at times. Funny thing is, it doesn't seem to be consistently laggy — which kind of makes it even more maddening! Sometimes the latency is barely noticeable, other times you can count a half-second or more between the button press and the action happening onscreen, which makes an arcade-style game pretty much unplayable.

I'm kind of surprised they didn't sort that out before releasing the thing.
Mon, 31 Mar 2014, 14:59
Jayenkai
I used to have loads of lag on mine.. Hoppy bobby showed it up like crazy!! But, lately, the lag's become a LOT less noticable. I think they've been tweaking something behind the scenes.

-=-=-
''Load, Next List!''
Tue, 01 Apr 2014, 02:13
spinal
I firmly believe that the issue really is that they're sending too much data. Even if you look at some of the USB coding examples around, people recommend sending as little data as possible,

-=-=-
Check out my excellent homepage!
Tue, 01 Apr 2014, 08:30
Dither
Your hypothesis is supported by Jay's and my observations. If the lag were strictly a hardware issue, I'd expect it to be consistent over time.
Tue, 01 Apr 2014, 09:44
rockford
Spinal: If you are correct (and I too believe that you may well be), then why not contact OUYA and let them know your findings. If it's software, then maybe a firmware update can fix the lag issue once and for all.

The OUYA controller lag is perhaps the most widely reported negative about the system (amongst the many negatives reported).
Thu, 03 Apr 2014, 00:27
spinal
Quick google...

USB 2 -> up to 12mb per second
Bluetooth -> up to 3mb per second

Even if thats just for file transfer, for controllers trying to send tens of bytes as many time a second as possible, there will always be a clear winner, especially when USB is said to cause a bottleneck with trying to be 3 devices at once

If only I have even a tiny bit of experience with bluetooth...

-=-=-
Check out my excellent homepage!
Sat, 05 Apr 2014, 06:31
spinal
first post updated with sourcecode downloadlink

-=-=-
Check out my excellent homepage!
Mon, 07 Apr 2014, 15:10
spinal
I wonder if I should make that thrid mode a 'specific game' mode, for controlling Portal or such...

-=-=-
Check out my excellent homepage!
Tue, 08 Apr 2014, 00:13
spinal
Spinal: If you are correct (and I too believe that you may well be), then why not contact OUYA and let them know your findings. If it's software, then maybe a firmware update can fix the lag issue once and for all.

The OUYA controller lag is perhaps the most widely reported negative about the system (amongst the many negatives reported).


I contacted OUYA via Alex. Apparently the latest controller firmware has vastly reduced the amount of data being send. However, there is no way for users to flash the controller, so you'd have to send it in to get flashed which could take some time.

I seem to be on the second most recent version. Can't say I've had any real issues with lag though, but then, I usually sit about a foot from the console.

-=-=-
Check out my excellent homepage!
Page : 1 Prev 2
Next