linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Ogorchock <djogorchock@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: "Jiri Kosina" <jikos@kernel.org>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	"Roderick Colenbrander" <thunderbird2k@gmail.com>,
	"Billy Laws" <blaws05@gmail.com>,
	"Colenbrander, Roelof" <Roderick.Colenbrander@sony.com>,
	"Siarhei Vishniakou" <svv@google.com>,
	s.jegen@gmail.com, "Carl Mueller" <carmueller@gmail.com>,
	"Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>,
	"Bastien Nocera" <hadess@hadess.net>,
	"Barnabás Pőcze" <pobrn@protonmail.com>,
	"Lee Jones" <lee.jones@linaro.org>, "Pavel Machek" <pavel@ucw.cz>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH v16 00/16] HID: nintendo
Date: Tue, 19 Oct 2021 12:41:40 -0400	[thread overview]
Message-ID: <CAEVj2tnNMgvRaWZ-43bZbVydoTUUjFcS+7wiL_1D_UnH4HChXQ@mail.gmail.com> (raw)
In-Reply-To: <CAO-hwJLACSdEFxA+KDCUFKwU_=zM-j6=UDT4GD4b5PY9jW8rjQ@mail.gmail.com>

Hi Benjamin,

On Tue, Oct 19, 2021 at 6:19 AM Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
>
> On Tue, Oct 19, 2021 at 11:44 AM Jiri Kosina <jikos@kernel.org> wrote:
> >
> > On Tue, 19 Oct 2021, Jiri Kosina wrote:
> >
> > > > Rebased onto Linus' tree (sha 926de8c4326c14fcf35f1de142019043597a4fac)
> > > > Depends on Roderick's patch to add the player LED defines:
> > > > https://patchwork.kernel.org/project/linux-input/patch/20210908165539.3102929-3-roderick.colenbrander@sony.com/
> > >
> > > I just got Ack for the joydev part from Dmitry.
> > >
> > > v16 is now queued in hid.git#for-5.16/nintendo
> >
> > Benjamin noticed that I pushed wrong version of the branch -- the one that
> > still doesn't contain the LED_FUNCTION_PLAYER[1-5] defines, which I've had
> > staged here locally, waiting for Pavel's Ack (which is taking time,
> > unfortunately).
> >
> > So please ignore this branch for now, I'll push v2 once that situation is
> > cleared out.
> >
> > CCing Pavel as well here to make him aware of the issues this is causing
> > all over the place (see .e.g my mail [1] from yesterday).
> >
> > [1] https://lore.kernel.org/all/nycvar.YFH.7.76.2110181739310.12554@cbobk.fhfr.pm/
> >
>
> I am also jumping on this to raise a concern I recently had with all
> of the work we do for HID devices in the kernel regarding game
> controllers.
>
> Foreword: this is definitely not a NACK on the series, but more trying
> to open a discussion to take a step back.
>
> The SDL developers recently took a hard turn in how they are handling
> game controllers on Linux: libsdl now directly talks to hidraw or
> libusb to handle the controllers in user space, bypassing the kernel
> processing.
> Which means that a game working on a recent SDL release already has
> the PS5 player LEDs ready for instance.
>
> I think that part of this work was the integration of the steam client
> database, which already supports a lot of fix ups for game
> controllers.
>
> So I am starting to wonder if we are not adding dead code in the
> kernel, because both steam and SDL will disable the input handling of
> the controllers when they open the hidraw node (IIRC about what was
> done in this series).
>
> I know that Android/Chrome is interested in having actual input nodes
> created, but are they the sole users of those now?
> What is the benefit of having game controllers in the kernel?
>
> I am opening the discussion and we probably want to bring in the SDL
> folks here too. But I'd like to have some sort of confirmation that
> these series which are adding game controllers are not just adding
> dead code.
>
> Cheers,
> Benjamin
>

I agree that interactions with sdl are in a strange state where it
essentially bypasses kernel control over the controller. I'm not
really a fan of that technique when there's a specific kernel driver,
since it removes the ability for multiple applications to share the
input (e.g. if I wanted to bind one of the buttons on my controller as
a push-to-talk key in voip software while still using the controller
in a game). I understand why this technique was used, since it allows
for predictable cross-platform code from the sdl perspective.

The patch series follows the example of the hid-sony driver in
modifying the version field to allow userspace to detect the use of
the kernel driver, which gives userspace the option of behaving
differently if a kernel hid driver is in use for a game controller.

That said, I don't believe kernel game controller drivers are
amounting to dead code, since there are userspace applications using
evdev rather than libsdl for their controller inputs. A couple
examples specific to hid-nintendo:
https://github.com/DanielOgorchock/joycond
https://github.com/joaorb64/joycond-cemuhook

I know that several people use these kernel drivers alongside game
console emulators with evdev backends (e.g. dolphin, higan, etc.).

I'd personally like to see fewer cases of applications taking sole
control over the input devices, maybe keying off the version field
change mentioned above to determine their behavior. I understand that
is a tougher sell when the userspace driver implementation predates
the kernel driver's existence.

- Daniel Ogorchock

  reply	other threads:[~2021-10-19 16:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11 17:36 [PATCH v16 00/16] HID: nintendo Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 01/16] HID: nintendo: add nintendo switch controller driver Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 02/16] HID: nintendo: add player led support Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 03/16] HID: nintendo: add power supply support Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 04/16] HID: nintendo: add home led support Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 05/16] HID: nintendo: add rumble support Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 06/16] HID: nintendo: improve subcommand reliability Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 07/16] HID: nintendo: send subcommands after receiving input report Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 08/16] HID: nintendo: reduce device removal subcommand errors Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 09/16] HID: nintendo: patch hw version for userspace HID mappings Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 10/16] HID: nintendo: set controller uniq to MAC Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 11/16] HID: nintendo: add support for charging grip Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 12/16] HID: nintendo: add support for reading user calibration Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 13/16] HID: nintendo: add IMU support Daniel J. Ogorchock
2021-09-14 13:26   ` Jiri Kosina
2021-10-18 16:21     ` Dmitry Torokhov
2021-09-11 17:36 ` [PATCH v16 14/16] HID: nintendo: improve rumble performance and stability Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 15/16] HID: nintendo: ratelimit subcommands and rumble Daniel J. Ogorchock
2021-09-11 17:36 ` [PATCH v16 16/16] HID: nintendo: prevent needless queueing of the rumble worker Daniel J. Ogorchock
2021-10-19  8:54 ` [PATCH v16 00/16] HID: nintendo Jiri Kosina
2021-10-19  9:44   ` Jiri Kosina
2021-10-19 10:19     ` Benjamin Tissoires
2021-10-19 16:41       ` Daniel Ogorchock [this message]
2021-10-27  8:08     ` 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=CAEVj2tnNMgvRaWZ-43bZbVydoTUUjFcS+7wiL_1D_UnH4HChXQ@mail.gmail.com \
    --to=djogorchock@gmail.com \
    --cc=Roderick.Colenbrander@sony.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=blaws05@gmail.com \
    --cc=carmueller@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hadess@hadess.net \
    --cc=jikos@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=pgriffais@valvesoftware.com \
    --cc=pobrn@protonmail.com \
    --cc=s.jegen@gmail.com \
    --cc=svv@google.com \
    --cc=thunderbird2k@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).