From: Benjamin Franzke <benjaminfranzke@googlemail.com>
To: Ken Phillis Jr <kphillisjr@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH 1/2] joydev: Map ABS_{THROTTLE,GAS,BREAK} to positive values.
Date: Sat, 14 Dec 2013 07:22:29 +0100 [thread overview]
Message-ID: <CAFc8KeTxX7Wdm5nWGBctwLKew+kmgrJmR0Hdd1cSYStADPFQXQ@mail.gmail.com> (raw)
In-Reply-To: <CACiKS=QHY6Zq69+zRamZu6xPDUQs0DzNXB8TO_y977fq+qY2pw@mail.gmail.com>
I didnt test with games on steam.
I've tested with supertuxkart 0.8.1 and jstest.
Could you give me a hint, why you think that it breaks(?) input detection?
I think SDL2 used evdev, so how should a changed joydev break the
correction? (or do you mean in joydev fallback mode?)
Searching through the SDL code I guess you refer to this:
http://hg.libsdl.org/SDL/file/a5f8137ccf01/src/joystick/SDL_gamecontroller.c#l133
This really looks like a workaround for this brokeness of the joydev
correction for triggers,
thats why this should be fixed in kernel.
It cant really be inteded to map triggers to -32767-32767, and
consider this API to not brake application that have workarounds for
this.
Or is it?
2013/12/14 Ken Phillis Jr <kphillisjr@gmail.com>:
> On Wed, Dec 11, 2013 at 2:15 AM, Benjamin Franzke
> <benjaminfranzke@googlemail.com> wrote:
>> Gamepads like XInput devices have triggers with a range from
>> e.g. 0 to 255.
>> When the conventional joydev AXES correction/mapping method is used,
>> the default state 0 (i.e. when the user does not press a button or trigger)
>> is mapped to -32767 (and 255 to 32767).
>> You'll get 0 only when pressing the trigger half-way down.
>> This has several drawbacks:
>> - A trigger is not usable at all when configured to have 2 directions
>> when there is physically only one.
>> - Applications that let the user configure joystick input assignments
>> may register the mapped non-zero default state as a press,
>> preventing the user from configuring any sensible value.
>>
>> Traditonal calibration e.g. with jscal does not help to get a usable
>> experience either, it'll map the default state to -32767 as well.
>> Only manually editing the calibration data does work currently.
>>
>> This patch tries to fix this issue by calculating a positive-only range for
>> the throttle break and gas ABS bits.
>> Maybe other ABS types need to be added to this scheme as well(?)
>>
>> Note:
>> Although joydev is considered obsolete and people are encouraged to just
>> use evdev, joydev should still be fixed, because
>> 1. many applications still use it.
>> 2. userspace already copies the joydev correction code to evdev (e.g. libSDL).
>>
>> This bug should be fixed here in joydev first, and when we have a good
>> sensible state, this should be propagated to the application/libraries
>> that copied the joydev correction code.
>>
>> Gamepad drivers will need to advertise triggers as THROTTLE,GAS,BREAK instead
>> of e.g. ABS_{RZ,Z} where phyisically appropriate, to make use of this.
>>
>> I've considered changing the current joydev correction calculation for all ABS
>> types, to have only a scaling functionality by default, no translation
>> (all positive values remain positive, negatives negative and zero remains zero),
>> so that drivers would need to expose zero-centered ABS values.
>> It turned out to many drivers would need to be adjusted, which i cant
>> test.
>>
>> Signed-off-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
>
>
> I have serious concerns that this Patch and the Next patch will the
> input detection of the triggers on various games powered by SDL2. Have
> you tested this against games listed on steam that have full
> controller support?
next prev parent reply other threads:[~2013-12-14 6:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 8:15 [PATCH 1/2] joydev: Map ABS_{THROTTLE,GAS,BREAK} to positive values Benjamin Franzke
2013-12-11 8:15 ` [PATCH 2/2] joystick/xpad: Advertise the triggers as throttle/break Benjamin Franzke
2013-12-14 5:13 ` [PATCH 1/2] joydev: Map ABS_{THROTTLE,GAS,BREAK} to positive values Ken Phillis Jr
2013-12-14 6:22 ` Benjamin Franzke [this message]
2013-12-14 6:56 ` Ken Phillis Jr
2013-12-14 8:16 ` Benjamin Franzke
2013-12-19 12:50 ` Benjamin Franzke
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=CAFc8KeTxX7Wdm5nWGBctwLKew+kmgrJmR0Hdd1cSYStADPFQXQ@mail.gmail.com \
--to=benjaminfranzke@googlemail.com \
--cc=kphillisjr@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).