libretro / RetroArch

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

[feature request] Use gamepad serial to uniquely identify pads #13063

Open hizzlekizzle opened 3 years ago

hizzlekizzle commented 3 years ago

Description

Currently, vid, pid and device name are the only fields we use to identify gamepads. This can be a problem when a controller goes to sleep and the driver/OS never informs RetroArch that the pad has disconnected, since it will show up as a brand new pad when it wakes back up. If we included the serial, we could uniquely identify pads to know when the same controller has reconnected, as well as potentially enable gamepad-specific remaps.

Expected behavior

When controllers go to sleep and wake back up, RetroArch sees that it's the same controller and returns it to its previous control state.

Actual behavior

RetroArch thinks it's a new controller and drops it into P2, P3, P4 ... each time it reconnects.

Steps to reproduce the bug

  1. connect a bluetooth controller
  2. let it go to sleep and then wake it back up
  3. it will be dropped into the P2 slot instead of P1, and you will no longer be able to control the game/menu

Bisect Results

has always happened

Version/Commit

You can find this information under Information/System Information

Environment information

ghost commented 3 years ago

This is a good idea however I could be wrong here but if its like the rest of the gamepad stuff the serials will be identical too on the cheaper stuff. Might be wrong though hope that is the case have you compared the serials on two identical controllers?

udevadm info -a -n

should list all the info worth checking its unique before moving forward