Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamepad API Trigger-Rumble Haptics Extension #1

Closed
gabrielsanbrito opened this issue Jun 28, 2022 · 13 comments
Closed

Gamepad API Trigger-Rumble Haptics Extension #1

gabrielsanbrito opened this issue Jun 28, 2022 · 13 comments
Assignees
Labels
concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) from: Google Proposed, edited, or co-edited by Google. from: Microsoft Proposed, edited, or co-edited by Microsoft. position: support topic: device apis Spec relates to device APIs: access to device-specific hardware, sensors, and interfaces topic: web apis Spec relates to web APIs (entry points for script) venue: W3C Web Apps WG

Comments

@gabrielsanbrito
Copy link

gabrielsanbrito commented Jun 28, 2022

Request for position on an emerging web specification

Information about the spec

Design reviews and vendor positions

Bugs tracking this feature

Anything else we need to know

We would like to extend the GamepadHapticActuator interface to expose the trigger-rumble capability in the Web for compatible gamepads.

P.S.: I have already sent an email to webkit-dev, but decided to continue the discussion here.

@othermaciej othermaciej added topic: web apis Spec relates to web APIs (entry points for script) topic: device apis Spec relates to device APIs: access to device-specific hardware, sensors, and interfaces venue: W3C Web Apps WG labels Jun 29, 2022
@marcoscaceres marcoscaceres changed the title Request for Position: Gamepad API Trigger-Rumble Haptics Extension Gamepad API Trigger-Rumble Haptics Extension Jun 30, 2022
@hober
Copy link
Member

hober commented Jun 30, 2022

I think @beidson & @marcoscaceres have opinions here.

@marcoscaceres
Copy link
Contributor

I'm personally opposed to this proposal (i.e., this position is NOT representative of the WebKit community; I'm posting it as input while waiting for further input from WebKit community members).

Although I'm are generally supportive of enabling haptic feedback, such as "trigger-rumble", on gamepads, I have significant reservations about the (non-standard) GamepadHapticActuator interface on which this proposal relies.

Specifically with the "trigger-rumble" proposal, I'm concerned that it’s targeting a narrow set of hardware. To alleviate this, it would be good to provide a canonical representation, such as an audio file, that can be used to consistently emulated "trigger rumble" across generic gamepads.

Returning to GamepadHapticActuator (and the changes that result directly from adding "trigger-rumble"), I've provided feedback on the design of the API via the W3C and outlined several issues. Some of the issues also appear in the "trigger-rumble" proposal (particularly around .canPlay()).

Lastly, I'm are sympathetic that GamepadHapticActuator has been shipping in Chromium-based browsers for a while despite the API not being a published standard. This situation is quite unfortunate and something the implementers should try to remedy through collaboration at the W3C: the more developers come to rely on the design of GamepadHapticActuator, the higher the chance that the Web Platform will be stuck with it.

I would be open to exploring alternatives to the GamepadHapticActuator, or evolving GamepadHapticActuator into something more useful - as well as looking at how we can enable more haptic effects on gamepad devices.

@marcoscaceres
Copy link
Contributor

Discussed with other folks and our position remains the one I posted above (#1 (comment))... basically, gamepad haptics are good, but we have concerns about GamepadHapticActuator. Marking as opposed for now, but happy to continue the discussion at the W3C.

@marcoscaceres marcoscaceres added position: oppose concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) labels Jul 22, 2022
@othermaciej othermaciej added from: Google Proposed, edited, or co-edited by Google. from: Microsoft Proposed, edited, or co-edited by Microsoft. labels Sep 25, 2022
@cabanier
Copy link

As mentioned earlier, the quest browser is exposing haptics and they're use quite a bit by developers.
We just released a new controller that has 3 sets of haptic actuators and each also support frequency.

The main actuator also support audio samples so it could play music or other effects. Was this ever discussed?

@marcoscaceres
Copy link
Contributor

The main actuator also support audio samples so it could play music or other effects. Was this ever discussed?

Yes. The W3C was waiting on a proposal from Microsoft to allow playing audio files:
https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/HapticsDevice/explainer.md

I'm hoping they will move that to the WICG (if they haven't already).

@cabanier
Copy link

cabanier commented Nov 2, 2022

@marcoscaceres what is the status of haptics? Would it make sense to join the CG or WICG?

@marcoscaceres
Copy link
Contributor

@cabanier, sorry I missed your question. It's still unclear if/where further haptic-related work will happen at this point. A few of us are discussing it as part of WebApps WG, but we are unsure of a venue. It will more than likely be a WICG thing.

In other news, although WebKit were opposed to this API, the vibratorActuator did end up getting implanted in WebKit and shipped in Safari Tech Preview 163 (release notes). The API has been around for a while in Chromium browsers, so it kinda made sense to ship it for web compat... even though we all agree that the design is less than ideal.

At the same time, folks involved with the Gamepad spec don't seek to pursue haptics using above model further... so we will try to figure out where, how how, we go forward from here with something better/more scalable, that better supports the capabilities of newer gamepads.

@cabanier
Copy link

Thanks @marcoscaceres
Our newest controller doesn't just have frequency; it's even possible to play music using a special motor.

We don't have an immediate need to have support for this but it would be nice to have in the future.

@hober
Copy link
Member

hober commented Mar 23, 2023

Closing as we've identified our position.

@cabanier
Copy link

@hober what do you think of my proposal in w3c/gamepad#186?

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Feb 9, 2024

Reopening it on request of Chromium/Microsoft folks. I'll coordinate with @gabrielsanbrito on this.

@marcoscaceres marcoscaceres reopened this Feb 9, 2024
@marcoscaceres marcoscaceres self-assigned this Feb 9, 2024
@gabrielsanbrito
Copy link
Author

Hey @marcoscaceres, I have updated the explainer to match the latest version of the Gamepad API spec.

@marcoscaceres
Copy link
Contributor

Changed position to support, as we collaborated in the specification over in WebApps and implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) from: Google Proposed, edited, or co-edited by Google. from: Microsoft Proposed, edited, or co-edited by Microsoft. position: support topic: device apis Spec relates to device APIs: access to device-specific hardware, sensors, and interfaces topic: web apis Spec relates to web APIs (entry points for script) venue: W3C Web Apps WG
Development

No branches or pull requests

5 participants