Re: SDL's gamecontrollerdb.txt vs. kernel fixes

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

 



Hi Bastien,

On Tue, May 29, 2018 at 12:17 PM, Bastien Nocera <hadess@xxxxxxxxxx> wrote:
> Hey,
>
> Ethan recently posted a patch to SDL's GameControllersDB to fix up
> buttons on his GPDWin 2:
> https://twitter.com/flibitijibibo/status/1000835085891973127
>
> There are a couple of problems with this approach though:
> - it only works with SDL, not with any other possible users of the
> joystick API
> - the parsing code depends on the SDL library, again problematic for
> non-SDL programs
>
> There are advantages as well:
> - it's easy to write and test, there are test applications using SDL,
> and fixing the problem is as easy as sharing a single line to add to a
> file
> - the documentation is pretty good:
> https://github.com/gabomdq/SDL_GameControllerDB
> which is better than:
> https://www.kernel.org/doc/Documentation/input/joydev/joystick.rst
>
> Can we think of a way where writing and testing "fixups" is easy enough
> to do without having a kernel development tree ready, documentation
> would better explain the different cases for fixups, and everybody can
> benefit from having quirks written?

One thing that comes to my mind is that in evdev we have the ability
to remap a button/key from the userspace with an ioctl.
If it doesn't work for joysticks/gamepads, we should be able to have
an API that does it in the kernel and with a udev rule, or a hdwdb or
a udev intrinsic, we could just remap to the proper keys without
relying on an external lib.

Ideally, this should be carried (the hwdb / udev intrinsic) by SDL
developers so they can smoothly transition from their own file format
to a kernel fix.

OTOH, we had a somewhat similar issue with the Wacom devices. We ended
up having libwacom which provides a standalone library with those data
that any project can link against and use at will. So Maybe a solution
could be to ask the SDL devs to externalize this DB and have something
other projects can rely on.

You understand, I am not much in favor of fixing directly things in
the kernel, because you will end up breaking existing user configs,
for little benefits. I only agree with kernel fixes if the device
doesn't work or has missing features.

Cheers,
Benjamin
--
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