You are not logged in.

#1 2024-09-12 19:55:01

zaxdan69
Member
Registered: 2016-06-04
Posts: 296

Issue using xboxdrv to mimic xpad

I have 2 controllers which I want to mimic xpad, so to recognized as xbox gamepads. The newer has xinput/dinput modes, but it doesn't recognized as xbox gamepad on archlinux while it does in windows(this is another issue and I've read the wiki but seems that doesn't support from xpad, xpadneo, xone).
So, I'm using xboxdrv for both. I've already created 1 config file for each, and a script for enable/disable the xbox mode:

#!/bin/bash

if ( pgrep -x xboxdrv ); then
	notify-send "Η εξομοίωση του χειριστηρίου σε Χbox360 απενεργοποιήθηκε !" -t 5000
	pkill -9 "xboxdrv"
	
else
	notify-send "Έναρξη εξομοίωσης του χειριστηρίου σε Xbox360 διάταξη!" -t 5000
	xboxdrv --id 1  --config /media/gamedisk/xboxdrv-config/xboxdrv_sg_mora3.ini &
	xboxdrv --id 2 --alt-config /media/gamedisk/xboxdrv-config/xboxdrv_thrustmaster-t-mini.ini 
fi

This script works and creates 2 virtual input devices. The problem is that if I disconnect the device then doesn't work until I re-run the script.
So I'm trying to use the xboxdrv's daemon mode to bypass this problem, but with this, while the devices created again, none of them works(I'm using evtest for testing).
Here is the xboxdrv.service:

[Unit]
Description=Xbox controller driver daemon
Documentation=man:xboxdrv(1)

[Service]
Type=forking
User=root
PIDFile=/var/run/xboxdrv.pid
ExecStart=/usr/bin/xboxdrv --daemon --detach \
--pid-file /var/run/xboxdrv.pid --config /media/gamedisk/xboxdrv-config/xboxdrv_sg_mora3.ini \
--next-controller \
--alt-config /media/gamedisk/xboxdrv-config/xboxdrv_thrustmaster-t-mini.ini \
--detach-kernel-driver

[Install]
WantedBy=multi-user.target

I also have blacklisted the xpad driver.
What am I doing wrong?

Last edited by zaxdan69 (2024-09-12 19:56:12)

Offline

#2 2024-09-14 02:42:55

Julia
Member
From: Belgium
Registered: 2024-09-14
Posts: 11

Re: Issue using xboxdrv to mimic xpad

xboxdrv is obsolete as a driver AFAIK.  The kernel supports most controllers out of the box these days.  Install the package antimicrox and see if you can set them up with that.
https://archlinux.org/packages/extra/x86_64/antimicrox/


if [[ $yourProblem = "fixed" ]] ;then
    sed -i 's/Title/[SOLVED] Title/g' your.thread | please --thank-you
fi

Offline

#3 2024-09-14 06:19:43

zaxdan69
Member
Registered: 2016-06-04
Posts: 296

Re: Issue using xboxdrv to mimic xpad

I know about that, but it doesn't work with my controllers, so I need xboxdrv to mimic xpad. With xboxdrv I get the best results so far. I already have configure them and use xboxdrv with a script. I just needed to solve the problem of the need to re-run it every time a controller disconnects. For this I'm trying to use xboxdrv as daemon. Antimicrox is for  mapping keyboard/mouse to gamepad.

Last edited by zaxdan69 (2024-09-14 09:31:53)

Offline

#4 2024-09-14 15:30:47

Julia
Member
From: Belgium
Registered: 2024-09-14
Posts: 11

Re: Issue using xboxdrv to mimic xpad

I see.
Have you tried using "--controller-slot 0" before "--config"?

Controller slots are used when running xboxdrv in daemon mode. Each slot represents a complete controller configuration. If you want to use multiple controller in daemon mode you have to supply multiple controller slots.

--controller-slot N
    Switches to the controller slot with the number N, numbering starts at zero.
--next-controller
    Switches to the next controller slot.


if [[ $yourProblem = "fixed" ]] ;then
    sed -i 's/Title/[SOLVED] Title/g' your.thread | please --thank-you
fi

Offline

#5 2024-09-15 17:45:28

zaxdan69
Member
Registered: 2016-06-04
Posts: 296

Re: Issue using xboxdrv to mimic xpad

Yes I did and it didn't make any difference. I don't think that the problem is the command I use because I can see that the virtual devices for both the controllers created. The problem is that none of the controllers work when I test any of those virtual devices. So maybe the way the command starts through the daemon and systemd causes some kind of perimission problem?

Last edited by zaxdan69 (2024-09-15 17:50:08)

Offline

Board footer

Powered by FluxBB