You are not logged in.

#1 2023-02-18 11:40:22

Shatur
Member
Registered: 2021-06-12
Posts: 3

Unable to setup daemon mode for xboxdrv

Hi! I have a controller that I successfully configured using xboxdrv. The following command works as expected:

xboxdrv --evdev /dev/input/by-path/platform-xhci-hcd.2.auto-usb-0:1:1.0-event-joystick --config ~/.config/xboxdrv/gamesir.conf

But I can't figure out how to run it in daemon mode. It starts, but the created virtual device from xboxdrv doesn't receive any input (I tested it with games and evtest). Here is how I run it:

xboxdrv --config ~/.config/xboxdrv/gamesir.conf --daemon --match vendor=3537,product=0101

I took vendor=3537,product=0101 from usb-devices:

T:  Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=03(HID  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=3537 ProdID=0101 Rev=01.00
S:  Manufacturer=GAMESIR
S:  Product=GameSir-X2 Pro-Xbox
S:  SerialNumber=001
C:  #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
I:  If#= 1 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=02(O) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=1ms

Also here is `udevadm info -a /dev/input/event6`:

  looking at device '/devices/platform/usb@fe800000/fe800000.usb/xhci-hcd.2.auto/usb5/5-1/5-1:1.0/0003:3537:0101.0023/input/input112/event6':
    KERNEL=="event6"
    SUBSYSTEM=="input"
    DRIVER==""
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/usb@fe800000/fe800000.usb/xhci-hcd.2.auto/usb5/5-1/5-1:1.0/0003:3537:0101.0023/input/input112':
    KERNELS=="input112"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{capabilities/abs}=="30627"
    ATTRS{capabilities/ev}=="10001b"
    ATTRS{capabilities/ff}=="0"
    ATTRS{capabilities/key}=="ffff000000000001 0 40000000 168000000000 0"
    ATTRS{capabilities/led}=="0"
    ATTRS{capabilities/msc}=="10"
    ATTRS{capabilities/rel}=="0"
    ATTRS{capabilities/snd}=="0"
    ATTRS{capabilities/sw}=="0"
    ATTRS{id/bustype}=="0003"
    ATTRS{id/product}=="0101"
    ATTRS{id/vendor}=="3537"
    ATTRS{id/version}=="0111"
    ATTRS{inhibited}=="0"
    ATTRS{name}=="GAMESIR GameSir-X2 Pro-Xbox"
    ATTRS{phys}=="usb-xhci-hcd.2.auto-1/input0"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{properties}=="0"
    ATTRS{uniq}=="001"

  looking at parent device '/devices/platform/usb@fe800000/fe800000.usb/xhci-hcd.2.auto/usb5/5-1/5-1:1.0/0003:3537:0101.0023':
    KERNELS=="0003:3537:0101.0023"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/usb@fe800000/fe800000.usb/xhci-hcd.2.auto/usb5/5-1/5-1:1.0':
    KERNELS=="5-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{bInterfaceSubClass}=="00"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/platform/usb@fe800000/fe800000.usb/xhci-hcd.2.auto/usb5/5-1':
    KERNELS=="5-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="03"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 2"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bmAttributes}=="c0"
    ATTRS{busnum}=="5"
    ATTRS{configuration}==""
    ATTRS{devnum}=="2"
    ATTRS{devpath}=="1"
    ATTRS{devspec}=="(null)"
    ATTRS{idProduct}=="0101"
    ATTRS{idVendor}=="3537"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="GAMESIR"
    ATTRS{maxchild}=="0"
    ATTRS{power/active_duration}=="250800"
    ATTRS{power/autosuspend}=="2"
    ATTRS{power/autosuspend_delay_ms}=="2000"
    ATTRS{power/connected_duration}=="250800"
    ATTRS{power/control}=="on"
    ATTRS{power/level}=="on"
    ATTRS{power/persist}=="1"
    ATTRS{power/runtime_active_time}=="250514"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{product}=="GameSir-X2 Pro-Xbox"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{remove}=="(not readable)"
    ATTRS{rx_lanes}=="1"
    ATTRS{serial}=="001"
    ATTRS{speed}=="12"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="23"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/usb@fe800000/fe800000.usb/xhci-hcd.2.auto/usb5':
    KERNELS=="usb5"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0601"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="5"
    ATTRS{configuration}==""
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{idProduct}=="0002"
    ATTRS{idVendor}=="1d6b"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 6.1.7-1-danctnix xhci-hcd"
    ATTRS{maxchild}=="1"
    ATTRS{power/active_duration}=="250944"
    ATTRS{power/autosuspend}=="0"
    ATTRS{power/autosuspend_delay_ms}=="0"
    ATTRS{power/connected_duration}=="257592"
    ATTRS{power/control}=="auto"
    ATTRS{power/level}=="auto"
    ATTRS{power/runtime_active_time}=="251414"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="6176"
    ATTRS{power/wakeup}=="disabled"
    ATTRS{power/wakeup_abort_count}==""
    ATTRS{power/wakeup_active}==""
    ATTRS{power/wakeup_active_count}==""
    ATTRS{power/wakeup_count}==""
    ATTRS{power/wakeup_expire_count}==""
    ATTRS{power/wakeup_last_time_ms}==""
    ATTRS{power/wakeup_max_time_ms}==""
    ATTRS{power/wakeup_prevent_sleep_time_ms}==""
    ATTRS{power/wakeup_total_time_ms}==""
    ATTRS{product}=="xHCI Host Controller"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{remove}=="(not readable)"
    ATTRS{rx_lanes}=="1"
    ATTRS{serial}=="xhci-hcd.2.auto"
    ATTRS{speed}=="480"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="82"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/usb@fe800000/fe800000.usb/xhci-hcd.2.auto':
    KERNELS=="xhci-hcd.2.auto"
    SUBSYSTEMS=="platform"
    DRIVERS=="xhci-hcd"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/control}=="on"
    ATTRS{power/runtime_active_time}=="257595"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{power/wakeup}=="disabled"
    ATTRS{power/wakeup_abort_count}==""
    ATTRS{power/wakeup_active}==""
    ATTRS{power/wakeup_active_count}==""
    ATTRS{power/wakeup_count}==""
    ATTRS{power/wakeup_expire_count}==""
    ATTRS{power/wakeup_last_time_ms}==""
    ATTRS{power/wakeup_max_time_ms}==""
    ATTRS{power/wakeup_prevent_sleep_time_ms}==""
    ATTRS{power/wakeup_total_time_ms}==""

  looking at parent device '/devices/platform/usb@fe800000/fe800000.usb':
    KERNELS=="fe800000.usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc3"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/autosuspend_delay_ms}=="5000"
    ATTRS{power/control}=="on"
    ATTRS{power/runtime_active_time}=="4453900"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/usb@fe800000':
    KERNELS=="usb@fe800000"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc3-of-simple"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="4454794"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

Last edited by Shatur (2023-02-18 11:44:12)

Offline

#2 2023-02-18 13:54:30

Shatur
Member
Registered: 2021-06-12
Posts: 3

Re: Unable to setup daemon mode for xboxdrv

Configured it with udev rules:

cat /etc/udev/rules.d/99-gamesir.rules
ACTION=="add", ATTRS{idVendor}=="3537", ATTRS{idProduct}=="0101", RUN+="/usr/bin/systemctl --no-block start gamesir"
ACTION=="remove", ATTRS{idVendor}=="3537", ATTRS{idProduct}=="0101", RUN+="/usr/bin/systemctl --no-block stop gamesir"

Where gamesir.service looks like this:

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

[Service]
Type=simple
ExecStart=/usr/bin/xboxdrv --evdev /dev/input/by-path/platform-xhci-hcd.2.auto-usb-0:1:1.0-event-joystick --config /etc/xboxdrv/gamesir.xboxdrv

[Install]
WantedBy=default.target

Looks like --daemon mode works only for xbox gamepads.

Offline

Board footer

Powered by FluxBB