Closed Kzimir closed 1 year ago
Could you run evtest
with the ds4drv: It lists the name of the devices. I suspect that this game only looks for the name of a device to identify it.
# evtest
/dev/input/event12: Sony Computer Entertainment Wireless Controller
Do you run the game through Steam? If yes, please try disabling or enabling Steam Input for Xbox controllers (it can be switched in Big Picture mode, or per game individually). This may have an impact on how controllers are detected by games. Since it doesn't use an Xbox name for your Sony controller, my next best guess is that you have Playstation controller support enabled in Steam Input but you don't have for Xbox controllers.
Background: Steam Input is able to emulate any controller as Xbox360 pad for many games (but it adds input delay for some users, and it may mess up mappings with the xpadneo driver).
No, I don’t use Steam. I have the game from GoG. Steam is not installed on my system.
ds4drv use the PS4 pad but emulate a X360 gamepad. For others native/Wine games, if I use ds4drv it’s like i use a real XBox gamepad.
Okay, I've looked at the ds4 driver: It doesn't do anything specific to mimic a X360 pad, it's just a HID standard driver. So I suspect the culprit being somewhere at the upper layers.
Do you have anything in the $HOME/.local/share/gamecontrollerdb.local.txt
file?
Could you try running the game with SDL_JOYSTICK_HIDAPI=0
(environment setting)?
BTW: There seems to be some process stealing the device from us and exposing it via uinput:
[ 1756.090628] input: Xbox Wireless Controller as /devices/virtual/misc/uhid/0005:045E:0B13.000A/input/input33
Comes anything to mind you might be running that implements user space drivers for gamepads? ds4drv does that but it shouldn't act on this controller but maybe worth trying to stop it first.
Okay, I've looked at the ds4 driver: It doesn't do anything specific to mimic a X360 pad,
Ah wait, I found this:
create_mapping(
"xpad", "Microsoft X-Box 360 pad",
# Bus type, vendor, product, version
ecodes.BUS_USB, 1118, 654, 272,
# Axes
{
"ABS_X": "left_analog_x",
"ABS_Y": "left_analog_y",
"ABS_RX": "right_analog_x",
"ABS_RY": "right_analog_y",
"ABS_Z": "l2_analog",
"ABS_RZ": "r2_analog"
},
I'll look into it, possibly using the proper PID is what would work around your problem, or the name. Which emulation profile are you using? xpad or xpad_wireless?
Could you try this hack:
diff --git a/hid-xpadneo/src/hid-xpadneo.c b/hid-xpadneo/src/hid-xpadneo.c
index 8876cea..306bb8e 100644
--- a/hid-xpadneo/src/hid-xpadneo.c
+++ b/hid-xpadneo/src/hid-xpadneo.c
@@ -922,6 +922,9 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
break;
}
+ xdata->gamepad->id.product = 0x028E;
+ xdata->gamepad->id.version = 0x00000110;
+
if (hdev->product != xdata->gamepad->id.product)
hid_info(hdev,
"pretending XB1S Windows wireless mode "
You may also need to add
xdata->gamepad->id.bustype = BUS_USB;
but this may mess up the mapping of the thumb stick buttons and the Guide button.
You're right, add these three lines fix the issue but the mapping is completely broken. I compare with the Win version + Wine. Like i said, this hack is not needed but the mapping problem is the same.
I tried xpad_neo without the hack + SDL_JOYSTICK_HIDAPI=0
, without effect.
In my patch queue, I've added a module parameter xpad_emulation=1
which may fix this for you. To properly use that, use git remote add kakra https://github.com/kakra/xpadneo && git remote update
and checkout my queue branch. Do not clone that to a separate repository because it will break versioning. You may add a worktree, tho, after adding the remote: git worktree add ../xpadneo-kakra kakra/queue/for-0.10
should do the trick. But that's a rebase-branch, you cannot properly pull from it for future updates (use pull --rebase
instead).
very good job, the game recognize correctly the gamepad and the mapping is not broken :-)
I moved this to a pull request so you can better follow the updates or easily extract a patch for local package installation:
@Kzimir Can you retry with the latest version without applying the Xbox360 emulation hack? We changed some quirks and fixups which may affect how such games handle and detect the controller. If there's anything left not affecting "Divinity: Original Sin", please follow up in #283.
Closing as probably fixed in latest master.
Version of xpadneo
git version 58f234a
Describe the bug
My XBox Series gamepad works great with xpadneo module with Windows games + Wine. But with D:OS native linux game, it does not recognize the gamepad + bluetooth.
Steps to Reproduce
Pair and connect the gamepad, launch the game. Go to Options -> Game and you can see that the Controler option is grey.
Expected behavior
I hope something can be found^^
Screenshots/Gifs
"enable controler" = "activer la manette" in French![Capture d’écran de 2021-03-27 19-46-40](https://user-images.githubusercontent.com/3606036/112731038-3e86ea80-8f35-11eb-9ff0-e17c2703325a.png)
System information
Controller and Bluetooth information
xpadneo-btmon.txt
xpadneo-dmesg.txt
Bus 003 Device 003: ID 1358:c123 Realtek Bluetooth Radio
Additional context
I tried the game with his Windows version + Wine. The gamepad is correctly recognized.