Daniel Remenak dtremenak@gmail.com writes:
- Configure checks for the availability of a new enough linux/input.h
to support force feedback. This pretty much means any kernel 2.6 or kernel 2.4.x with the ff patchset found at http://sourceforge.net/projects/libff/. Some of the structures were changed without changing the version define, so this check is necessary.
Why do you need to check the structure since you are not using it? Shouldn't you simply do a #ifdef on the ioctl code or whatever else that you use and may not be defined?
Executive summary: In order for effects to be played, the correct ff_effect structure will need to be present; if you can't play the effects it's better not to detect the joystick as FF, because it's really not.
The structure is not used *yet*, but will be. There was an older version of force feedback code before (in some of the stock 2.4 kernels) which had some of the same features (such as the EV_FF bit), but has incompatible structures, and afaik there were never any force feedback drivers written for it. The newer interface has working iForce (logitech, guillemot, et al) and MS sidewinder drivers written for it, so that's the one I was targetting. You can see them side by side if you have linux/input.h from an unpatched late 2.4 kernel and a 2.6 kernel.
E.g. from 2.4.29: struct ff_effect { __u16 type; __s16 id;
struct ff_trigger trigger; struct ff_replay replay;
union { struct ff_constant_effect constant; struct ff_periodic_effect periodic; struct ff_interactive_effect interactive; } u; };
and from 2.6.11: struct ff_effect { __u16 type; __s16 id; __u16 direction;
struct ff_trigger trigger; struct ff_replay replay;
union { struct ff_constant_effect constant; struct ff_ramp_effect ramp; struct ff_periodic_effect periodic; struct ff_condition_effect condition[2]; /* One for each axis */ struct ff_rumble_effect rumble; } u; };
Both versions have the same version define, but code for one will obviously not compile with the other. Testing for ff_effect.direction was the most direct way I could think of of differentiating the two. The code in FF #1 and #2 will theoretically work on either version, it's true...but detecting that a joystick has FF is not much use if you can't play any effects on it.
--Daniel Remenak
On 28 Jul 2005 12:56:19 +0200, Alexandre Julliard julliard@winehq.org wrote:
Daniel Remenak dtremenak@gmail.com writes:
- Configure checks for the availability of a new enough linux/input.h
to support force feedback. This pretty much means any kernel 2.6 or kernel 2.4.x with the ff patchset found at http://sourceforge.net/projects/libff/. Some of the structures were changed without changing the version define, so this check is necessary.
Why do you need to check the structure since you are not using it? Shouldn't you simply do a #ifdef on the ioctl code or whatever else that you use and may not be defined?
-- Alexandre Julliard julliard@winehq.org
Daniel Remenak dtremenak@gmail.com writes:
Executive summary: In order for effects to be played, the correct ff_effect structure will need to be present; if you can't play the effects it's better not to detect the joystick as FF, because it's really not.
Well, if the structure is required for the compile that's OK; but note that you still need to check for the proper features at run-time, just because the structure was present at compile time doesn't mean the kernel supports it, since you can build on 2.6 and then run on 2.4. Also please use the existing macros for checking structure fields.
Daniel Remenak wrote:
The newer interface has working iForce (logitech, guillemot, et al) and MS sidewinder drivers written for it, so that's the one I was targetting.
Well, if you mean the Sidewinder Force Feedback 2, that driver seems to be only a stub. I am currently working on a new PID FF driver (which will cover that Sidewinder).
Also I'm planning some kernel internal FF interface updates and probably introducing FF interface to /dev/input/jsX also.
Yes, I saw your (perhaps old) patch for adding FF support to joydev while I was doing some research before starting this project. I was under the impression that the current Sidewinder PID driver was working, though...a bit of poking at the code tells me I was pretty wrong :) I use a Wingman Force personally, so I hadn't done much looking at the PID side of things.
--Daniel Remenak
On 7/28/05, Anssi Hannula anssi.hannula@mbnet.fi wrote:
Daniel Remenak wrote:
The newer interface has working iForce (logitech, guillemot, et al) and MS sidewinder drivers written for it, so that's the one I was targetting.
Well, if you mean the Sidewinder Force Feedback 2, that driver seems to be only a stub. I am currently working on a new PID FF driver (which will cover that Sidewinder).
Also I'm planning some kernel internal FF interface updates and probably introducing FF interface to /dev/input/jsX also.
-- Anssi Hannula