From: "Daniel J. Ogorchock" <djogorchock@gmail.com>
To: linux-input@vger.kernel.org
Cc: jikos@kernel.org, benjamin.tissoires@redhat.com,
Roderick.Colenbrander@sony.com,
"Daniel J. Ogorchock" <djogorchock@gmail.com>
Subject: [PATCH v0 0/2] HID: nintendo: avoid BT rumble disconnections
Date: Fri, 3 Feb 2023 16:51:16 -0500 [thread overview]
Message-ID: <20230203215119.435091-1-djogorchock@gmail.com> (raw)
The hid-nintendo driver has been plagued by an issue where rumble
command traffic to bluetooth-connected controllers can cause frequent
power downs of the controllers.
Digging into other pro controller driver implementations, I've not found
anything that hid-nintendo is doing incorrectly. Some implementations
seem to be working around the same problem (e.g. libsdl's hidapi
implementation rate limits rumble commands to avoid the problem).
hid-nintendo already rate limits rumble control packets, but that does
not solve the problem.
Using btmon output, I've fuond the the disconnections reliably occur
shortly after the controller's reporting rate become erratic. The
controller is meant to report input packets roughly every 15ms. Sending
rumble commands can sometimes result in the input packets arriving in
bursts/batches. Once the controller and/or BT stack enters this state,
even halting rumble commands will never allow the reporting rate to
recover to nominal. The controller will eventually disconnect.
This patch set strives to avoid the problematic scenario. It detects if
input reports arrive at clearly incorrect deltas. During these times,
the driver will hold off on transmitting any rumble commands to the
controller. This approach has allowed the reporting rate to reliably
recover in my testing. I've not been able to generate a controller
disconnection during hours of testing games with frequent rumble.
The behavior of this mechanism is tunable using #defines. We may need to
tweak/tune as the mitigation is used on different hardware setups.
My suspicion is that the core issue is somewhere in the bluez stack. My
next step is to investigate that lead in more detail. This patchset at
least allows for use of the controllers via bluetooth with rumble
enabled without frequently disconnecting.
Daniel J. Ogorchock (2):
HID: nintendo: prevent rumble queue overruns
HID: nintendo: fix rumble rate limiter
drivers/hid/hid-nintendo.c | 95 ++++++++++++++++++++++++++++++++++----
1 file changed, 86 insertions(+), 9 deletions(-)
--
2.39.1
next reply other threads:[~2023-02-03 21:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 21:51 Daniel J. Ogorchock [this message]
2023-02-03 21:51 ` [PATCH v0 1/2] HID: nintendo: prevent rumble queue overruns Daniel J. Ogorchock
2023-02-03 21:51 ` [PATCH v0 2/2] HID: nintendo: fix rumble rate limiter Daniel J. Ogorchock
2023-03-07 21:03 ` [PATCH v0 0/2] HID: nintendo: avoid BT rumble disconnections Silvan Jegen
2023-03-07 21:06 ` Silvan Jegen
2023-03-10 14:02 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230203215119.435091-1-djogorchock@gmail.com \
--to=djogorchock@gmail.com \
--cc=Roderick.Colenbrander@sony.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox