Thread (4 messages) 4 messages, 3 authors, 2010-01-06

Re: Question: Formula Force GP (Force) Feedback

From: Peter <hidden>
Date: 2010-01-06 12:36:12

Hi,

my description wasn't that good indeed :)

I have an Logitech Formula Force GP and tried to get Force Feedback
working (to play LFS (www.lfs.net) via wine). The wheel is recognized
properly and as an input device there are no problems. Force Feedback
isn't working properly, tho. I looked around a bit and found hid-lgff.c,
which i have modified a bit to get an idea how the effects are
generated:

    case FF_CONSTANT:
        x = effect->u.ramp.start_level + 0x7f; /* 0x7f is center */
        y = effect->u.ramp.end_level   + 0x7f; /**/
        CLAMP(x);
        CLAMP(y);
        report->field[0]->value[0] = 0x51;
        report->field[0]->value[1] = 0x08;
        report->field[0]->value[2] = x;
        report->field[0]->value[3] = y;
        dbg_hid("(x, y)=(%04x, %04x)\n", x, y);
        usbhid_submit_report(hid, report, USB_DIR_OUT);
      printk(KERN_INFO "Forces: x=%d y=%d\n",
	report->field[0]->value[2], 
	report->field[0]->value[3]);
        break;

I guess i could have enabled debug somehow, but didn't know how to. It
did the trick for me anyway. 

The problem is, that somehow x and y only get values above 0x7f. So
(with a hacked wine, http://bugs.winehq.org/show_bug.cgi?id=9221) it
gives correct force strength, but only to the left. With ffcfstress
(modified for center position not moving) i get the same result, but its
a bit tricky to describe... right from center you have to push harder
the more you turn right (correct) and left from center you have to hold
to the right the more you turn left. In principle the same happens in
LFS.

it should be: <<<  <<  <  o  >  >>  >>>

it is:        >>>  >>  >  o  >  >>  >>>

effect->u.ramp.start_level and 
effect->u.ramp.end_level 
both seem to get ripped off their sign (+/-) somehow.

I'm running gentoo and thus a customized kernel (2.6.32-gentoo-r1). I'll
try a vanilla kernel soon, just to be sure.
If you need further info about my system or configuration, just ask.


Thx, Peter

attached:
modified hid-lgff.c from kernel,
modified effect_linuxinput.c from wine-1.1.35
modified ffcfstress.c from ff-utils

On Wed, 2010-01-06 at 11:43 +0100, Jiri Kosina wrote:
[ adding some more CCs ]

I haven't been really succesfull extracting the nature of the problem from 
the mail below. Could you please sum it up for the people who haven't seen 
the thread from the beginning?

Thanks.
  

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