New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 717246 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Evdev Gamepad Support

Project Member Reported by jkwang@google.com, May 1 2017

Issue description

/device/gamepad use the joydev interface. We should move on and use evdev gamepad. 
Why:
1. Better compatibility. Gamepad mapping will be better.
2. Android is using evdev. Evdev gamepad support ARC++ better.
3. Event driven implementation (instead of polling) will have a better latency.
 

Comment 1 by kochi@chromium.org, May 2 2017

Components: Blink>GamepadAPI
Labels: -Type-Bug Type-Feature
Project Member

Comment 2 by bugdroid1@chromium.org, May 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/29de591dcbc520f84e3cfffd519027fec091675f

commit 29de591dcbc520f84e3cfffd519027fec091675f
Author: jkwang <jkwang@google.com>
Date: Sat May 06 19:19:20 2017

ozone: evdev: Add gamepad support

This patch add gamepad event and gamepad support to Ozone.
gamepad_event_converter_evdev will map evdev gamepad events to w3c
standard gamepad events. Then the events will be dispatched.

BUG= 717246 
TEST=Add/Fix and run unittest. Build local cl and inspect event
dispatch logs.

Review-Url: https://codereview.chromium.org/2805793002
Cr-Commit-Position: refs/heads/master@{#469880}

[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/BUILD.gn
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/BUILD.gn
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/device_event_dispatcher_evdev.h
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_converter_evdev.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_converter_evdev.h
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_converter_test_util.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_device_info.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_device_info.h
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_device_info_unittest.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_device_test_util.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_device_test_util.h
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_factory_evdev.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/event_factory_evdev.h
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/gamepad_event_converter_evdev.h
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/gamepad_event_converter_evdev_unittest.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/input_device_factory_evdev.cc
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/input_device_factory_evdev.h
[modify] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/gamepad_event.cc
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/gamepad_event.h
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/gamepad_mapping.cc
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/gamepad_mapping.h
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/gamepad_observer.h
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/gamepad_provider_ozone.cc
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/gamepad_provider_ozone.h
[add] https://crrev.com/29de591dcbc520f84e3cfffd519027fec091675f/ui/events/ozone/gamepad/webgamepad_constants.h

Comment 3 by jkwang@google.com, May 12 2017

To move on, we need to:
1. Add chrome flag to turn on exo ozone gamepad
2. Fix bugs of ozone gamepad.
      currently, the gamepad event functions are not marked as const
3. Cook a gaming_seat using ozone gamepad.
Project Member

Comment 4 by bugdroid1@chromium.org, May 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53276c7f011db2dde25d373ccbd45f2735ceef3c

commit 53276c7f011db2dde25d373ccbd45f2735ceef3c
Author: jkwang <jkwang@google.com>
Date: Mon May 15 17:51:58 2017

Add const to GamepadEvent functions

Gamepad event functions wll be marked const. Otherise it's not
usable when it is passed by const reference.

BUG= 717246 
TEST=Build and test with local gamepad client

Review-Url: https://codereview.chromium.org/2879993002
Cr-Commit-Position: refs/heads/master@{#471822}

[modify] https://crrev.com/53276c7f011db2dde25d373ccbd45f2735ceef3c/ui/events/ozone/gamepad/gamepad_event.h

Project Member

Comment 5 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1635d1c9793a83ecbe0c8333c7f0c4beb115034e

commit 1635d1c9793a83ecbe0c8333c7f0c4beb115034e
Author: jkwang <jkwang@google.com>
Date: Fri May 26 20:35:24 2017

ozone: evdev: Use correct integer width for gamepad axis values

Gamepad event value should be int instead of uint16_t. This patch fixes
the bug.

BUG= 717246 
TEST=Add/Fix and run unittest.

Review-Url: https://codereview.chromium.org/2893073003
Cr-Commit-Position: refs/heads/master@{#475110}

[modify] https://crrev.com/1635d1c9793a83ecbe0c8333c7f0c4beb115034e/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc
[modify] https://crrev.com/1635d1c9793a83ecbe0c8333c7f0c4beb115034e/ui/events/ozone/evdev/gamepad_event_converter_evdev.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/310f0bcc8e0e29b48c02c80843463a4d70f4674f

commit 310f0bcc8e0e29b48c02c80843463a4d70f4674f
Author: jkwang <jkwang@google.com>
Date: Mon Jun 05 22:44:18 2017

Add generic mapping for gamepad

There is a group of gamepads designed for joydev interface but will require a mapping for evdev. There was no existing mapping in current code base but if we move on to use evdev gamepad in arc++, user will notice their gamepad does not work anymore.

The purpose of this patch is to generate a mapping as close to joydev as possible while being compatible with xbox and adt gamnepads.

When gamepad vendor id and product id are unknown, we will use generic
mapping. A static generic mapping can only be compatible with one class
of gamepad. This commit implements a dynamic generic gamepad mapping. It
is both compatible with XInput style and ADT style gamepad. And it trys
it best to be compatible with joydev compatible gamepad.

BUG= 717246 

Review-Url: https://codereview.chromium.org/2899893003
Cr-Commit-Position: refs/heads/master@{#477108}

[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/BUILD.gn
[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/BUILD.gn
[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/evdev/event_device_test_util.cc
[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/evdev/event_device_test_util.h
[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc
[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/evdev/gamepad_event_converter_evdev.h
[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/gamepad/gamepad_mapping.cc
[modify] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/gamepad/gamepad_mapping.h
[add] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/gamepad/generic_gamepad_mapping.cc
[add] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/gamepad/generic_gamepad_mapping.h
[add] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/gamepad/generic_gamepad_mapping_unittest.cc
[add] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/gamepad/static_gamepad_mapping.cc
[add] https://crrev.com/310f0bcc8e0e29b48c02c80843463a4d70f4674f/ui/events/ozone/gamepad/static_gamepad_mapping.h

Comment 7 by jkwang@google.com, Jun 6 2017

One more issue:
GamepadProviderOzone::GetGamepadDevices() 
  std::vector<InputDevice> GetGamepadDevices()
   -> 
  const std::vector<InputDevice> GetGamepadDevices() const


Comment 8 by jkwang@google.com, Jun 7 2017

I am checking in the ozone gaming seat. It is currently protected by USE_OZONE_GAMEPAD. We should remove this make the gaming seat default when ozone is for every chrome os and ozone gamepad is stable.
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/660101f220ca79409db7450d980ba2f10888400f

commit 660101f220ca79409db7450d980ba2f10888400f
Author: jkwang <jkwang@google.com>
Date: Thu Jun 08 22:55:16 2017

Add static gamepad mapper for Nvidia Shield and Nintendo Switch

This patch add static gamepad mapper for Nvidia Shield Controller and Nintendo
Switch controller

BUG= 717246 

Review-Url: https://codereview.chromium.org/2926373002
Cr-Commit-Position: refs/heads/master@{#478114}

[modify] https://crrev.com/660101f220ca79409db7450d980ba2f10888400f/ui/events/ozone/gamepad/static_gamepad_mapping.cc

Project Member

Comment 10 by bugdroid1@chromium.org, Jun 13 2017

Project Member

Comment 11 by sheriffbot@chromium.org, Jul 18 2017

Labels: Hotlist-Google

Comment 12 by jkwang@google.com, Jul 18 2017

Status: Fixed (was: Assigned)
Status: Assigned (was: Fixed)
Can we remove the old joydev code from exo now?

Comment 14 by jkwang@google.com, Aug 8 2017

Reasonable, I will cook a cl when I get some cycles.
Cc: reve...@chromium.org
Labels: -Pri-3 M-63 Pri-2
Ping on removing old joypad code.
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9ec45bae6b8f54efd4dc444a38b7631932f5d8b1

commit 9ec45bae6b8f54efd4dc444a38b7631932f5d8b1
Author: Jingkui Wang <jkwang@google.com>
Date: Tue Sep 12 21:27:48 2017

exo: Remove old gamepad implementation

This patch removes the gaming seat implementation for evdev. All the
gamepad support will use ozone implementation.

This patch also removes the dummy interface for gaming_input_v1 in Wayland
server. The dummy interface was there to make sure the system is robust
when we moved the protocol to v2.

Bug:  717246 
Change-Id: I70b29d3c6a81761d1e15c502f78fd0615bf768fe
Reviewed-on: https://chromium-review.googlesource.com/661100
Commit-Queue: Jingkui Wang <jkwang@google.com>
Reviewed-by: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501402}
[modify] https://crrev.com/9ec45bae6b8f54efd4dc444a38b7631932f5d8b1/chrome/common/features.gni
[modify] https://crrev.com/9ec45bae6b8f54efd4dc444a38b7631932f5d8b1/components/exo/BUILD.gn
[modify] https://crrev.com/9ec45bae6b8f54efd4dc444a38b7631932f5d8b1/components/exo/gaming_seat.cc
[modify] https://crrev.com/9ec45bae6b8f54efd4dc444a38b7631932f5d8b1/components/exo/gaming_seat.h
[delete] https://crrev.com/35476d64b9c17e04723040932584fc6a17ea584f/components/exo/gaming_seat_ozone.cc
[modify] https://crrev.com/9ec45bae6b8f54efd4dc444a38b7631932f5d8b1/components/exo/gaming_seat_unittest.cc
[modify] https://crrev.com/9ec45bae6b8f54efd4dc444a38b7631932f5d8b1/components/exo/wayland/server.cc

Comment 17 by jkwang@google.com, Oct 10 2017

Status: Fixed (was: Assigned)

Sign in to add a comment