OLD Gamepad Autoconfig Thread

I updated the first post with the new instructions.

[QUOTE=Radius;25302]You don’t need keytest anymore, you can save the maps from within the GUI. Here is the recommended workflow

  • Load RetroArch
  • Change your autoconf directory to some folder you can read/write, most likely some place in the internal SD card
  • Go to input settings and RESET the binds for the port you are configuring
  • Bind All
  • Binding is sometimes too sensitive, so go to user # bindings and correct whatever is missing
  • Select save autoconf
  • Clean binds again and restart to verify

That’s what I did with the 8bitdo controllers (and I implemented saving) VID/PID saving are not implemented in the android input driver yet but I’l try to add that in the future[/QUOTE]

Thank you. I tried this route on my Nvidia shield with OTG cable and controller connected.

  • My controller DPAD and right analog stick cannot be bound (no reaction, it acts as if I am not pressing anything).
  • I know the controller DPAD data and right analog stick are submitted as POV hat data and rx/ry axes. That is how it shows up under Windows.
  • Maybe I should try “HID” Driver? Can I switch drivers from within Retroarch between Android and HID?
  • I have full control over how the controller is submitting data, so I could fix things on the controller side, too. I suspect android detects the controller, does some internal remapping, and decides to ignore the POV hat and the rx/ry axes for some reason.
  • This is a minor problem: When I saved the autoconfig, the device name and file name was still “Nvidia Corp…” instead of Mojo Retropad Adapter Mod. However in Retroarch, the device name showed up correctly after bind all.

[QUOTE=rsn8887;25326]Thank you. I tried this route on my Nvidia shield with OTG cable and controller connected.

  • My controller DPAD and right analog stick cannot be bound (no reaction, it acts as if I am not pressing anything).
  • I know the controller DPAD data and right analog stick are submitted as POV hat data and rx/ry axes. That is how it shows up under Windows.
  • Maybe I should try “HID” Driver? Can I switch drivers from within Retroarch between Android and HID?
  • I have full control over how the controller is submitting data, so I could fix things on the controller side, too. I suspect android detects the controller, does some internal remapping, and decides to ignore the POV hat and the rx/ry axes for some reason.
  • This is a minor problem: When I saved the autoconfig, the device name and file name was still “Nvidia Corp…” instead of Mojo Retropad Adapter Mod. However in Retroarch, the device name showed up correctly after bind all.[/QUOTE]

Yes, you can change the drivers from Android to HID, which would help you in this case, I think, I have a Bluetooth controller and I would assume it needs to be HID as well.

Edit: Using the Key Test app on my phone and my Classic Controller, I came up with the right key IDs for the corresponding buttons and made a new auto_config file. Just to be sure, I change the location for that on the Nexus 7 and have it load it up?

I want to be sure that I got this correctly, so here’s what I did with Notepad++


input_device = "Wii Classic Controller"
input_driver = "hid"
input_b_btn = "34"
input_y_btn = "33"
input_select_btn = "41"
input_start_btn = "44"
input_up_btn = "10"
input_down_btn = "11"
input_left_btn = "12"
input_right_btn = "13"
input_a_btn = "35"
input_x_btn = "30"
input_l_btn = "31"
input_r_btn = "54"
input_l2_axis = "+6"
input_r2_axis = "+7"
input_l2_btn = "71"
input_r2_btn = "72"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+2"
input_r_x_minus_axis = "-2"
input_r_y_plus_axis = "+3"
input_r_y_minus_axis = "-3"
input_menu_toggle_btn = "82"

input_b_btn_label = "A"
input_y_btn_label = "X"
input_select_btn_label = "Back"
input_start_btn_label = "Start"
input_up_btn_label = "D-Pad Up"
input_down_btn_label = "D-Pad Down"
input_left_btn_label = "D-Pad Left"
input_right_btn_label = "D-Pad Right"
input_a_btn_label = "B"
input_x_btn_label = "Y"
input_l_btn_label = "LB"
input_r_btn_label = "RB"
input_l2_axis_label = "LT"
input_r2_axis_label = "RT"
input_l3_btn_label = "Left Thumb"
input_r3_btn_label = "Right Thumb"
input_l_x_plus_axis_label = "Left Analog X+"
input_l_x_minus_axis_label = "Left Analog X-"
input_l_y_plus_axis_label = "Left Analog Y+"
input_l_y_minus_axis_label = "Left Analog Y-"
input_r_x_plus_axis_label = "Right Analog X+"
input_r_x_minus_axis_label = "Right Analog X-"
input_r_y_plus_axis_label = "Right Analog Y+"
input_r_y_minus_axis_label = "Right Analog Y-"
input_menu_toggle_btn_label = "Guide"

The key labels are unchanged as I used the Xbox 360 controller template to go off of, I’m not entirely sure if I need to change those or what, or if’d be too risky, I don’t know. Do I need to change it back to Android or HID? And is the controller name correct?

I fixed my problems. New pull request created for updated Mojo_Retro_Adapter_Mod.cfg.

It turns out the controller was reporting the right analog stick as Rx/Ry and not Z/Rz, which is what android expects. Also, the DPAD HAT value was reported as a 4 bit not an 8 bit number.

Since I can change the firmware of the controller, I changed the right stick to Z/Rz and fixed the Hat switch value, too. Those seem to be kind of standard now, I guess.

Anybody with a Mojo Retro Adapter can upgrade to the new modded firmware here by downloading the .hex files and using updatefw.exe (see readme.txt):

  • How exactly could I test HID driver mode? Is there an option in Retroarch hidden somewhere to switch drivers, or do I have to edit autoconf files blindly?

  • What is the “standard” way to report other axes, for example the L2/R2 button axes to Android, so they work using “android” driver? I know Rx/Ry is not recognized, and Key Test does not seem to report every analog axis.

  • It would help if somebody with a wired generic USB controller (not Xbox360) that has two analog sticks AND one or two analog shoulder buttons AND that can be fully mapped in Retroarch using android driver including the analog L2 and/or R2 axes. could plug this controller into windows, go to control panel, go to devices and printers, right click on the controller open up the test panel and tell me what axis names appear next to the shoulder button axes. The right stick should appear as Z/Rz axes.

EDIT: I understand it more now, I think the analog L and R Triggers should be mapped using Axis_Brake and Axis_Gas in Android. Those two correspond to USB HID axes “Brake” and “Accelerator”.

just tried the new version (1.2.1.) on my nvidia shield portable but its still not possible to get back to the Retroarch menu, whether via the back button, nor with selected L3+R3 combo…

I found the android controller specification and how the android axes map to USB HID usages. I found it in the “Android Compatibility Definition Document” here: http://static.googleusercontent.com/media/source.android.com/en//compatibility/android-cdd.pdf

On page 36 it says it all: " HID usages must be declared within a Game pad CA (0x01 0x0005).

Button HID Usage Android Button A 0x09 0x0001 KEYCODE_BUTTON_A (96) B 0x09 0x0002 KEYCODE_BUTTON_B (97) X 0x09 0x0004 KEYCODE_BUTTON_X (99) Y 0x09 0x0005 KEYCODE_BUTTON_Y (100) D-pad up D-pad down 0x01 0x0039 AXIS_HAT_Y* D-pad left D-pad right 0x01 0x0039 AXIS_HAT_X* Left shoulder button 0x09 0x0007 KEYCODE_BUTTON_L1 (102) Right shoulder button 0x09 0x0008 KEYCODE_BUTTON_R1 (103) Left stick click 0x09 0x000E KEYCODE_BUTTON_THUMBL (106) Right stick click 0x09 0x000F KEYCODE_BUTTON_THUMBR (107) Home 0x0c 0x0223 KEYCODE_HOME (3) Back 0x0c 0x0224 KEYCODE_BACK (4)

  • This usage must have a Logical Minimum of 0, a Logical Maximum of 7, a Physical Minimum of 0, a Physical Maximum of 315, Units in Degrees, and a Report Size of 4. The logical value is defined to be the clockwise rotation away from the vertical axis; for example, a logical value of 0 represents no rotation and the up button being pressed, while a logical value of 1 represents a rotation of 45 degrees and both the up and left keys being pressed.

Analog Controls HID Usage Android Button Left Trigger 0x02 0x00C5 AXIS_LTRIGGER Right Trigger 0x02 0x00C4 AXIS_RTRIGGER Left Joystick 0x01 0x0030 AXIS_X 0x01 0x0031 AXIS_Y Right Joystick 0x01 0x0032 AXIS_Z 0x01 0x0035 AXIS_RZ "

Set it under directories under settings

Try the nightlies, it’s fixed or wait for 1.2.2

great news, thanks. will wait for 1.2.2. do you know, if the OUYA controller now works too?

Now my Archos Gamepad detect the sticks but like joy_key 1, I can’t still use them for player 1 (joy_key 0), only works if you try to set for player 2. well now this new Ra version detect the sticks maybe in a future version it will works fine, Thanks for the updates and good work!

I’m unsticking this since the process has changed a lot now and I hope it works better Hunterk, if it’s ok, shall we close this thread now?