Retroarch: Nvidia Shield TV controller stops working after resuming from sleep

Created on 3 Feb 2019  路  7Comments  路  Source: libretro/RetroArch

First and foremost consider this:

  • Only RetroArch bugs should be filed here. Not core bugs or game bugs
  • This is not a forum or a help section, this is strictly developer oriented

Description

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)

Expected behavior

Nvidia Shield controller should continue to work after resuming from sleep.

Actual behavior

No button presses are registered after controller resumes from sleep.

Steps to reproduce the bug

  1. Start A Game
  2. Pause
  3. Leave controller sit for 5-10 minutes
  4. Try to unpause

Bisect Results

[Try to bisect and tell us when this started happening]

Version/Commit

You can find this information under Information/System Information

  • RetroArch: 1.7.5 (git version: c9c6c5a)

Environment information

  • OS: Nvidia Shield TV 7.2.2 (30.7.130.7) Build (opr6.170623.010.3664093_1378.1894)
  • Shield Controller Firmware: v1.27

Temporary Workaround

  1. Press home button to get to shield main desktop
  2. Re-enter Retroarch app
  3. Controller is recognized under correct port and functions

on_startup_small
after_sleep_small

minor android

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.

All 7 comments

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)...

retroarch.log

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.

Was this page helpful?
0 / 5 - 0 ratings