New issue
Advanced search Search tips
Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment
link

Issue 786250: Record device IDs for connected gamepads

Reported by mattreynolds@chromium.org, Nov 17 2017 Project Member

Issue description

We should record UMA for connected gamepads in a way that helps us understand which devices are actually used by our users. This will allow us to:

* Create mapping functions for popular gamepads that don't have them. Except for a few cases, gamepads need a mapping function implemented in Chrome to work well, or sometimes to work at all. UMA will help us focus our development effort on better supporting the devices our users use the most.

* Identify devices that are NOT gamepads, but are detected as such. Some devices (e.g. Oculus Rift headset and Blue Yeti stereo microphone) are blacklisted because we mistakenly detect them as gamepads. This is particularly annoying since Chrome limits the number of connected gamepads, and these devices occupy one of the limited slots. We currently have no way to know how many other such devices there could be.

* Identify devices that are mistakenly enumerated through multiple host APIs. On some platforms we can interface with gamepads through multiple APIs. For instance, on Mac, we recognize gamepads through the GameController framework as well as through the lower-level USB enumeration APIs. When a device is enumerated by both it takes up two slots, only one of which may be functional.
 

Comment 1 by bugdroid1@chromium.org, Sep 26

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/717ca900fb5b45c209b306e4dedf67f27c64eb8c

commit 717ca900fb5b45c209b306e4dedf67f27c64eb8c
Author: Matt Reynolds <mattreynolds@google.com>
Date: Wed Sep 26 22:09:30 2018

Use uint16_t integer types for device IDs and HID usages

Vendor and product IDs are 16-bit values used to identify USB and
Bluetooth devices. Depending on the platform, they may be reported
as integers or strings. This CL modifies all places in Gamepad where
device IDs are stored as strings or signed integers to instead store
them in a minimum-width integer unsigned type (uint16_t).

Similarly, HID usage pages and usage numbers are defined to be
16-bit values. The constants holding these values are changed
to uint16_t.

In a future CL, Gamepad device ID and HID constants will be pulled
out of the platform-specific data fetcher implementations and placed
in a common header.

BUG=786250

Change-Id: I30a0841db91008802331939a86a7b6c3c5f58586
Reviewed-on: https://chromium-review.googlesource.com/1102099
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594495}
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/dualshock4_controller_base.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/dualshock4_controller_base.h
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_device_linux.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_device_linux.h
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_platform_data_fetcher_linux.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_platform_data_fetcher_linux.h
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_platform_data_fetcher_mac.mm
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_standard_mappings.h
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_standard_mappings_linux.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_standard_mappings_mac.mm
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/gamepad_standard_mappings_win.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/raw_input_data_fetcher_win.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/raw_input_gamepad_device_win.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/raw_input_gamepad_device_win.h
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/switch_pro_controller_base.cc
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/switch_pro_controller_base.h
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/xbox_controller_mac.h
[modify] https://crrev.com/717ca900fb5b45c209b306e4dedf67f27c64eb8c/device/gamepad/xbox_controller_mac.mm

Comment 2 by bugdroid1@chromium.org, Dec 6

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/054d99ba3502a3138925e5b15ed37633f68b5b33

commit 054d99ba3502a3138925e5b15ed37633f68b5b33
Author: Matt Reynolds <mattreynolds@google.com>
Date: Thu Dec 06 02:40:24 2018

Add list of known USB and Bluetooth gamepads

A list of known gamepad device IDs is added so that Chrome can
recognize and report when a gamepad is connected, even if the
device is not yet supported in Chrome. The metrics collection
will be added in a future CL.

BUG=786250

Change-Id: I579baf5d8de086061bff828031856c0a4f04359d
Reviewed-on: https://chromium-review.googlesource.com/c/1298648
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614244}
[modify] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/BUILD.gn
[modify] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/BUILD.gn
[add] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/gamepad_id.h
[add] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/gamepad_id_list.cc
[add] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/gamepad_id_list.h
[add] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/gamepad_id_list_unittest.cc
[modify] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/gamepad_standard_mappings_linux.cc
[modify] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/gamepad_standard_mappings_mac.mm
[modify] https://crrev.com/054d99ba3502a3138925e5b15ed37633f68b5b33/device/gamepad/gamepad_standard_mappings_win.cc

Comment 3 by bugdroid1@chromium.org, Dec 15

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1f7672d1577b044c0cdc6096796129e23bfe4fe6

commit 1f7672d1577b044c0cdc6096796129e23bfe4fe6
Author: Matt Reynolds <mattreynolds@google.com>
Date: Sat Dec 15 01:39:51 2018

Record metrics for connected gamepads

Update the Gamepad.ConnectedDevice histogram when a device is
connected with a vendor and product ID pair matching a known
USB or Bluetooth gaming peripheral.

If the connected device is not recognized as a known gamepad, the
ID is not recorded. If the data fetcher that enumerated the
device has an independent means of verifying whether a device is
a gamepad, record an enum representing the data fetcher to the
Gamepad.UnknownGamepad histogram.

BUG=786250

Change-Id: I7e7797ee1e99b2076aa331ee9e589d157016993b
Reviewed-on: https://chromium-review.googlesource.com/c/1299543
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616905}
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/BUILD.gn
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/gamepad_id.h
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/gamepad_pad_state_provider.h
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/gamepad_platform_data_fetcher_linux.cc
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/gamepad_platform_data_fetcher_mac.mm
[add] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/gamepad_uma.cc
[add] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/gamepad_uma.h
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/raw_input_data_fetcher_win.cc
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/device/gamepad/xbox_controller_mac.mm
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/tools/metrics/histograms/enums.xml
[modify] https://crrev.com/1f7672d1577b044c0cdc6096796129e23bfe4fe6/tools/metrics/histograms/histograms.xml

Sign in to add a comment