We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1048 - Saitek ProFlight Rudder Pedals : modifications update only 2 axis while 3 axis are detected
Summary: Saitek ProFlight Rudder Pedals : modifications update only 2 axis while 3 axi...
Status: RESOLVED ENDOFLIFE
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 1.2.14
Hardware: x86 Windows (XP)
: P1 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-23 08:58 UTC by yasbow
Modified: 2015-08-25 09:38 UTC (History)
2 users (show)

See Also:


Attachments
Fix bug on Saitek rudder pedals (11.24 KB, application/octet-stream)
2010-08-23 08:58 UTC, yasbow
Details
Updated patch (1.08 KB, patch)
2014-12-12 02:59 UTC, Kerrigan Bangs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description yasbow 2010-08-23 08:58:56 UTC
Created attachment 536 [details]
Fix bug on Saitek rudder pedals

On Saitek ProFlight Rudder Pedals, there are 3 axis detected by SDL (left pedal, right pedal and rotation between the 2 pedals around Z axis). But when rudder is used, SDL updates only values for left and right pedals, rotation value is never changed. This behavior has been seen with SDL 1.2.14 on Windows XP SP 2.

This problem has already been noticed here :
http://www.orbiterwiki.org/wiki/FlyByWireEGCS#Saitek_Pro_Flight_Rudder_Pedals
http://www.orbiter-forum.com/showthread.php?t=10010

It is not a driver problem, because when I launch driver's test GUI, I can see that all movements are detected.

After some code analysis, I think that I find the problem : MS API sends updated values in JOYINFOEX structure as following (for this rudder device) :
dwXpos : left pedal
dwYpos : right pedal
dwZpos : nothing
dwRpos : pedals rotation
dwUpos : nothing
dwVpos : nothing

There are 3 values but the third one is not at the third position in this structure. So the code seems easy to fix in SDL_mmjoystick.c in SDL_SYS_JoystickUpdate(SDL_Joystick* joystick) function. I attach my own version of this file which has been successfully tested for this device and with some others (on Window XP only).

Hope this can help.
Comment 1 Jen Spradlin 2011-04-12 20:18:06 UTC
Thank you for your bug report!

We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible.
Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!
Comment 2 Ryan C. Gordon 2011-12-30 01:25:46 UTC
Bumping priority on a few bugs that I would like examined more closely before 1.2.15 is finalized. This is not a promise that a bug will be fixed. We may close it with WONTFIX or WORKSFORME or something, but I just want to make sure attention is paid.

--ryan.
Comment 3 Kerrigan Bangs 2014-12-12 02:59:45 UTC
Created attachment 1967 [details]
Updated patch

The original fix by the original reporter did not work for me. I made my own fix.
Comment 4 Kerrigan Bangs 2014-12-12 03:00:22 UTC
I know it's quite late but I know the precise cause of this problem:

The mmjoystick method is written with the assumption that all joystick axes are contiguous.

This is normally true, however apparently the Z axis is allowed to be skipped. (Source: http://msdn.microsoft.com/en-us/library/windows/hardware/ff543445%28v=vs.85%29.aspx at "No Holes" rule)

More recently this problem also affects the Saitek X55 joystick, as its rudder axis is not detected, since the joysticks skips the Throttle axis.

I have attached my own solution as the originally attached fix does not seem to work for me. Also, only the Z axis is allowed to be unmapped, so further checks afterward are not necessary assuming the axis count is correct.

Note that this problem is still present in SDL2, for the mmjoystick method. It doesn't happen in the DX Joystick method. Still, it's easy enough to fix anyways, I think.
Comment 5 Ryan C. Gordon 2015-08-25 09:38:23 UTC
Hello, and sorry if you're getting several copies of this message by email, since we are closing many bugs at once here.

We have decided to mark all SDL 1.2-related bugs as RESOLVED ENDOFLIFE, as we don't intend to work on SDL 1.2 any further, but didn't want to mark a large quantity of bugs as RESOLVED WONTFIX, to clearly show what was left unattended to and make it easily searchable.

Our current focus is on SDL 2.0.

If you are still having problems with an ENDOFLIFE bug, your absolute best option is to move your program to SDL2, as it will likely fix the problem by default, and give you access to modern platforms and tons of super-cool new features.

Failing that, we _will_ accept small patches to fix these issues, and put them in revision control, although we do not intend to do any further official 1.2 releases.

Failing that, please feel free to contact me directly by email (icculus@icculus.org) and we'll try to find some way to help you out of your situation.

Thank you,
--ryan.