http://bugs.winehq.org/show_bug.cgi?id=22059
Summary: when /dev/input/event* device is accessible, wine fails to consider calibration and correction factors of the linux joydev driver Product: Wine Version: 1.1.40 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dinput AssignedTo: wine-bugs@winehq.org ReportedBy: corvus-wine@cybertrench.com
Created an attachment (id=26862) --> (http://bugs.winehq.org/attachment.cgi?id=26862) joydev log with event file accessible
Linux provides the possibility to correct joystick raw values automatically when accessing /dev/input/js* devices, both autodetected/scaled and "hand-calibrated" with tools like "jscal"
if wine uses /dev/input/js* for joystick access, it also takes the correction factors into account, so a joystick that has been calibrated under linux, will be calibrated correctly under wine.
However if the /dev/input/event* file corresponding to the joystick device is accessible (at least for reading) wine seems to bypass the joydev driver and accesses the device on a lower (event) level, thus unaware of the calibration data and correction factors - whether manually set and autodetected!
As a result programs run under wine that use a joystick but offer no inbuilt calibration option (which is most, since under native win32 joysticks are calibrated system wide in the input device area of the control center) will behave strangely as joysticks are potentially off-centered - mis-scaled - axis flipped - or even unable to cross the zero position at all. Depending on the actual joystick hardware and the required corrections.
the attached log1.txt shows the output of a joystick using program (il2fb flightsim) started with dinput WINEDEBIUG output grep'd for "joydev" when the event device is accessible (and the joystick is unusable due to miscalibration
WINEDEBUG=+dinput wine il2fb.exe 2>&1 |grep joydev
log2.txt shows the same output with /dev/input/event5 (the joystick event device) chmodded to 000
in this case the axis and buttons are mapped completely different, but centered and scaled correctly (given that the jopystick had been calibrated under linux using jscal)
for obvious reasons this bug is only visible if the axis values reported by the event device, especially min and max: ...
cur=97, min=0, max=255, fuzz=0, flat=15
...
are not equal to the actually reachable minimum and maximum values. newer joysticks often autoscale in hard/firmware and actually reach those min/max values with little need for calibration, while some, especially older models, are in dire need of correction values since the actual range (as in this case) is more like 30 to 120