Thread (3 messages) 3 messages, 1 author, 2016-02-21

How to get the kernel to emulate force feedback events?

flat view

From: Manuel Reimer <hidden>
Date: 2016-02-20 19:28:48

Hello,

if I plug my Xbox 360 controller and run fftest on it, then the following force feedback modes are listed as supported:

| Force feedback effects types: Periodic, Rumble, Gain,
| Force feedback periodic effects: Square, Triangle, Sine,

If I have a look at the driver itself, then it actually only supports FF_RUMBLE:

https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c#L1054
https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c#L966

So somewhere in the kernel source there has to be some kind of built-in force feedback effect emulation...

If I do the same in an uinput driver (only report "FF_RUMBLE" as being supported), then fftest only shows this one effect to be supported by the device. The "kernel side emulation" does not kick in...

The kernel documentation (https://www.kernel.org/doc/Documentation/input/ff.txt) says:

| Note: In most cases you should use FF_PERIODIC instead of FF_RUMBLE.
|       All devices that support FF_RUMBLE support FF_PERIODIC (square,
|       triangle, sine) and the other way around.

But what could be the mistake, which allowed me to create a device driver which actually only supports FF_RUMBLE? Are there any special driver parameters that have to be present, so the kernel side emulation gets active?

Thanks in advance.

Best regards,

Manuel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help