Re: Game Controllers
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-05-02 20:18:12
On Thu, May 02, 2013 at 03:54:45PM -0400, Todd Showalter wrote:
On Thu, May 2, 2013 at 2:29 PM, Dmitry Torokhov [off-list ref] wrote:quoted
quoted
- any mapping library is going to have to be a mirror of the kernel code, which means it's basically just a lot of duplicated effort with the added penalty of update lagThe library can do much more than that. You also need to calibrate the device (per user), adjust it to user's tastes and so on. Maybe you have a user that is left-handed and you'd like to remap some keys? It is certainly not kernel's job.I think calibration, dead-zones, easing, button remapping and the like are a totally orthogonal problem. They are nice to have, but that's the kind of thing that belongs in a desktop environment's accessibility settings, not at the input protocol level.quoted
There also should not be lag if new devices follow the agreed upon mapping.If we can have that, at least, it means the problem is eventually fixed. Maybe not for years, but at least someday.quoted
The same thing can be done in a library. Libraries are easier then kernels, you do not need to consume memory until needed and you do not need to do the conversion if it is not needed. And it should be possible to update the library whereas with kernel you mist likely need to reboot the box. Why do people believe that patching the kernel is easier than updating userspace?The kernel is the core of the system; Linux isn't Linux without the Linux kernel. If I make a game input library and try to get people to use it, there's a whole chicken-and-egg problem of getting developers to support something nobody has installed, and getting users to install something no developers support. I have to convince the distros to pick it up, and to keep updating it. I have to monitor changes in the kernel codebase to see if the library needs updating. I have to deal with the possibility that the library becomes a useful bandaid, with people saying "meh, this is a hard problem, punt the fix to the library". I have to hope that telling players to install another dependency isn't going to lose me customers.
Until you get a traction with the new you might need to distribute it with your game. Another option would be to extend already established library, such as SDL, with the required functionality.
The kernel has authority that a library does not, and it has a
distribution mechanism that a library does not. The kernel is
effectively the source of the data; all I can do outside of that is
provide a filter and hope people use it.No, I do not think so. Kernel provides a level of abstraction, but so does X, ALSA, given desktop environment and so forth. If a task does not require hardware access (and translating input events form one type to another does not) one should think really hard whether it should be done in kernel. Thanks. -- Dmitry