Received: by 10.213.65.68 with SMTP id h4csp287282imn; Mon, 12 Mar 2018 13:53:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELtw/UlH+tKCiGaRPvVDUDzJK/CQrrXHuxFVKDE14ypgKaLG1vwfAJF/xAAKKDOY20RI/vOo X-Received: by 10.101.71.202 with SMTP id f10mr7607619pgs.91.1520888022790; Mon, 12 Mar 2018 13:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520888022; cv=none; d=google.com; s=arc-20160816; b=ZxGitNaTX3U/znikUNDFSzqpgE4MuF/cTEYM1t96h1vhJ0WeWeHSqLawJr+K68Yxe7 bjVNe4HVVG0c07mrDfEQrO+I9EnOPdbCKMpJfpRYk6Fwys5NthNzVwIjsqr/3A5TJWKb SP59O/WFwiXBCvcFad2td52o81YrJBGtlFQz9XheuB+1febPPyPDpiP7c9+7pIDNWWGB k0j1v0HAAJa/1bEpOTG0t1PocwPMw/C/QjQNhFAkuDIiohMYSynTIBGWveiAWoCxBzO0 Z3230fia3dOm6Llm6En1x/o5DlyxdSNgibMZrMWYoYzN6+uKs6dGmMkBYIa0kax5P9nd +8fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Oia/6FUobcuq/wbTEzr2wl4Qxm7cuazQTa5AHzzoZ/Y=; b=CM3cTVaI7/7NR8RX7nV8hzdBwTgDQyw/xWfIYcK44IXhyniVS7Ae2m+ih89Rw/EbkH c8WmQecYyhAQL9HlqXI49m6zXM4seHHRu0pgdhVGBwZ/s2xiB8+G/nQCcZo3p/doRAuQ GcflLiqt6IUsmKsAjSCHI9ZlflVCJ7K1LjrA5jIPOye4e/NJt+AtSQ61naDlUFBUvy5g JRxa9U+VnQl35OW7pFnGPq/3G/CkVsInbDBOQgzsouR2yLZfmzBpG5IGjSY87rwBQPU+ cj6BnVJKnt140eQc1kDHZQaogcL7d6Os1oBouDVuH7LtfNrtEgGn1p9yRCvDhjvAYFTw cojw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HFtJoY1s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12-v6si2600751pli.406.2018.03.12.13.53.28; Mon, 12 Mar 2018 13:53:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HFtJoY1s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932457AbeCLUwG (ORCPT + 99 others); Mon, 12 Mar 2018 16:52:06 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:56036 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932302AbeCLUwD (ORCPT ); Mon, 12 Mar 2018 16:52:03 -0400 Received: by mail-wm0-f43.google.com with SMTP id q83so19418832wme.5; Mon, 12 Mar 2018 13:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Oia/6FUobcuq/wbTEzr2wl4Qxm7cuazQTa5AHzzoZ/Y=; b=HFtJoY1sg4kzQRjMJViOp20FqW0pKS4hTClNf0TWCUYWhEnMhCMQ/1rdOcOQ4N6FnZ +QLzeMtZT3luywiOX4/JATRS7cvjgSFOoJSV075SYOr3DsKOW6YJrybBZYHrj15WKyFs jy1hiYAD9gS0e+uoEprIEl1cL6/NJOIwaat0dzjkMKVt9vIOP9Z/6CBgYXewkSwWf7qJ Ozh7tLxN6kSAWUb0hHko0t+Tz2CnAOpNRoR+p4RKX1QrbJgQQ37JEHTPtnmEhuycBr8v lxKokFGoqrSjQFgBE7JYkJRmPmeVTb59lYZZtN0wPWs8gERABUs8fFkhLgTTz4k615Nt ZMEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Oia/6FUobcuq/wbTEzr2wl4Qxm7cuazQTa5AHzzoZ/Y=; b=oP94t8sD1nsApbjkhX4SoXFUJ9JpwQrlO431xAPsR3n5Svg78jT/ZYKj5lztzCkGyN +PJxZEpUN86wROd6VqlBySqB1mihksdtlbD47gsVXG+knZLnVpmCw71Q+/IrBtA1upqz iVrPLVUe83qYAxSX3b5k0mvHp9qWqCdEmUqBzceU00UzUx84bHTJpP7r/OfINJC/9yoa kmi0k8KfIO1+OibWQavXtIJnXy/w373slTyJ3vv0JmftSMCo8/VkBugsqkIeGh69L3lS yS5XaRVefrToGCWKghUOP+OSK6dG/hdAjoOEmeNskd8kBBCy/2GZqQdbdFgeWQ23+1Pi oU7Q== X-Gm-Message-State: AElRT7F8Zf97bvmTL1C+pBiA8prZJwyth4F9ck6mErKEqniWwdkpNzYJ XQo2trTlHedx+PIzzYU8LBg= X-Received: by 10.28.190.19 with SMTP id o19mr6730248wmf.53.1520887922095; Mon, 12 Mar 2018 13:52:02 -0700 (PDT) Received: from casa ([2a01:c50e:5126:7a00:8c46:1fba:39a7:53e0]) by smtp.gmail.com with ESMTPSA id l22sm9815492wre.52.2018.03.12.13.51.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Mar 2018 13:52:00 -0700 (PDT) Date: Mon, 12 Mar 2018 21:51:58 +0100 From: Rodrigo Rivas Costa To: =?iso-8859-1?Q?Cl=E9ment?= VUCHENER Cc: Jiri Kosina , Benjamin Tissoires , "Pierre-Loup A. Griffais" , Cameron Gutman , lkml , linux-input Subject: Re: [PATCH v5 0/4] new driver for Valve Steam Controller Message-ID: <20180312205158.GB21621@casa> References: <20180311195842.5551-1-rodrigorivascosta@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 : > > 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 > >