Re: Question about gamepad trigger axis values: Is -32767 or 0 the correct resting position?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 26, 2019 at 2:04 PM Hanno Zulla <abos@xxxxxxxx> wrote:
>
> Hi there,
>
> during a discussion of a Retropi issue [1] a question about the Linux
> kernel gamepad spec compared to the actual gamepad drivers came up.
>
> The spec says in [2]:
>
> > "ABS trigger values start at 0,
> > pressure is reported as positive values."
>
> The kernel drivers for the XBox 360 gamepad, for the Sony Sixaxis PS3
> gamepads and other drivers based on their example (like the BigBen
> gamepad) however return trigger axis values with a value range that...
>
> - starts at -32767 (trigger resting position) and
> - goes up to +32767 (full pressure on the trigger)
> - with 0 being the middle position (half pressure)
>
> Please clarify, is the spec wrong or are the drivers in violation of it?
>
> If they are in violation, which should be changed, the spec or the
> drivers' behavior?
>

Well some of the drivers are kind of in violation. The spec itself was
added in 2013, while many of the devices or drivers are way older. The
spec also states:
"Legacy drivers often don’t comply to these rules. As we cannot change
them for backwards-compatibility reasons, you need to provide fixup
mappings in user-space yourself. "

It is very, very hard to change the behaviour as it would break
applications. (We actually went to this once for ds3 / ds4, but that's
also because the driver was very incorrect and using illegal axes
even. Was a huge pain..)

We should pay attention to new drivers to support the spec as best as
possible. For devices which just use the generic HID parser ranges can
still be negative/postive for triggers, though mapping might also be
off then.

Thanks,
Roderick




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux