Thread (18 messages) 18 messages, 5 authors, 2011-06-08

Re: Linux Force Feedback for Saitek Cyborg Evo Force

From: Johannes Ebke <hidden>
Date: 2009-12-19 23:36:26

Possibly related (same subject, not in this thread)

Hi,

It seems that the force feedback works well, I have ported the force
feedback for my favorite game to linux now, and it works well.

What does not work is updating effects - there just nothing happens, and
the old event is played. I have circumvented this by
deleting/re-uploading the effect, but this should probably been made to
work. Does it work well with other hardware?

Thirdly, I have re-discovered one kernel oops that occurs if the
joystick is unplugged if some process still has the event device open.
Steps to reproduce:
* plug joystick in
* fftest /dev/input/eventXX
* unplug joystick

(kern.log extract attached)

Sometimes this just gives an oops, sometimes it escalates into a kernel
panic.

Finally, attached is the most recent patch (saitek-v2.patch):
* handling of 0x06 (saitek?) message format for axis/button data
* Saitek Cyborg Evo Force button+axis definitions and table entry
* Changes axis limits if hardware is from Saitek
* Added has_btndead to iforce_device + table entries
* Only add BTN_DEAD if iforce device has_btndead
(since my joystick does not have a physical dead switch)

The patch is against 2.6.32 from kernel.org.

Cheers,
Johannes

Dmitry Torokhov wrote:
On Fri, Dec 18, 2009 at 11:52:32AM +0100, Jiri Kosina wrote:
quoted
On Fri, 18 Dec 2009, Johannes Ebke wrote:
quoted
I have looked into the problems some more, and have found that the cause 
of the crash was a change I made because I misunderstood the code 
(LO(cmd) is the number of bytes in in the message, and is not 
transferred on USB - i had removed it from the message...)
Ah, good, thanks.
quoted
First, the changes in the normal input, the joystick axis+buttons message:
* Prefix is 0x06 instead of 0x01 (joystick) or 0x03 (gamepad)
* Throttle is not inverted (data[4] instead of 255-data[4])
* Rudder is present and unsigned (not signed, as in iforce)

I have attached a patch that I think fixes this (it works for me :) 
Since saitek uses a different protocol byte, this can be done without 
adding per-device flags to the driver.

It also adds a button map btn_saitek_cyborg that switches button 1&2 to
make the button number the same as printed on the device, and
abs_saitek_cyborg for a joystick with rudder but only one hat.

The fftest effects seem to work, but some are feeble and feel strange -
I suspect there are some subtle changes, for example I am quite sure
that the Saitek uses signed (twos complement) numbers for effect
strength (this could perhaps explain the 'strange' behavior for 0x80
byte values in the current code)...
The changes look really minimal to me, so I'd propose just to add a few 
special cases to the iforce driver itself (probably by setting/checking 
some per-device flag where needed), rather than copy/pasting the whole 
iforce driver.

But the ultimate decision is on Dmitry (CCed) here.
Right, so far I have not seen anythig that would warrant creating a
separate driver, adjusting the current one is the way to go.

Attachments

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