WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
217742
HIDGamepadProvider adds an extra 50ms to all inputs
https://bugs.webkit.org/show_bug.cgi?id=217742
Summary
HIDGamepadProvider adds an extra 50ms to all inputs
Justin Uberti
Reported
2020-10-14 17:40:31 PDT
When measuring Safari's button-to-photon latency with html5gamepad.com, I noticed that Safari has roughly double the latency of Chrome for wired USB gamepads (108ms vs 56ms). I investigated this a bit and found this code in HIDGamepadProvider which I believe accounts for the difference:
https://github.com/WebKit/webkit/blob/950143da027e80924b4bb86defa8a3f21fd3fb1e/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.cpp#L39
50ms is enormous latency for a gamepad - gaming mice charge a premium in order to deliver ~10ms latency savings. Could this delay be reduced or eliminated? The rationale around this code isn't entirely clear to me: // This isActive check is necessary as we want to delay input notifications from the time of the first input, // and not push the notification out on every subsequent input. if (!m_inputNotificationTimer.isActive()) m_inputNotificationTimer.startOneShot(inputNotificationDelay);
Attachments
Patch
(3.04 KB, patch)
2021-07-01 10:20 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-10-14 17:56:27 PDT
<
rdar://problem/70315838
>
Brady Eidson
Comment 2
2020-10-15 13:03:28 PDT
Definitely room for improvement here.
Justin Uberti
Comment 3
2020-10-23 10:26:25 PDT
Note also that GameControllerGamepadProvider also has a 16ms notification delay:
https://github.com/WebKit/webkit/blob/950143da027e80924b4bb86defa8a3f21fd3fb1e/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm#L45
Could anyone comment on the intent behind these delays?
Brady Eidson
Comment 4
2021-07-01 10:20:28 PDT
Created
attachment 432706
[details]
Patch
EWS
Comment 5
2021-07-01 13:22:29 PDT
Committed
r279480
(
239333@main
): <
https://commits.webkit.org/239333@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 432706
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug