Received: by 10.223.185.116 with SMTP id b49csp35651wrg; Tue, 20 Feb 2018 15:21:44 -0800 (PST) X-Google-Smtp-Source: AH8x227UGjgQnHbW5PoDf7gp4LmUTYertVwsrvAXkFOUgoUfqbgkiEzgQCBn6fCvYDexaWTSQRfF X-Received: by 2002:a17:902:529:: with SMTP id 38-v6mr1122651plf.327.1519168904095; Tue, 20 Feb 2018 15:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519168904; cv=none; d=google.com; s=arc-20160816; b=cDFpjWXNbscZ9KhNKiFzJs9sNWSerg083oTjfy2NBUccdT3Hf6hjCOdKk/w7szg7Y+ pMi+VyLTzDq8gtnchH5lM/ImdIpHZOa8w1CGvYXiyIxx9NXu+4n5CDB0QKlWVEesqTjm rhZ+BY5gSNFq9lN+bunuqPcD1wbZQh0gjIaKCMeSF/Dm/0msBVqzNFPbLnY0teHgDn9H QqIafJryTkgKlNlRAlmObGVo4yV09I/D6jX7fzldHu+ATAB2y00yS/TFZAT1FdK5sVVL sCW85yoCIFbAD+65jJl/cjy5EwEcg5GtbdVhnjjU9o2Q6tVapJN0kQMOvJ9PT7+5o73z WnTw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=mv9Hl7Q0/84nBgdB2vIsjLbefXYW4UAMQ60sRmNpTIc=; b=0PI/XUNHASDoptVkF4cIHCAUlUgV0qnvT3Gmnjwb0daCg7tYCjepqldh2aUqJddT66 3V/KYnoMjZ9XswB/FEj0UNVPDS6R+f5P3CJXYbuzcd7fK1SN7FGiBDCTAvkEY/AbOSW0 /k4qOpzRYOn73cfgBqDwBL1wIFAPtoE3ZFscXjNZf7V/x9YkQgHishAdJ6/9pIsPiCHu Ou828Dyn20tQ7Uq4beBdSIyjxRLfn17yxFr663BGoqTbWltk95x9GZJcx5GI9HanTmLk yPOolvAGZyZNtvDAaIanWer0jD3CV8InbyeeLOiOWcL7rykC7SYl5L+DRhJ8B3i/cdf4 GTcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xk8teYhT; 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 d11si857248pgn.21.2018.02.20.15.21.29; Tue, 20 Feb 2018 15:21:44 -0800 (PST) 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=Xk8teYhT; 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 S1751901AbeBTXUm (ORCPT + 99 others); Tue, 20 Feb 2018 18:20:42 -0500 Received: from mail-wr0-f176.google.com ([209.85.128.176]:34121 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751746AbeBTXUk (ORCPT ); Tue, 20 Feb 2018 18:20:40 -0500 Received: by mail-wr0-f176.google.com with SMTP id m5so19066235wrg.1; Tue, 20 Feb 2018 15:20:39 -0800 (PST) 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:in-reply-to:user-agent; bh=mv9Hl7Q0/84nBgdB2vIsjLbefXYW4UAMQ60sRmNpTIc=; b=Xk8teYhTw3YuUhmrWJVwveyCbiEvOtvTRIEsV6xSd+kPuaH/qXc68Tu2aHuCHzS3wz LsAVPVFp7ih7cI6i8GS0lA32eEAbypBB/jOe9PrE+Cm5bqGMkF6/BVazzU7Gbr2Idjmf ITBEbCpv+2GqSMjMENOTy6Ei8/t3Ftk4gtbUi56dbGuYPygno4lBhfZAr+FRbhDC0CUT G/lBuMuHnnO4BPnKqP8wLrC9xPr4KyApAUk4JmQO/zWR/WJxEM56o/5fqykt0n9uaUr5 CUfF1iVSxtAw6/ZmAqH9dXvX0kYX/P60xuig1ht4yh95vDzKOTE1tV3DEXzYQTrq7O4Q +0pQ== 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:in-reply-to:user-agent; bh=mv9Hl7Q0/84nBgdB2vIsjLbefXYW4UAMQ60sRmNpTIc=; b=FLbMZY+gSlBHRnowSmfj+SuZqhPER8DkcOnK0Sgo5fcL3jP3i6P3UZmokP64oGae+s nrr6US9ZItoZtTa8AURYbsgcRz9lvqiU9aoIoUEG5Qxax0zB4kG7flh36hv5IzUvR2LC iUVi0Mc6L3jd3fhooRxqCykTB79622xh7FAZhq9Fkv7A0cb5ri0JcrR6pVeMet5V9Su3 BXU8oRgAxNxnKXy5sClC5A3uLann+aR3SWEEcyfw7u0Di0aqghvHwMs+9e3yJCn4biqs Cstcyi1PMUGM3M1c5BCF4tilfiLfhtiRj1g7eBLpdr6Z1Bzv2UW6JMKZDikQbhhgiiTC thOw== X-Gm-Message-State: APf1xPCzAknaifdvkZYu4zT9q+ccra5MLrnj4hreVXo+nQ4QMSe00XTA x3Nui9BnmwlGNbWvZmXBU/I= X-Received: by 10.28.206.75 with SMTP id e72mr499075wmg.100.1519168838760; Tue, 20 Feb 2018 15:20:38 -0800 (PST) Received: from casa ([2a01:c50e:5126:7a00:3036:bcff:fec8:b31f]) by smtp.gmail.com with ESMTPSA id y107sm14366318wrc.24.2018.02.20.15.20.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Feb 2018 15:20:37 -0800 (PST) Date: Wed, 21 Feb 2018 00:20:35 +0100 From: Rodrigo Rivas Costa To: "Pierre-Loup A. Griffais" Cc: Jiri Kosina , Benjamin Tissoires , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH v2 0/3] new driver for Valve Steam Controller Message-ID: <20180220232035.GA28798@casa> References: <20180220193306.28748-1-rodrigorivascosta@gmail.com> <673a2510-7d82-1b24-1085-9f5aa2bb9998@valvesoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <673a2510-7d82-1b24-1085-9f5aa2bb9998@valvesoftware.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 20, 2018 at 02:29:48PM -0800, Pierre-Loup A. Griffais wrote: > Hi Rodrigo, > > Thanks for working on that! I have a few questions and remarks. > > For the reverse-engineering part, there's a lot of existing reference in > existing (user-space) drivers for the controllers like sc-controller, but > feel free to reach out if you have any questions. It's overall pretty simple > and there's nothing secret about how it functions; there are some quirks, > however. Nothing secret about it, but also no documentation, so might as > well be... Have you tried deflecting the analog stick while touching the > left trackpad? You'll most likely need special handling there. How are you > planning to expose enabling/disabling auxiliary data like gyro over > wireless? Yeah, I look for information about a year when I started on this. I read Ynsta's user-mode driver [1] (I didn't find sc-controller), but I found that a bit incomplete, so I wrote my own named `inputmap` [2]. About the left trackpad/joystick, currently I'm not treating them different. I'm out of ABS axes, and anyway, it is not likely that the left pad and the joystick be used at the same time (I only have one left thumb). Nevertheless, if we really want to make them apart, we can use bits 10.3 (lpad_touch) and 10.7 (lpad_and_joy) together. I described the details in [2], but I'm not currently doing that in this driver. About the gyroscope/acceleration/quaternion, you know the issue that the wireless gives gyro plus quat but no accel, while the wired gives all three. My general idea is to create an additional input device with INPUT_PROP_ACCELEROMETER to expose what is available. Pity is that the wireless gives no accel, maybe there is some command to enable it? Also, ideally, we could expose the quat. data directly to userspace, but I see no clear way to do that. Maybe defining INPUT_PROP_QUATERNION? I also thought of computing yaw/pitch/roll from the quat. and exposing those, but doing that requires atan2() and sin() (16-bit precision), and that would be tricky. Any thoughts on that? > Will this driver being loaded affect functionality of existing applications > that talk to it through HID directly, like Steam or sc-controller? Will they > be able to keep getting the same HID data they do today? If so, the extent > of the work needed to support it in Steam might just be to ignore the > controller device it's exposing, since Steam will expose that itself through > its own means. As it is, this patchset hould be pretty safe. The only command sent to the controller is the get-serial-number, and that seems to do no harm to Steam Client. Other than that, it only reads. Moreover, the hidraw device is still created, so user-mode driver should keep working (but AFAIK, Steam Client uses direct USB access, not hidraw). Curiously, Steam Client does not show the new native Steam Controller gamepad. That is, if I connect the Steam controller with hid-steam.ko and an Acme HID gamepad, then in Steam Client controller settings I see only two controllers, the managed Steam Controller (not HID) and the Acme HID gamepad. I reckon that Steam Client recognizes that the new HID device is a Steam Controller and ignores it in favor of its own managed controller. Regards. Rodrigo [1]: https://github.com/ynsta/steamcontroller [2]: https://github.com/rodrigorc/inputmap