An update on input
Peter Hutterer gave an update on the input stack at the 2016 X.Org Developers Conference (XDC). A lot has been accomplished, but there is, naturally, more to do—especially as more and more quirky (or buggy) input hardware is released. But, overall Hutterer painted a picture of a mature subsystem that is largely feature-complete at this point.
Touchpads
Hutterer started with touchpads, saying that too many of them are still using the PS/2 protocol in the kernel. That protocol is limited to two touches and has limited bandwidth for reporting events. Over time the PS/2 firmware in those devices has gotten less and less testing as well.
The way forward is the RMI4 [129-page PDF] protocol for Synaptics touchpads for hardware that supports it. RMI4 is roughly six years old, so Linux is a bit behind the curve by not supporting it yet. The protocol allows for multiple fingers and has more accurate axis ranges and resolutions. The RMI4 core is in the mainline for I2C and SPI transport layers. RMI4 over HID devices is a work in progress that is just waiting for review, though some are already using RMI4 on HID over I2C. SMBus support is slated for 4.10.
Someone in the audience wondered how you would know if you need RMI4 support. Hutterer said that if you have a Synaptics touchpad, you will likely want RMI4 support. One side effect of these changes is that the touchpad device names will change. Anything that matches on the touchpad name in user space will end up with a "mute touchpad", he said.
Some new udev properties have been added for touchpads; one to identify trackball/touchpad combinations and another to identify touchpads that are integrated with the keyboard (as in a laptop), which are called "internal", versus those that are external. One use of the property is that only the internal touchpads will be disabled while the user is typing.
There have also been updates to the udev hardware database to make axis range corrections for some devices. The resolution in the database sometimes "does not match the real world". RMI4 will invalidate some of the database entries, as well, which he hopes is not a problem since RMI4 is much better protocol.
The goal for touchpad support in libinput is for it to be better than the xf86-input-synaptics driver. This is not universally true yet. One of the areas that needs work is pointer acceleration. Another is to make libinput responsive without using SIGIO, as had been done in the server in the past; more details about that would come later in the talk, he said.
The libinput developers tried to remove the touchpad hysteresis feature, which requires that a finger move a minimum distance before deciding that it actually is a movement, but that led to a whack-a-mole exercise trying to eliminate wobbly cursors for various devices. So hysteresis was eventually turned on again by default.
Another problem was that libinput would have cursor jumps that did not occur with the Synaptics driver. It turns out that changing between gestures (from two fingers to one for example) would cause the hardware to terminate the wrong finger "slot" so it would appear that the remaining finger jumped. The Synaptics driver is single-touch, so it did not experience the problem. Libinput was effectively penalized for trying to do something fancier.
Hutterer listed some quirky hardware that libinput has had to work around. Some Lenovo trackpoints send random events that trigger palm detection. Other Lenevo hardware randomly filters slower motions, which causes the cursor to stall. That was fixed by setting the acceleration slower on those devices so that users move their fingers faster and don't hit the firmware problem. It is one way to "train the users", an audience member said.
Tablets
Wacom still provides good support for its new tablets, he said. Other tablet support is "more random". It will not help that the DIGImend project, which targets better graphics tablet support for Linux, is shutting down because the maintainer doesn't have time to work on it.
The Wacom kernel driver (wacom.ko) has undergone a massive cleanup, Hutterer said. The biggest change that is visible to user space is that the LEDs are now controlled by the kernel through the LED subsystem. The driver used to require changes to support new devices, but it has switched to using HID descriptors. That allows integrated touch devices (screens and pads) to work out of the box. With luck, it will also allow future Wacom tablets to simply be plugged in and work, without needing an updated kernel for driver changes.
For libinput, tablet support is pretty much feature-complete these days. There is support for the tools, pads, and pad modes (including reporting the modes via the LEDs). Touch support has been changed so that the tablet is either treated as a giant touchpad or touchscreen. Tablet tools (e.g. stylus) are tracked with a serial number, which would allow them to be used on multiple tablets if the application supports it. The pads get their own event nodes, as do the various "rings", "strips", and buttons that are available on tablets.
For Wayland, the tablet protocol is now up to version 2. It is large, just because there is a lot of different kinds of data that is received from the tablets, but it is fairly straightforward, Hutterer said. The GTK+ tablet support is feature-complete at this point. There are still some GNOME configuration pieces that are partially missing, but otherwise there is nearly a full stack for tablets on GNOME.
Mice
He then turned to mice. The battery status handling for Logitech unifying receiver devices is being moved into the kernel. That will standardize the interface for GUIs. It is a work in progress at this point.
Libinput now provides the physical angle for mouse wheels as part of the event data. There is at least one mouse out there that has a different click angle for the horizontal wheel than it does for the vertical one—the horizontal wheel does not even have a way to do a click, but still sends those events at times. As with other devices, mice require some fixes for hardware quirks.
For Wayland, relative pointer information has been added to the protocol that provides both accelerated and unaccelerated motion data. It is something that was wanted for games, particularly "shooter games". There is also a protocol addition for pointer confinement—restricting the pointer to a particular surface (window). Both of those are not yet stable and need more testing. For XWarpPointer() support, which can't be done using the core Wayland protocol, there is a proposal to add it into XWayland.
The libratbag library, which was introduced at XDC 2015 as a library to configure gaming mice, has taken a back seat over the last year, he said. It supports quite a few different devices, with profile support so that configurations can be saved on the devices. As a follow-up to a question from last year, Hutterer told Keith Packard that the most expensive mouse the project has worked with cost $159 (up from roughly $100 last year, which Packard was incredulous about).
There is now a D-Bus daemon for libratbag (ratbagd), which will allow applications to configure these mice through the library. There is a GUI application called Piper, which is a standalone program, not part of GNOME Control Center or any other settings application. It is a rather specialized function that shouldn't be required frequently, he said. It doesn't store the configuration locally, it only changes the settings on the device itself.
One side effect of the libratbag work is a library to access Logitech unifying receivers called liblur. The idea is to hopefully replace the various home-cooked solutions out there, Hutterer said. There are "five, six, or even ten or more" of those available and there is really only a need for one library to handle operations like pairing a mouse or keyboard with a receiver.
Keyboards
The slide said "page intentionally left blank". Hutterer added: "We didn't do anything for keyboards because nothing needed to be done."
X server
Up through X server 1.18, all input events were handled using SIGIO. The user-space drivers would register a file descriptor with the server and install a SIGIO handler. Events would then trigger the signal, which would be processed in the signal handler. But there are lots of operations that cannot be done from a signal handler, memory allocation in particular.
This signal approach would not work for libinput as it needs to be able to allocate memory at times. For example, graphics tablet drivers cannot preallocate memory for all of the tools that might appear. Handling cursor movement, pointer acceleration, and other operations in the signal handler made event processing seem responsive. Not using that approach meant that libinput event handling would sometimes stall when the server was busy, which was especially noticeable when scrolling.
Thanks to Packard, there is a new input thread in the server. It simply waits for one of the input file descriptors to be ready, which makes libinput feel much more responsive. It did lead to some race conditions that needed to be tracked down, but most have been fixed at this point. The libinput test suite helped to find many of those, Hutterer said.
There is a plan to retire various specialized input drivers (e.g. Synaptics, Wacom) in favor of libinput. Traditionally, the evdev driver has been the catch-all driver and there have been some specialized drivers loaded for specific types of devices. Now, though, libinput is also a catch-all driver, but should be preferred over the specialized drivers. The X.Org configuration mechanism (xorg.conf.d) is not flexible enough to support this, however. It is based solely on the sort order of the files in the directory.
So, in server 1.19, there is now support for a new NoMatch directive that will only match a specialized driver if libinput has not already been attached to the device. In addition, the X server now has a built-in fallback driver to use if the driver module chosen is not available. In hindsight, he said, that should have been added in "2007 or so".
There has been some reshuffling of the entries in xorg.conf.d so they sort differently, as well. Instead of being near the bottom priority-wise (i.e. 98), libinput has been moved to 40, which puts it just below evdev and above all of the other specialized drivers. He noted that caused problems for desktop environments that do not support libinput (e.g. Cinnamon and MATE) and he strongly recommended that desktops move to support the library.
In summary, Hutterer said, input developers "are reaching peak boredom". There are mostly just little tweaks for hardware quirks and so on; there are no major features on the horizon. "That's a good thing", he said, since most "sane people" don't want their touchpads, mice, and other input devices to be exciting. For more details, interested readers can consult the slides or YouTube video from the talk.
[I would like to thank the X.Org Foundation for sponsoring my travel to
Helsinki for XDC.]
Index entries for this article | |
---|---|
Conference | X.Org Developers Conference/2016 |
Posted Oct 11, 2016 21:59 UTC (Tue)
by ballombe (subscriber, #9523)
[Link] (1 responses)
Posted Oct 11, 2016 23:55 UTC (Tue)
by jfebrer (guest, #82539)
[Link]
Posted Oct 12, 2016 1:23 UTC (Wed)
by flussence (guest, #85566)
[Link] (9 responses)
Posted Oct 12, 2016 11:42 UTC (Wed)
by mathstuf (subscriber, #69389)
[Link] (7 responses)
Posted Oct 12, 2016 12:53 UTC (Wed)
by ballombe (subscriber, #9523)
[Link]
tap -> button 1
Posted Oct 12, 2016 17:10 UTC (Wed)
by flussence (guest, #85566)
[Link] (5 responses)
Posted Oct 13, 2016 1:28 UTC (Thu)
by whot (subscriber, #50317)
[Link] (4 responses)
Posted Oct 13, 2016 9:22 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link] (2 responses)
Posted Oct 13, 2016 10:06 UTC (Thu)
by whot (subscriber, #50317)
[Link] (1 responses)
https://wayland.freedesktop.org/libinput/doc/latest/click...
when using software buttons, the middle button emulation needs to be explicitly enabled
Posted Oct 13, 2016 17:07 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link]
Posted Oct 15, 2016 21:39 UTC (Sat)
by flussence (guest, #85566)
[Link]
Touchpad functions reasonably well --> became used to relying on 2 & 3 finger middle/right drag gestures (because Openbox uses them by default, and they're easy to get to) --> switched to libinput and found out it didn't support those.
I mentioned the bug number for it a few posts up. Not in any hurry to get it back though.
Posted Oct 12, 2016 13:12 UTC (Wed)
by lkundrak (subscriber, #43452)
[Link]
Posted Oct 12, 2016 3:43 UTC (Wed)
by pabs (subscriber, #43278)
[Link]
I wonder if they have looked at the various keyboards with open source firmware:
https://github.com/jackhumbert/qmk_firmware
Or keyboards with eink displays on each key (only at crowdfunding stage):
https://www.sonderdesign.com
Or AR/VR input stuff.
Or various smartphone sensors.
Posted Oct 12, 2016 9:42 UTC (Wed)
by tao (subscriber, #17563)
[Link]
Posted Oct 12, 2016 15:26 UTC (Wed)
by prometheanfire (subscriber, #65683)
[Link] (10 responses)
Posted Oct 13, 2016 1:20 UTC (Thu)
by whot (subscriber, #50317)
[Link] (9 responses)
Posted Oct 13, 2016 3:26 UTC (Thu)
by prometheanfire (subscriber, #65683)
[Link] (8 responses)
Posted Oct 13, 2016 5:41 UTC (Thu)
by bronson (subscriber, #4806)
[Link] (7 responses)
Posted Oct 13, 2016 13:30 UTC (Thu)
by quotemstr (subscriber, #45331)
[Link]
Posted Oct 13, 2016 14:18 UTC (Thu)
by raven667 (subscriber, #5198)
[Link] (5 responses)
Posted Oct 13, 2016 19:17 UTC (Thu)
by hmh (subscriber, #3838)
[Link] (4 responses)
Posted Oct 13, 2016 21:27 UTC (Thu)
by raven667 (subscriber, #5198)
[Link]
Posted Oct 15, 2016 23:04 UTC (Sat)
by flussence (guest, #85566)
[Link] (2 responses)
For a lot of people that's been Good Enough. The problem now is that GTK2 is a fish out of water in the Wayland/libinput world, and there's no good replacement to hold the ecosystem together.
The *bare minimum* requirements for something to fill GTK2's shoes here are that it uses the C ABI (so that everyone can use it) and doesn't break downstream users every other week (so that everyone will *want* to use it). EFL is, AFAIK, the only thing that technically fits the bill there. I've heard it's no fun to write for though.
I hope some consensus happens on avoiding this problem while there's still room to maneuver. Right now it's looking like the future of Linux desktop apps is jQuery and Bootstrap, with all the subtle horror that entails.
Posted Oct 16, 2016 2:38 UTC (Sun)
by bronson (subscriber, #4806)
[Link] (1 responses)
This is horrifyingly true. Electron-based apps have really been picking up steam lately.
Gotta admit, I'm a fan of the Atom editor... but c'mon, 4 second boot and 500+ MB resident for a Slack or WhatsApp client?
Posted Oct 16, 2016 4:06 UTC (Sun)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Oct 13, 2016 1:35 UTC (Thu)
by whot (subscriber, #50317)
[Link]
That's not quite correct. We end up with 2 kernel devices anyway, one with the one with the new name and one with the old name. The old one is mute, it never sends events. Anything that matches on the old name will only apply to the device that never sends events, so your configuration options etc. won't get set on the device that's actually controlling the pointer. Apologies if that wasn't clear during the talk.
Also: "That was fixed by setting the acceleration slower on those devices so that users move their fingers faster and don't hit the firmware problem" - that's the plan, we haven't done it yet :)
Posted Oct 13, 2016 19:06 UTC (Thu)
by mb (subscriber, #50428)
[Link] (4 responses)
Posted Oct 13, 2016 23:46 UTC (Thu)
by whot (subscriber, #50317)
[Link] (3 responses)
Posted Oct 14, 2016 7:57 UTC (Fri)
by cladisch (✭ supporter ✭, #50193)
[Link]
(The DMCA forbids circumvention of copy protection measures, but has an explicit exception if it is necessary to achieve interoperability.)
As for the EU, the law forbids reverse engineering, but has an exception if it is "indispensable to obtain the necessary information to achieve the interoperability of an independently created program with other programs". And no EULA¹ can change that.
Posted Oct 14, 2016 11:31 UTC (Fri)
by kugel (subscriber, #70540)
[Link]
IANAL but by violating the EULA you merely lose the right to use the software in question (the razer mice driver) but how does that matter to anyone? Besides that forbidding reverse engineering in EULAs is not legitimate in lots of countries anyway.
Posted Oct 14, 2016 17:39 UTC (Fri)
by mb (subscriber, #50428)
[Link]
Almost every EULA out there has that clause. That doesn't mean it prevents us from developing drivers. (In this thread people already explained why that is the case)
But it's your lucky day. You don't even need to reverse engineer the original software. The razercfg developers already did that for you.
Razer is not hostile against Open Source. They actively supported me developing the Deathadder GPL driver after I published the first reverse engineered version of it.
Posted Oct 14, 2016 11:48 UTC (Fri)
by amarao (guest, #87073)
[Link] (1 responses)
I checked windows & mac - they both have exactly same problem. I've tried to read about hardware cursor refreshing rate, and found almost nothing.
Any thoughts?
Posted Oct 22, 2016 8:03 UTC (Sat)
by Hi-Angel (guest, #110915)
[Link]
Plug: if you want to use libinput in the linux console (for copy paste) see
consolation
An update on input
An update on input
Great advice!
An update on input
An update on input
An update on input
left button -> button 2
right button -> button 3
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
https://asylum.madhouse-project.org/blog/tags/ergodox/
https://github.com/algernon/ergodox-layout
https://jaasta.com/
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
An update on input
Now it just needs to be able to talk to Razer mice.
An update on input
An update on input
_____
¹ Even if it were valid².
² Most aren't because you cannot add restrictions after the purchase has been completed.
An update on input
An update on input
https://bues.ch/h/razercfg
So you can use that as a documentation of the hw protocol.
An update on input
An update on input