Re: Proposal to support pressure sensitive "analog" buttons in evdev

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

 



On 07/31/2018 02:39 AM, Bastien Nocera wrote:
> Hey,
> 
> On Mon, 2018-07-30 at 23:44 +0000, Roderick.Colenbrander@xxxxxxxx
> wrote:
>> Hi all,
>>
>> I would like to share a proposal to extend evdev with support for
>> pressure sensitive "analog" buttons. It is a feature common on gaming
>> peripherals (arcade sticks, gamepads, wii guitar) as well now on
>> analog
>> keyboards such as Wooting One / Two keyboards on which every button
>> is
>> both analog and digital (so ~100 analog keys).
>>
> <snip>
>>
>> This is an initial proposal to address limitations in evdev to
>> improve
>> device support in existing drivers such as hid-sony, hid-betopff,
>> psxpad-spi, hid-wii and probably others as well as new devices such
>> as
>> Wooting keyboards
> 
> Are there already user-space APIs, such as SDL, or the Steam joypad
> user-space gunk, that support those types of input (even if that's not
> implemented on Linux yet)?

I have seen a variety of proprietary APIs more in gamepad land. They 
often mimic the hardware closely. In case of gamepads they tend to 
report large self contained HID reports containing all axes, button and 
analog button state. The resulting APIs tend to look like the win32 
xinput API reporting a huge struct to user space.

I haven't seen anything in the SteamController API explicitly support 
these capabilities, but they have a concept of "analog action data" 
though currently coming from regular axes. I suppose they could extend 
this if they wanted to. SDL doesn't have a mechanism as far I'm aware.

As for analog keyboards, Jeroen can provide some more details, but my 
understanding is that there is no good OS support right now on any OS. 
As a initial approach the Wooting devices also report themselves as a 
HID gamepad and xinput gamepad. This allows them to at least inject some 
analog input into games through gaming APIs. DirectInput is most 
flexible as it supports a large number of axes and buttons.

> 
> What do those user-space APIs look like? Would they be a good fit for
> this kernel API, and would the chatter/amount of data to process be too
> much?

I'm not sure what the best API. Some of the proprietary APIs I have seen 
don't scale as they assume fixed data structures, but keep the number of 
calls low. DirectInput-like APIs which don't care about number of axes / 
buttons (and evdev is kind of like that) are probably best.

Amount of chatter is indeed a concern as evdev buffer sizes are 
typically small. Just of our gamepads I remember just on a table the 
values can easily fluctuate, so 'fuzz' like values should be important.
I think Wooting currently reports analog values for buttons 'pressed' 
and not if not pressed. I suspect they have an adjustable threshold or 
something. On gamepads we report them all the time (though we only have 
few buttons.

For me the question is what is the difference between a 'pressure 
sensitive button' and an 'axis'? At a high-level they are similar, but 
does one need extra APIs for best support?

Thanks,
Roderick

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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