On the Nvidia Shield TV the Nvidia Shield controller (or possibly any controller that sleeps i.e. DS3 or DS4 via sixaxis app Not Tested) stops functioning after resuming from sleep as no button presses are registered from the controller (it appears to reconnect under the wrong port)
Nvidia Shield controller should continue to work after resuming from sleep.
No button presses are registered after controller resumes from sleep.
[Try to bisect and tell us when this started happening]
You can find this information under Information/System Information


Same issue, I think:
https://github.com/libretro/RetroArch/issues/4364
I think so too, but lets keep the newer one that followed the issue template. :)
It should be fully possible to support unplugging gamepads on the fly
https://developer.android.com/training/game-controllers/multiple-controllers
I am attaching a log...it appears that the device is recognized as NVIDIA Corporation NVIDIA Controller v01.04...which is interestng because in RetroArch/input/drivers/android_input.c that device appears to fall through all of the NVidia Controller hack checks (not sure if there is somewhere else in the code that would recognize that device id)...
After doing some debugging the main issue appears to be that when the controller comes back from sleep it gets a different id via android_input.c->android_input_get_id which retriggers handle_hotplug and treats it like a new controller added, which presents a problem due to the fact that the "old" controller was never removed from pad_states (also pads connected) and connects it to a different port.
I can confirm the same issue with an xbox one s controller on the shield. I also set autoconfig to no and max users to 1 for testing and it did not help anything. I do not have this issue with dolphin or any other standalone emulators I have tried.
My temp work around is to install button mapper, map the middle xbox button to launch retroarch which makes the controller work again.
Nvidea Shield. Just lost ~2 hours game progress to this, so I wanted to add. The "fix" posted here by a couple of people is not much of a fix: exit to device home, then re-enter the Retroarch app. This works only if the emulator you have running is stable enough. If not (N64 emulators for ex.), exiting to desktop will crash the app. If playing a game and the controller sleeps, it then get assigned to Port 1 and there is often no way to recover.
Most helpful comment
After doing some debugging the main issue appears to be that when the controller comes back from sleep it gets a different id via android_input.c->android_input_get_id which retriggers handle_hotplug and treats it like a new controller added, which presents a problem due to the fact that the "old" controller was never removed from pad_states (also pads connected) and connects it to a different port.