Dominor
2012-May-10 03:03 UTC
[Wine] Xbox 1 gamepad not detected with Star Trek Online game
Hello, I am having a problem with Star Trek Online game.
I am running this game on an Archlinux x86_64 system with wine 1.5.3.
Recently I decided to try playing this game with one of my old but still working
xbox 1 gamepads. For that purpose, I installed the xboxdrv (the userspace driver
for xbox 360 and 1 gamepads) and after running xboxdrv with the command xboxdrv
--silent --trigger-as-button, I started the game. The game has support for
joysticks (I made sure I enabled joystick support in the in-game options).
However, the game does not detect it, since it does not respond to any button
presses or axis movements from the gamepad.
When running the game from the terminal, this is the output I get with the
gamepad attached to the PC:
https://gist.github.com/2650513
I have tried running the game natively on Windows 7 and XP SP3 with the gamepad
attached and it is detected and runs as expected. Furthermore, by running STO
with apimonitor from http://www.rohitab.com/apimonitor in Windows, I was able to
determine that the game uses direct input 8, specifically the
IDirectInputDevice8 and IDirectInput8 interfaces, to detect and control the
system mouse and any attached joystick. It uses in particular the
IDirectInput8::EnumDevices to find any available joysticks.
In order to determine if this is an issue specific to this game running on Wine,
I tried using the gamepad with another game well supported by wine and which
also supports joysticks: Trackmania Nations Forever. This one detects the
gamepad as a joystick automatically and by adding +dinput to WINEDEBUG, I
noticed the following line on the output:
Code:
trace:dinput:IDirectInputWImpl_EnumDevices (this=0x12f718,0x0004
'DIDEVTYPE_JOYSTICK',0x8fc5a0,0x12238a0,0001).
After that, wine outputs successfull detection of the joystick:
Code:
trace:dinput:find_joydevs Found a joystick on /dev/input/event16: Xbox Gamepad
(userspace driver) ({9e573eda-7734-11d2-8d4a-23903fb6bdf7})
Next, I tried running STO on wine with WINEDEBUG="+dinput":
https://gist.github.com/2650716
and while the game detects and initializes the system mouse through dinput, it
seems to initialize the IDirectInput8 Interface, but it does not enumerate any
joystick unlike Trackmania.
So, in conclusion, STO clearly supports joysticks and detects my xbox 1 gamepad
as one in Windows. The gamepad is correctly detected and initialized by xboxdrv
and made available in /dev/input/js1 and /dev/input/event16. Another game on
wine detects and uses it correctly.
How can I make STO enumerate and use the gamepad as joystick in wine?
The game is freely available on http://www.startrekonline.com/download.
