linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
To: "Clément VUCHENER" <clement.vuchener@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	"Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>,
	Cameron Gutman <aicommander@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-input <linux-input@vger.kernel.org>
Subject: Re: [PATCH v5 0/4] new driver for Valve Steam Controller
Date: Mon, 12 Mar 2018 21:51:58 +0100	[thread overview]
Message-ID: <20180312205158.GB21621@casa> (raw)
In-Reply-To: <CAM4jgCq5UT0SBKA1DMfsAKd8R+yn0ViPr0U-iE8-tWjgA9hTTQ@mail.gmail.com>

On Mon, Mar 12, 2018 at 03:30:43PM +0100, Clément VUCHENER wrote:
> 2018-03-11 20:58 GMT+01:00 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>:
> > This patchset implements a driver for Valve Steam Controller, based on a
> > reverse analysis by myself.
> >
> > Sorry, I've been out of town for a few weeks and couldn't keep up with this...
> >
> > @Pierre-Loup and @Clément, could you please have another look at this and
> > check if it is worthy? Benjamin will not commit it without an express ACK from
> > Valve. Of course he is right to be cautious, but I checked this driver with
> > the Steam Client and all seems to go just fine. I think that there is a lot of
> > Linux out of the desktop that could use this driver and cannot use the Steam
> > Client. Worst case scenario, this driver can now be blacklisted, but I hope
> > that will not be needed.
> 
> I tested the driver with my 4.15 fedora kernel (I only built the
> module not the whole kernel) and I got double inputs (your driver
> input device + steam uinput device) when testing Shovel Knight with
> Steam Big Picture. It seems to work fine when the inputs are the same,
> but after changing the controller configuration in Steam, the issue
> became apparent.

I assumed that when several joysticks are available, games would listen
to one one of them. It looks like I'm wrong, and some (many?) games will
listen to all available joysticks at the same time. Thus having two
logical joysticks that represent the same physical one is not good.

An easy solution would be that Steam Client grabs this driver
(ioctl(EVIOCGRAB)) when creating the uinput device. Another solution
would be that Steam Client blacklists this driver, of course.

> And without Steam and your external tool, you get double inputs too. I
> tried RetroArch and it was unusable because of the keyboard inputs
> from the lizard mode (e.g. pressing B also presses Esc and quits
> RetroArch). Having to download and compile an external tool to make
> the driver work properly may be too difficult for the user. Your goal
> was to provide an alternative to user space drivers but now you
> actually depend on (a very simple) one.

Yes, I noticed that. TBH, this driver without Steam Client or the
user-space tool is not very nice, precisely because you'll get constant
Escape and Enter presses, and most games react to those.

Frankly speaking, I'm not sure how to proceed. I can think of the
following options:
 1.Steam Client installation could add a file to blacklist
   hid-steam, just as it adds a few udev rules.
 2.The default CONFIG_HID_STEAM can be changed to "n". Maybe only
   on the architectures for which there is a Steam Client available.
   This way DIY projects will still be able to use it.
 3.This driver could be abandoned :-(. Just use Steam Client if possible or
   any of the user-mode drivers available.

If we decide for 1 or 2, then the lizard mode could be disabled without
ill effects. We could even enable the gyro and all the other gadgets
without worring about current compatibility.

At the end of the day, I think that it is up to Valve what to do.
Best Regards.
Rodrigo.

> Also the button and axis codes do not match the gamepad API doc
> (https://www.kernel.org/doc/Documentation/input/gamepad.txt).
> 
> >
> > For full reference, I'm adding a full changelog of this patchset.
> >
> > Changes in v5:
> >  * Fix license SPDX to GPL-2.0+.
> >  * Minor stylistic changes (BIT(3) instead 0x08 and so on).
> >
> > Changes in v4:
> >  * Add command to check the wireless connection status on probe, without
> >    waiting for a message (thanks to Clément Vuchener for the tip).
> >  * Removed the error code on redundant connection/disconnection messages. That
> >    was harmless but polluted dmesg.
> >  * Added buttons for touching the left-pad and right-pad.
> >  * Fixed a misplaced #include from 2/4 to 1/4.
> >
> > Changes in v3:
> >  * Use RCU to do the dynamic connec/disconnect of wireless devices.
> >  * Remove entries in hid-quirks.c as they are no longer needed. This allows
> >    this module to be blacklisted without side effects.
> >  * Do not bypass the virtual keyboard/mouse HID devices to avoid breaking
> >    existing use cases (lizard mode). A user-space tool to do that is
> >    linked.
> >  * Fully separated axes for joystick and left-pad. As it happens.
> >  * Add fuzz values for left/right pad axes, they are a little wiggly.
> >
> > Changes in v2:
> >  * Remove references to USB. Now the interesting interfaces are selected by
> >    looking for the ones with feature reports.
> >  * Feature reports buffers are allocated with hid_alloc_report_buf().
> >  * Feature report length is checked, to avoid overflows in case of
> >    corrupt/malicius USB devices.
> >  * Resolution added to the ABS axes.
> >  * A lot of minor cleanups.
> >
> > Rodrigo Rivas Costa (4):
> >   HID: add driver for Valve Steam Controller
> >   HID: steam: add serial number information.
> >   HID: steam: command to check wireless connection
> >   HID: steam: add battery device.
> >
> >  drivers/hid/Kconfig     |   8 +
> >  drivers/hid/Makefile    |   1 +
> >  drivers/hid/hid-ids.h   |   4 +
> >  drivers/hid/hid-steam.c | 794 ++++++++++++++++++++++++++++++++++++++++++++++++
> >  4 files changed, 807 insertions(+)
> >  create mode 100644 drivers/hid/hid-steam.c
> >
> > --
> > 2.16.2
> >

  reply	other threads:[~2018-03-12 20:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11 19:58 [PATCH v5 0/4] new driver for Valve Steam Controller Rodrigo Rivas Costa
2018-03-11 19:58 ` [PATCH v5 1/4] HID: add " Rodrigo Rivas Costa
2018-03-11 19:58 ` [PATCH v5 2/4] HID: steam: add serial number information Rodrigo Rivas Costa
2018-03-11 19:58 ` [PATCH v5 3/4] HID: steam: command to check wireless connection Rodrigo Rivas Costa
2018-03-11 19:58 ` [PATCH v5 4/4] HID: steam: add battery device Rodrigo Rivas Costa
2018-03-11 23:12 ` [PATCH v5 0/4] new driver for Valve Steam Controller Pierre-Loup A. Griffais
2018-03-12  7:35   ` Rodrigo Rivas Costa
2018-03-12 14:30 ` Clément VUCHENER
2018-03-12 20:51   ` Rodrigo Rivas Costa [this message]
2018-03-14 16:39     ` Benjamin Tissoires
2018-03-15 21:06       ` Rodrigo Rivas Costa
2018-03-17 21:54         ` Pierre-Loup A. Griffais
2018-03-19 20:08           ` Rodrigo Rivas Costa
2018-03-19 21:06             ` Clément VUCHENER
2018-03-20 19:18               ` Rodrigo Rivas Costa
2018-03-21 15:47             ` Benjamin Tissoires
2018-03-21 17:56               ` Rodrigo Rivas Costa

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=20180312205158.GB21621@casa \
    --to=rodrigorivascosta@gmail.com \
    --cc=aicommander@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=clement.vuchener@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pgriffais@valvesoftware.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).