Wednesday, December 20, 2006

Logitech Joystick - Framerate Fix

I found the reason for frame-rate loss for Logitech sticks...everything in this entry is Mac specific.

X-Plane has (for a long time) done a rather poor job of parsing the HID descriptors that
the driver provides for USB joysticks on OS X. However it turns out that in the case of Logitech, after we found the 4 axes the joystick usually has (pitch, roll, yaw and throttle) we then went on to misparse a bunch of strange stuff at the end of the stick as more axes. It turns out that reading those axes causing some kind of huge framerate loss. I don't fully understand this, but given the HID spec I've seen I'm not hugely surprised.

Why is this x86-Mac specific? I don't know! Why is this so much worse in 860? Well, in 860 we raised the number of axes from 6 to 8. With more axis slots, we tried to read more incorrect parts of the logitech stick, for more fps loss.

The solution is one that's been a long time coming: I've rewritten a bit of our Mac HID-parsing code to do a better job of figuring out what's a joystick element and what's not.

The bad news is: for the next few betas there may be some broken joysticks. If you have a joystick and it stops working in the next beta, please file a bug and include as much specific info about your joystick as you can.

The good news is: I think we will get almost all of the fps back on x86 Macs - Logitech users will not need to get new sticks.

A side effect is that we should no longer have "dead" slots - that is, buttons and axes that didn't do anything. This should allow you to use more of your X-52 if you have one.


Anonymous said...

Great news!! Now maybe I can take full advantage of the hat switch and rocker switch on the right side of my CH USB Yoke!!

Benjamin Supnik said...

You might get back more switches, but perhaps not - X52 users have reported that they still can't use the main hatswitch, so really it depends on the particular quirks of the joystick.

Anonymous said...

Hi Ben,

sorry in advance for the off topic comment. I have GREAT framerates back with the latest 8.60b6, but please, please, please, try to convince Austin to add (even hidden in .prf files) an FPS limiter: the current huge FPS and time ratio variations (depending on instantaneous rendering load) destroy the smoothness of the sim. I'd rather get steady 36FPS than higher but erratic FPS.

Thanks for listening, and again sorry for the OT.


Anonymous said...

Is it possible this may fix the problem with USB Overdrive too?

Benjamin Supnik said...

USB overdrive - honestly I don't know...we don't support USB overdrive.