Android USB auto-configuration request extravaganza

Hi there,

I went through all my USB controllers and adapters and wrote down the device names from /proc/bus/input/devices.

There were some strange occurences with some but I’ll start with the straightforward cases first. If it is too much work, feel free to skip them!

Buffalo Classic Gamepad USB - SNES Version


I: Bus=0003 Vendor=0583 Product=2060 Version=0110
N: Name="USB,2-axis 8-button gamepad  "
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input8
U: Uniq=
H: Handlers=js1 event8 
B: PROP=0
B: EV=1b
B: KEY=ff 0 0 0 0 0 0 0 0 0
B: ABS=3
B: MSC=10

Buffalo Classic Gamepad USB - Famicom Version


I: Bus=0003 Vendor=0411 Product=00c6 Version=0110
N: Name="BUFFALO INC. BUFFALO BGC-FC801 USB Gamepad"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input9
U: Uniq=
H: Handlers=js1 event8 
B: PROP=0
B: EV=1b
B: KEY=ff 0 0 0 0 0 0 0 0 0
B: ABS=3
B: MSC=10

USBNESRetroPort + Dogbone Famicom AV Controller Adapter: Controller: http://upload.wikimedia.org/wikipedia/commons/1/19/NES-101-Controller.jpg


I: Bus=0003 Vendor=f000 Product=0003 Version=0100
N: Name="RetroUSB.com RetroPad"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input10
U: Uniq=
H: Handlers=js1 event8 
B: PROP=0
B: EV=1b
B: KEY=ff0000 0 0 0 0 0 0 0 0 0
B: ABS=3
B: MSC=10

USB Super RetroPort + Super Famicom Controller


I: Bus=0003 Vendor=f000 Product=00f1 Version=0100
N: Name="RetroUSB.com SNES RetroPort"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input13
U: Uniq=
H: Handlers=js1 event8 
B: PROP=0
B: EV=1b
B: KEY=ff0000 0 0 0 0 0 0 0 0 0
B: ABS=3
B: MSC=10

EDIT: Next I will post a series of dual MayFlash USB adpaters (N64, Wii, SNES, Saturn) and a PS/PS2 from Elecom (WiseGroup innards)

1 Like

Elecom PS/PS2 to USB - PS102U

This one shows up as two different devices under /proc/bus/input/devices.The only difference being the handlers.


I: Bus=0003 Vendor=0925 Product=8866 Version=0100
N: Name="WiseGroup.,Ltd JC-PS102U"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input16
U: Uniq=
H: Handlers=js1 event8
B: PROP=0
B: EV=1b
B: KEY=fff 0 0 0 0 0 0 0 0 0
B: ABS=30027
B: MSC=10

I: Bus=0003 Vendor=0925 Product=8866 Version=0100
N: Name="WiseGroup.,Ltd JC-PS102U"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input17
U: Uniq=
H: Handlers=js2 event9
B: PROP=0
B: EV=1b
B: KEY=fff 0 0 0 0 0 0 0 0 0
B: ABS=30027
B: MSC=10

The controller plugged into “Player 1” shows as Pad 0, the one in “Player 2” shows as Pad 1. The keycodes are identical.

CROSS: 190 CIRCLE:189 SQUARE:191 TRIANGLE:188

L1:194 L2:192 R1:195 R2:193

START:196 SELECT:197

DPAD UP: y= -1.00 DPAD DOWN: y= 1.000 DPAD LEFT: x= -1.00 DPAD RIGHT: x= 1.00

Pushing “Analog” on the controller (Dual Shock 2) enables the two extra clickable buttons under the sticks and left analog only.

L3:198 R3:199

LEFT ANALOG UP: y= -0.~1.0 LEFT ANALOG DOWN: y= 0.~1.0 LEFT ANALOG LEFT: x= -0.~1.0 LEFT ANALOG RIGHT: x= 0.~1.0

Pressing the dpad or the right analog sticks only show the latest coordinates from moving the left analog stick but the values don’t change. I take this is an android/HID driver limitation?

Mayflash Wii Classic Controller Adapter for PC USB

This one must be different from the already pre-configured Wii=>USB adapter.


I: Bus=0003 Vendor=1d79 Product=0301 Version=0110
N: Name="SZMy-power LTD CO.  Dual Box WII"
P: Phys=usb-tegra-ehci.2-1/input1
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.1/input/input30
U: Uniq=
H: Handlers=js2 event9
B: PROP=0
B: EV=1b
B: KEY=ffff 0 0 0 0 0 0 0 0 0
B: ABS=100 30027
B: MSC=10

The controller plugged in the left port shows as Pad 0, the one in the right shows as Pad 1. The keycodes are identical.

A: 189 B:190 X:188 Y:191

L:194 ZL:192 R:195 ZR:193

MINUS:196 HOME:198 PLUS:197

DPAD UP: 200 DPAD DOWN: 202 DPAD LEFT: 203 DPAD RIGHT: 201

LEFT ANALOG UP: y= -0.~1.0 LEFT ANALOG DOWN: y= 0.~1.0 LEFT ANALOG LEFT: x= -0.~1.0 LEFT ANALOG RIGHT: x= 0.~1.0

Right Analog doesn’t seem to work and only shows the latest coordinates from moving Left Analog. Values don’t change.

1 Like

Mayflash SS Controller Adapter for PC USB

This is a dual Sega Saturn to USB controller. However, it seems Mayflash uses the same chip across three adapters (SNES=> USB, N64=>USB and Saturn=>USB) as the devices all show up as “HuiJia USB GamePad”. RetroArch already has a preset for a the SNES version of “HuiJia USB GamePad” which means that it maps the bindings of the SNES version to the Saturn/N64 versions. In this case, the pad plugged in the LEFT port inheritates the bindings (which are “wrong” of course since the controller layouts are so different). Also dpad bindings don’t seem to match (different keycodes?).


I: Bus=0003 Vendor=0e8f Product=3010 Version=0110
N: Name="HuiJia  USB GamePad"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input19
U: Uniq=
H: Handlers=js1 event8 
B: PROP=0
B: EV=1b
B: KEY=ffffffff 0 0 0 0 0 0 0 0 0
B: ABS=f00ff
B: MSC=10

Both controllers show up as Pad 0.

Left Port:

A: 188 B:189 C:190

X:191 Y:192 Z:194

L:193 R:195

START: 197

DPAD UP: 200 DPAD DOWN: 202 DPAD LEFT: 203 DPAD RIGHT: 201

Right Port:

A: 96 B: 97 C: 98

X: 99 Y:100 Z:102

L:101 R:103

START: 197

DPAD UP: 110 DPAD DOWN: 107 DPAD LEFT: 0 DPAD RIGHT: 106

N64 Controller Adapter for PC USB

This is a dual N64 to USB controller. It suffers from the same problem as the SS/SNES adapter. See above.

IMHO, this one os FAR from being a priority since RetroArch doesn’t support the N64 yet. And as good as it was for N64 games, the N64 controller is clearly not the best suited for the platforms supported by RetroArch. Plus, it seems Android doesn’t quite like it (see below C buttons and Analog related issues)


I: Bus=0003 Vendor=0e8f Product=3010 Version=0110
N: Name="HuiJia  USB GamePad"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input19
U: Uniq=
H: Handlers=js1 event8 
B: PROP=0
B: EV=1b
B: KEY=ffffffff 0 0 0 0 0 0 0 0 0
B: ABS=f00ff
B: MSC=10

Both controllers show up as Pad 0.

Left Port:

A: 97 B: 98

L: 102 R: 103 Z: 104

START: 105

DPAD UP: 110 DPAD DOWN: 107 DPAD LEFT: 0 DPAD RIGHT: 106

The Analog and C buttons don’t seem to work (x= -0.00 y = -0.00)

Right Port:

A: 188 B: 190

L: 194 R: 195 Z: 196

START: 197

DPAD UP: 200 DPAD DOWN: 202 DPAD LEFT: 203 DPAD RIGHT: 201

Analog UP: y= -0.~1.0 Analog DOWN: y= 0.~1.0 Analog LEFT: x= -0.~1.0 Analog RIGHT: x= 0.~1.0

C buttons don’t seem to work either (x= -0.00 y = -0.00)

One more and we’re done!

1 Like

X-box Controller S / X-box Controller (Japan) with Titanium X-JoyConverter

This is a simple USB cord that allows plugging the first X-box controller into a USB port.

No urge on this one either as I’m sure most people have a 360 controller nowadays. And lots of inputs don’t seem to work well with Android.


I: Bus=0003 Vendor=045e Product=0285 Version=0100
N: Name="Microsoft X-Box pad (Japan)"
P: Phys=usb-tegra-ehci.2-1.1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1.1/1-1.1:1.0/input/input18
U: Uniq=
H: Handlers=js1 event8 
B: PROP=0
B: EV=20000b
B: KEY=6c3f0000 0 0 0 0 0 0 0 0 0
B: ABS=3003f
B: FF=1 7030000 0 0

A: 96 B: 97 X: 99 Y: 100

START: 108 BACK:109

BLACK: 98 WHITE: 101

LEFT ANALOG UP: y= -0.~1.0 LEFT ANALOG DOWN: y= 0.~1.0 LEFT ANALOG LEFT: x= -0.~1.0 LEFT ANALOG RIGHT: x= 0.~1.0

Left and right analog triggers, right analog stick and dpad don’t seem to work.

Xbox 360 Controller (Wired)

No introduction needed. Right analog, dpad and analog triggers don’t seem to work for now. Keycodes very similar to the first Xbox controller.


I: Bus=0003 Vendor=045e Product=028e Version=0114
N: Name="Microsoft X-Box 360 pad"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input24
U: Uniq=
H: Handlers=js1 event6 
B: PROP=0
B: EV=20000b
B: KEY=7cdb0000 0 0 0 0 0 0 0 0 0
B: ABS=3003f
B: FF=1 7030000 0 0

A: 96 B: 97 X: 99 Y: 100

START: 108 BACK:109 XBOX BUTTON: 110

L: 102 R: 103

LEFT ANALOG UP: y= -0.~1.0 LEFT ANALOG DOWN: y= 0.~1.0 LEFT ANALOG LEFT: x= -0.~1.0 LEFT ANALOG RIGHT: x= 0.~1.0

Logitech / Logicool F710

A very nice PC controller with a 360 layout with and nice features: the possibility to switch between DirectInput and XInput mode and the ability to switch between analog and dpad on the fly.

When in DirectInput mode, analog triggers are treated as buttons.

Understandably, each mode has its own device name.

Note: Here in Japan Logitech is kowns as Logicool in order not to infringe on Logitec, a Japanese PC peripherals and accessories manufacturer. Replacing Logicool by Logitech in the device name might enable support for the Western version as well unless Logicool is treated as a separate Vendor?


In DirectInput Mode:

I: Bus=0003 Vendor=046d Product=c219 Version=0111
N: Name="Logicool Logicool Cordless RumblePad 2"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input22
U: Uniq=
H: Handlers=js1 event6 
B: PROP=0
B: EV=1b
B: KEY=fff0000 0 0 0 0 0 0 0 0 0
B: ABS=30027
B: MSC=10

A: 97 B: 98 X: 96 Y: 99

START: 105 BACK:104

LB: 100 RB: 101 LT:102 RT:103

LEFT ANALOG UP: y= -0.~1.0 LEFT ANALOG DOWN: y= 0.~1.0 LEFT ANALOG LEFT: x= -0.~1.0 LEFT ANALOG RIGHT: x= 0.~1.0

Right Analog and Dpad don’t seem to work. However, since pressing the “Mode” button switches the Left Analog controls to the Dpad it’s not a real problem.


In XInput Mode:

I: Bus=0003 Vendor=046d Product=c21f Version=0306
N: Name="Generic X-Box pad"
P: Phys=usb-tegra-ehci.2-1/input0
S: Sysfs=/devices/platform/tegra-ehci.2/usb1/1-1/1-1:1.0/input/input23
U: Uniq=
H: Handlers=js1 event6 
B: PROP=0
B: EV=20000b
B: KEY=7cdb0000 0 0 0 0 0 0 0 0 0
B: ABS=3003f
B: FF=1 7030000 0 0

A: 96 B: 97 X: 99 Y: 100

START: 108 BACK: Exits game/RetroArch (Android Back button?)

LB: 102 RB: 103

LEFT ANALOG UP: y= -0.~1.0 LEFT ANALOG DOWN: y= 0.~1.0 LEFT ANALOG LEFT: x= -0.~1.0 LEFT ANALOG RIGHT: x= 0.~1.0

Keycodes are are the same as the Xbox and Xbox 360 controllers. Right analog, dpad and analog triggers don’t seem to work either.

And we’re done! I won’t blame you if you don’t want to support all of them =)

Just to put it all in the same thread, two more remarks:

  • Saturn USB pad: RetroPad Select is not mapped (as we discussed here). Keycode for Saturn Z is 101 and 108 for Saturn C.
  • Wii Classic Controller Pro (through WiiUse Android): RetroPad R is not mapped? (keycode for CCP "R "is 54)

Very nice job on the quick updates by the way and congrats on the 5K+ downloads!

You weren’t lying before when you said you would roll out your controllers.

Let me try put all this in - after putting all this in I think it can easily necessitate another version bump.

Yes, that’s why I asked before :slight_smile: Controllers are one of my pet peeves.

Ugh, I just realized I forgot the keycodes for the clickable sticks on the xbox-type ones. I’ll get to it tomorrow.

They souldn’t be needed by any game but if you plan on implementing binding for save/load etc… it could come in handy.

And again, don’t hesitate to drop some of them!

Yeah, I need the ‘L3/R3’-equivalent buttons as well.

Also, since these are a lot of pads and some of them have certain foibles, I’m going to be dropping in APKs here for you to test before pushing it out to the App Store. Is that OK?

Also, where is LT/RT for the 360 pad?

Hello again,

As somewhat expected L3/R3 for the Xbox 360, Xbox1 and F710 in XInput Mode share the same keycode:

Left Analog Button: 106 Right Analog Button: 107

On these 3 controllers dpad, right analog stick and analog triggers (LT/RT) don’t work. On Windows, dpad is detected as a POV hat, right analog and LT/RT as axes.

From what I experience with all these (+PS2 +Wii), it seems Android and/or RetroArch can’t handle more than one set of X/Y axes and and doesn’t like POV hats.

Confirmed with the N64 adapter: C buttons are assigned to a Z axis and Dpad to a POV which would explain why they don’t work.

Logitech F710 (DirectInput Mode): Left Analog: 109 Right Analog: 108

Fell free to drop all the APKs you want here, I’ll gladly test them!

Thanks again, just don’t burn yourself out!

Problem with those HuiJia pads is definitely that right now we only rely on one unique identifier for the autodetection, and that is the HID name. Seems we can’t rely solely on this alone - we need a second unique identifier - not sure what that could be.

BTW - pushed a new update to the Play Store -

r5

  • Input autodetection expanded
    • Archos gamepad
    • Xperia Play
    • Xbox 1 (Titanium X-JoyConverter)
    • Xbox 360 (wired)
    • Red Samurai Bluetooth
    • Another variant of Mayflash Wii Classic
    • RetroUSB SNES RetroPort
    • RetroUSB NES RetroPad
    • Buffalo SNES Pad
    • Logicool F710 (Japanese Logitech F710)
    • Elecom PS1/PS2 to USB

Test how this works for you. I was unsure about a few things - let’s see if I got it all right first-time around.

That was fast! At work now, will give it a try tonight and report accordingly.

Hey Squarepusher!

You did a pretty good job! I can’t really test R2/L2 R3/L3 at the moment but I used the SNES “Controller Test Cassette” rom to check the most basic inputs.

The two Buffalos (you forgot to mention the Famicom version in the list =)), the SNES RetroPort, the Xbox 360, the Xbox 1 all work as intended.

On the NES RetroPort it seems I got the keycodes wrong for Select and Start! What a m… The right keycodes are Select (98) and Start (99). Sorry for that. The rest is good.

On the F710 in DirectInput Mode X and Y need to be switched. The rest is fine. On the Mayflash Wii Classic, X is mapped as A, B is mapped as X, and A is mapped as B (!?). The rest is ok. On the Elecom PS/PS2, all buttons work except that R is mapped to the DualShock L2 instead of R1. The bigger problem though is that none of the axes respond (Dpad, Analogs…) and pressing the Dpad no longer displays keycodes. Very strange. On the F710 in XInput Mode, only X/Y axes work, none of the buttons do. Even stranger.

In doubt, I rechecked all the keycodes and apart from the NES RetroPort f*** up, all is good. Sorry again.

Also, I don’t know which SNES HuiJia USB adapter was used in r1 but mine has two ports. Player 1 works but there’s no mappings for Player 2. So just in case, here are the keycodes for the buttons of the second controller:

A:97 B:98 X:96 Y:99 L:102 R:103

START:105 SELECT:104

DPAD: No good!

FAKE EDIT: here again, it seems we get into the Android and/or RetroArch can’t handle more than one set of X/Y axes. May not be worth adding then!

Thanks as usual =)

P.S: I saw that new overlays were being worked on. Could it be made that each core gets the “right” overlay set at launch (a bit like a command line argument?)

EDIT: I also forgot keycodes for L3 (198) and R3 (199) for the Elecom.

Will be added later.

The next update (r6) should address all this. After that version is released, please test those pads again.

Except for the F710 buttons still not willing to work in XInput Mode, it’s a home run! I’ve checked the device ids and keycodes once more and all is good. Don’t worry too much about it, people can just switch to Dinput mode.

When all the post release craze dies out a little, could you look into the tiny little issues in post 6? (Saturn USB “Select” and WiiUSE CCP “R”)

Cheers much and get some sleep at some point?

Sure I could look at it - however, XInput mode for F710 I don’t believe is necessary.

To everyone - even though custom button mapping is added now - keep pumping out those keycode lists for pads to me because I like the autodetection system to be as good as possible - and the only way for that to happen is to try to support a sane default layout for nearly every device under the sun.

I just had a look at the manual custom binds in XInput Mode. The controller is just bonkers!

Shoulder buttons registers just fine but A or B only register for a moment before settling on “BACK”, X and Y do the same but they settle on “DPAD CENTER”.

So yeah, I think you’re better off forgetting about it and putting a little note in the readme =)

Forget what I just said: manual custom binds work fine if I select from the list (just saw your note… :shame)

BTW - I added the Xbox 360 pad too to the autodetect list. Could you please check out that one? I’ve got a guy complaining to me that diagonals don’t work and therefore he can’t do hadokens/shoryukens with Street Fighter-style fighing games - experienced anything like that on your end?

Just checked and I can confirm that diagonals don’t work for the 360, F710 (both modes)and Xbox 1. I can’t pass the diagonal test in the Controller Test ROM. This is both with autoconfig and forcing manual binds.

I made further tests with the Mayflash Wii and Elecom by disabling autoconfig and setting Up, Down, Left, Right to the left analog (instead of Dpad in autoconfig) and diagonals work perfectly for those two. There’s definitely something here.