New issue
Advanced search Search tips

Issue 866047 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Gamepad disconnection not detected on Chrome OS

Project Member Reported by mattreynolds@chromium.org, Jul 20

Issue description

Tested with the latest Chrome OS Dev build on a Pixelbook Eve:

Chrome 69.0.3494.0 (Official Build) dev (64-bit)

1. Navigate to html5gamepad.com with no gamepads connected
2. Connect a USB gamepad and press a button
3. Verify that the gamepad is shown in the list of connected gamepads
4. Disconnect the USB gamepad.

Expected:

The gamepad should no longer be displayed in the list of connected gamepads. When a gamepad is disconnected, the "gamepaddisconnected" event should fire.

Actual:

The gamepad remains in the list until a new gamepad is connected. No "gamepaddisconnected" event is fired.

This only repros on Chrome OS and not Linux, even though the same Gamepad logic is used for both.

This bug may also cause the gamepad to use an incorrect mapping when the second gamepad differs from the first. This is because Chrome does not expect changes to certain fields (like the mapping function) without first disconnecting.
 
A couple of notes:
1. This is FAR worse with a DS4, where nearly every time the gamepad will not disconnect. With an xbox 360 controller, the odds seem about 50/50.

2. When switching between xbox/DS4 controller, it seems like this can also potentially wedge the gamepad input layer. Not every time, but in some situations all controllers will become unresponsive. html5gamepad will show the new device ID every time the gamepad switches, but no new inputs will affect anything. Once there, it becomes necessary to reboot the device to regain use of gamepads.
Additional data: it appears the DS4 alone is sufficient to wedge the system when disconnected/reconnected a large number of times.

Also, in one reboot the DS4 appeared to be normally functional to a point, and then for whatever reason become stuck as connected.

My suspicion is if removal is properly detected, the device can be cleaned up. At the point that it becomes dysfunctional, there's perhaps some maximum number of connected devices that gets filled by ghost controllers on disconnect/reconnects.

Sign in to add a comment