libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.24k stars 1.83k forks source link

[Android] "DragonRise Inc. Generic USB Joystick" USB Encoder auto initialized on start #14415

Open youngm opened 2 years ago

youngm commented 2 years ago

Description

In RetroArch Android my 2 "DragonRise Inc. Generic USB Joystick (121/6)" Zero Delay USB Encoders auto initialize immediately at Retroarch and game startup time rather than waiting for a button to be pressed. This makes it less user-friendly because controller 1 is randomly decided instead of simply being the first controller that has a button pressed.

See Reddit thread with @hizzlekizzle help for more context: https://www.reddit.com/r/RetroArch/comments/xcyz1x/retroarch_android_usb_encoder_controller_input

Expected behavior

I'd expect when RetroArch Android starts up that non of my controllers will initialize until I press a button on one, identifying that controller as the first input.

Actual behavior

Both of my Zero Delay USB Encoders initialize right when RetroArch starts causing a race condition for which controller is identified as input 1.

Steps to reproduce the bug

  1. Plus "DragonRise Inc. Generic USB Joystick (121/6)" USB Encoder into android device
  2. Start RetroArch
  3. Watch the controller get initialized despite no buttons pressed.

Bisect Results

My USB Encoders are new. This has always happened with these encoders in RetroArch. I will note though that RetroX behaves the way I'd expect RetroArch to behave (waiting for a button press to initialize the controller)

Version/Commit

Environment information

Materdaddy commented 1 month ago

@youngm did you get anywhere with this? I'm working through a setup of a retroarch setup on my Simpsons arcade1up and having the same problem with the same encoder. It's the one on the popular "leansmarthomes" howto with the popular "EG Starts" encoders from amazon. I can map things, but every time I re-launch retroarch the device indexes are different, completely killing the usability.

youngm commented 1 month ago

@Materdaddy I ended up buying new encoders. I bought 4 of these and they seem to be working better: https://www.aliexpress.us/item/3256802674561659.html

Materdaddy commented 1 month ago

Thanks for the reply! That link only allows qty of 1. I guess I'll try different encoders and do some testing.

youngm commented 1 month ago

Yeah you can find that same encounter from several ali vendors

On Mon, Sep 23, 2024, 9:33 AM Mathew Mrosko @.***> wrote:

Thanks for the reply! That link only allows qty of 1. I guess I'll try different encoders and do some testing.

— Reply to this email directly, view it on GitHub https://github.com/libretro/RetroArch/issues/14415#issuecomment-2368656154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADLDBLGNMUDGIZMU2ZDMILZYAYDJAVCNFSM6AAAAABOVBJMC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYGY2TMMJVGQ . You are receiving this because you were mentioned.Message ID: @.***>

Materdaddy commented 1 month ago

Looks like I'm going to have to make a ton of custom JST connectors or something. Those are 2-pin encoders, and my buttons are lighted and have 3-pins. Do you know what those devices show up as on android? I bought some more on Amazon (I'm impatient) that looked very different than the DragonRise ones, but they enumerate the same, and have the same issue.

youngm commented 4 weeks ago

I tried several from china too until I found that one worked well. This is what they enumerate as on the simpsons box. 370958203-c49ff130-1c68-4358-a45f-9a15134ce234

Materdaddy commented 3 weeks ago

Thanks @youngm . For anybody else curious, I was able to find some encoders that work with RetroArch on Android from Amazon, but it's very specifically only these ones: amzn.com/dp/B083RTPVVQ

Others I've tried that enumerate as DragonRise and do not work with RetroArch on the Simpsons Arcade1up's flavor of Android:

The biggest hiccup for me now is the fact that I bought the kit from the howto with lit buttons, and the pinouts for that doesn't work with giving 5V from the working USB encoders, so I've simply made 3-pin JST XH to 2-pin JST XH connectors to have the button functionality working without lit buttons, which I can live with. This is due to the original usb encoders having 5V, D, and GND pins. It seems the D line has a pulldown resistor and when given +5V it triggers the button press, but the working USB encoder has +3V and D, so it would add a lot of extra wiring to get the LEDs working.

gouchi commented 3 weeks ago

This feature might help your use case ?

It will be available in the next update > 1.19.1.

Or you can try to make a test with the nightly build ?

Thank you.