Author Topic: ODK project set up: initial issues  (Read 28110 times)

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: ODK project set up: initial issues
« Reply #30 on: January 19, 2013, 07:19:00 AM »
I added more diagnostic info to the source a couple days ago.  Curious to hear if the duplicated AXIS_X and AXIS_Y signals can be differentiated.  If you go into the diagnostics screen, is a different source shown in parentheses after AXIS_X and AXIS_Y?

Edit: Also curious, with both OUYA controllers connected, go to Controller info and see if they have unique descriptors
« Last Edit: January 19, 2013, 07:20:36 AM by littleguy »
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #31 on: January 19, 2013, 08:25:43 AM »
Sure I'll run some more diagnostics tonight.  I'm spending most of this weekend setting up the Open Pandora project since I promised folks I'd try and have an initial build by the end of this month.  I also need to start painting the modified N64 controllers, so lots to do.  Really enjoying this project :)
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: ODK project set up: initial issues
« Reply #32 on: January 19, 2013, 08:27:08 AM »
No problem, take your time.  Just letting you know in case it helps the OUYA progress.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: ODK project set up: initial issues
« Reply #33 on: January 20, 2013, 10:47:30 PM »
Just pushed a fix for the Nyko PlayPad controllers.  It might also fix some of the issues on the OUYA controller.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #34 on: January 21, 2013, 04:16:40 AM »
Ok, thanks.  I didn't get around to testing the OUYA this weekend, what with everything else.  I'll try and get some tests in tonight so I can report the results here.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #35 on: January 21, 2013, 10:39:28 PM »
With this build, the OUYA controller is much more stable.  In the controller diagnostics screen, All values are at -0.00 or +0.00.  There is a little minor twitching of AXIS_LTRIGGER and AXIS_Z (+0.13 or +0.17)  AXIS_GENERIC_1 is stable at +0.00.

Strangely, when I go to the mapping screen, it shows AXIS_GENERIC_1 (-) constantly.  This makes it impossible to map any controls, as they just get immediately mapped to AXIS_GENERIC_1 (-).

With both controllers connected, it identifies them as "Device 2 (OUYA Game Controller)" and "Device 3 (OUYA Game Controller".  Because of the twitching I mentioned above, the diagnostic screen keeps switching between the two controllers.

In the controller info dialog, there are four devices listed.  One is called "Virtual", Id -1.  One is gpio-keys, Id 1.  The other two are the OUYA Game Controller, Id's 2 and 3.  They have unique descripter hex strings.  Here are the details for one of them:

Code: [Select]
Axes: 11
  AXIS_X:
    Min: 0.0
    Max: 1919.0
    Range: 1919.0
    Flat: 0.0
    Fuzz: 0.0
    Source: MOUSE
  AXIS_Y:
    Min: 0.0
    Max: 1079.0
    Range: 1079.0
    Flat: 0.0
    Fuzz: 0.0
    Source: MOUSE
  AXIS_PRESSURE:
    Min: 0.0
    Max: 1.0
    Range 1.0
    Flat: 0.0
    Fuzz: 0.0
    Source: MOUSE
  AXIS_VSCROLL:
    Min: -1.0
    Max: 1.0
    Range: 2.0
    Flat: 0.0
    Fuzz: 0.0
    Source: MOUSE
  AXIS_X:
    Min -1.0
    Max: 1.0
    Range: 2.0
    Flat: 0.1250019
    Fuzz: 0.007782101
    Source: JOYSTICK
  AXIS_Y:
    Min: -1.0
    Max: 1.0
    Range: 2.0
    Flat: 0.1250019
    Fuzz: 0.007782101
    Source: JOYSTICK
  AXIS_LTRIGGER:
    Min: 0.0
    Max: 1.0
    Range: 1.0
    Flat: 0.062485695
    Fuzz: 0.0038910506
    Source: JOYSTICK
  AXIS_Z:
    Min: -1.0
    Max: 1.0
    Range: 2.0
    Flat: 0.1250019
    Fuzz: 0.00782101
    Source: JOYSTICK
  AXIS_RZ:
    Min: -1.0
    Max: 1.0
    Range: 2.0
    Flat: 0.1250019
    Fuzz: 0.007782101
    Source: JOYSTICK
  AXIS_RTRIGGER:
    Min: 0.0
    Max: 1.0
    Range: 1.0
    Flat: 0.062485695
    Fuzz: 0.0038910506
  AXIS_GENERIC_1:
    Min: 0.0
    Max: 1.0
    Range 1.0
    Flat: 0.0
    Fuzz: 0.0
    Source: JOYSTICK
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: ODK project set up: initial issues
« Reply #36 on: January 21, 2013, 11:25:36 PM »
You can fix the generic_1 axis issue by adding another line after line 64 in LazyProvider.java.  Just copy line 64 and substitute AXIS_GENERIC_1.  It's not a perfect solution in the grand scheme of things, but it is the correct solution given the current input mapping process.

Part of the stability you see may just be due to me truncating the output to 2 decimal places.  I could just imagine a non-programmer seeing 9.3558e-5 and thinking it's a really large number.

That's great that it assigns unique identifiers to each controller.  You should write them down somewhere and confirm that they don't change between reboots, disconnects, etc.  That would eliminate the Player Mapping screen entirely for OUYA users if they only use OUYA controllers, which would be huge for multi-player usability.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #37 on: January 22, 2013, 12:11:17 AM »
Looks like the controllers' descriptors do not change when disconnecting, powering the console off and on, connecting them in reverse order, etc.  They seem to be uniquely identified.

I'm going to look and see how to detect if the OUYA framework is running.  That would be a preferable way to trigger OUYA-specific settings and what-not, rather than checking the hardware string like for the Xperia Play.  That way the trigger would work also on test devices running the framework, hacked OUYAs and custom ROMs that could potentially change that string, and any next-generation OUYAs if they make them.


Latest Build (in case anyone with an OUYA devkit is following and isn't sure what version to use
« Last Edit: January 22, 2013, 07:06:51 AM by Paul »
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: ODK project set up: initial issues
« Reply #38 on: January 22, 2013, 07:19:43 AM »
That's a good idea.  However you implement the logic, would be good to encapsulate it in AppData so that's it's easy to access throughout the various parts of the front end.

Judging by your latest commit, I take it that solved the generic_1 issue?
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #39 on: January 22, 2013, 07:29:59 AM »
Yep, thanks for the help!

I should be able to test my modified controllers more easily now too, so I'll post the results from those tests tonight.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: ODK project set up: initial issues
« Reply #40 on: January 22, 2013, 07:37:07 AM »
Awesome!  Can't wait to hear more.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #41 on: January 22, 2013, 06:35:19 PM »
Results for the modified controllers are still not very good.  The most immediate problem is that C-right (AXIS_RZ -0.75) and C-up (AXIS_Z -0.75) are not mappable (from the Xbox 360 controller trigger lines in LazyProvider?)

The analog stick is perfectly mappable, and I discovered the problem I was having before was due to some sort of crossed signals between the OUYA controller and the N64 controller.  Turning off the OUYA controller solved that.

I also noticed in-game that the two mappable C buttons (C-left and C-down) seem to be rather unresponsive.  Possibly related to the first problem, though.  All other buttons work perfectly.

I'm going to test some of the unmodified controllers and adapters next (I still have a few extra adapters and two controllers that I haven't modified yet).  I'll post the results from that next.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #42 on: January 22, 2013, 07:03:00 PM »
Results from the unmodified adapter are very interesting.  Turns out the adapter shows up as two controllers not one like I originally thought.  Both are identical, as far as buttons/ keycodes and axis/ values.  C-Pad is still AXIS_RZ and AXIS_Z, and C-Right and C-Left are signed backwards from what you'd expect.  Same problems in-game with the C buttons.  The adapter I just tested actually seems to work perfectly for both controllers (surprising, since there was only one other in the lot that I tested which worked perfectly for both controllers -- possibly a problem with Mupen64Plus AE 1.5, though, which I tested them from).  I think I have at least one that has some button/ axis crossover issues on one port, so I'm going play around with it next.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: ODK project set up: initial issues
« Reply #43 on: January 22, 2013, 07:13:38 PM »
Ok, found the faulty adapter.  Basically it triggers A button (keyCode 189) whenever I press analog down (AXIS_Y -1.00)  This shows up in the controller diagnostic screen as well, and messes with the button mapping.  In-game of course moving down causes Mario to jump.  Really don't see any way around this problem, so just something we'll have to warn folks about when they are using these controllers.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: ODK project set up: initial issues
« Reply #44 on: January 22, 2013, 07:45:56 PM »
These are all symptoms of the main problem which is the brittleness of the current input listening/mapping implementation I put together.  Been thinking of more robust solutions for quite a while, I'm going to get my thoughts all together in one place and post here later tonight.  Would be really helpful to get some new ideas.  Off to dinner...

One more thing, in the "Controller info" screen, what does it say are the min and max values for AXIS_Z and AXIS_RZ?  +/-1 or +/-0.75 ?
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version