Controller not recognized in rgui at all

Hello,

I’m using the latest nightly (but just in case tried some other builds, e.g. 27/2, where some users reported being able to successfully configure their gamepads) and a NES30 controller, connected via Bluetooth on Cyanogenmod 12/Lollipop. Autoconfig Enable is set to “ON”, however Device Index shows N/A on every single port. When pressing buttons on my gamepad, logcat outputs this:

I/RetroArch( 1678): Using new lookup
I/RetroArch( 1678): device name: 8Bitdo NES30 GamePad
I/RetroArch( 1678): device vendor id: 65535
E/RetroArch( 1678): Failed to find product id for device ID: 14
E/RetroArch( 1678): Could not look up device name or IDs.

Trying “Bind all” doesn’t recognize any input at all.

Configuring buttons via the deprecated Android GUI does work, however once you launch RetroArch no input is recognized.

Any help would be greatly appreciated :slight_smile:

Surprisingly enough, my gamepad works fine using the current version in the Play Store.

Hi,

I can confirm this, installed the latest nightly to test PCSX-ReARMed (the stable version crashes on startup), tried using the different modes (iCade, joystick directional buttons etc…) without success. I’m on a Nexus 7 2013 with 5.0.2.

Regards

Okay, I had some spare time on my hands and kind of fixed this (actually it’s more of a dirty hack).


--- retroarch/input/drivers/android_input.c    2015-05-17 16:48:24.940021810 +0200
+++ retroarch/input/drivers/android_input.c.new    2015-05-17 16:48:14.290021773 +0200
@@ -293,8 +293,9 @@ static bool android_input_lookup_name(ch
    CALL_INT_METHOD(env, *productId, device, getProductId);
    if (!*productId)
    {
-      RARCH_ERR("Failed to find product id for device ID: %d
", id);
-      goto error;
+      RARCH_LOG("Failed to find product id for device ID: %d
", id);
+      // goto error;
+      *productId=1234;
    }
    RARCH_LOG("device product id: %d
", *productId);

This snippet basically fakes a product ID (it’s not actually used for identifying your controller), and now the pad is supported with a matching Autoconfig file, e.g.


8Bitdo_NES30_GamePad.cfg
---
input_device = "8Bitdo NES30 GamePad"
input_driver = "android"
input_b_btn = "97"
input_y_btn = "100"
input_select_btn = "98"
input_start_btn = "108"
input_up_btn = "19"
input_down_btn = "20"
input_left_btn = "21"
input_right_btn = "22"
input_a_btn = "96"
input_x_btn = "99"
input_l_btn = "102"
input_r_btn = "103"


input_b_btn_label = "B"
input_y_btn_label = "Y"
input_select_btn_label = "Select"
input_start_btn_label = "Start"
input_up_axis_label = "D-Pad Up"
input_down_axis_label = "D-Pad Down"
input_left_axis_label = "D-Pad Left"
input_right_axis_label = "D-Pad Right"
input_a_btn_label = "A"
input_x_btn_label = "X"
input_l_btn_label = "L"
input_r_btn_label = "R"

If someone more familiar with the code could actually commit something less hackish to git, I’d really appreciate this :slight_smile:

It looks like the closest thing to a ‘proper’ fix is to simply not error out if / when looking up the vendor and product id’s fails (which is something RA only attempts when running on KitKat and newer since JellyBean and older don’t support querying for them anyway). So your hackish fix actually isn’t that bad really, though there shouldn’t really even be a need to set vendorId or productId to anything if / when their lookup fails since the RA Android input code (as you mentioned) doesn’t actually use them (at the moment anyway) for doing controller ID.