Xbox 360 controller doesn't work correctly

My Xbox 360 controller works on emulators, but not fully on Epic store (with Lutris or Bottles).
For example, A and B buttons work, but not D-pad and analogics sticks.
I don’t understand the problem, it looks like my controller is not well mapped.

I added this to my confiuration:

boot.initrd.kernelModules = [ “usbhid” “joydev” “xpad” ];

They seem correctly loaded:

eyome@nixos:~]$ lsmod
Module                  Size  Used by
qrtr                   49152  4
ccm                    20480  6
rfcomm                 94208  16
snd_seq_dummy          16384  0
snd_hrtimer            16384  1
snd_seq                90112  7 snd_seq_dummy
snd_seq_device         16384  1 snd_seq
af_packet              57344  8
cmac                   16384  3
algif_hash             16384  1
algif_skcipher         16384  1
af_alg                 32768  6 algif_hash,algif_skcipher
bnep                   24576  2
ip6_tables             36864  2
xt_conntrack           16384  2
ip6t_rpfilter          16384  1
ipt_rpfilter           16384  1
xt_pkttype             16384  2
xt_LOG                 20480  2
nf_log_syslog          20480  2
xt_tcpudp              20480  0
nft_compat             20480  11
msr                    16384  0
snd_ctl_led            24576  0
nf_tables             282624  149 nft_compat
snd_hda_codec_realtek   172032  1
snd_hda_codec_generic    98304  1 snd_hda_codec_realtek
nfnetlink              20480  2 nft_compat,nf_tables
sch_fq_codel           20480  2
sd_mod                 57344  0
hid_logitech_hidpp     53248  0
mousedev               24576  0
snd_sof_pci_intel_cnl    16384  0
snd_sof_intel_hda_common   188416  1 snd_sof_pci_intel_cnl
snd_soc_hdac_hda       24576  1 snd_sof_intel_hda_common
soundwire_intel        49152  1 snd_sof_intel_hda_common
soundwire_generic_allocation    16384  1 soundwire_intel
soundwire_cadence      36864  1 soundwire_intel
snd_sof_intel_hda      20480  1 snd_sof_intel_hda_common
snd_sof_pci            24576  2 snd_sof_intel_hda_common,snd_sof_pci_intel_cnl
snd_sof_xtensa_dsp     16384  1 snd_sof_intel_hda_common
snd_sof               270336  2 snd_sof_pci,snd_sof_intel_hda_common
snd_sof_utils          20480  1 snd_sof
rmi_smbus              16384  0
rmi_core               61440  1 rmi_smbus
soundwire_bus          98304  3 soundwire_intel,soundwire_generic_allocation,soundwire_cadence
snd_soc_skl           180224  0
cmdlinepart            16384  0
snd_soc_sst_ipc        20480  1 snd_soc_skl
spi_nor               114688  0
snd_soc_sst_dsp        40960  1 snd_soc_skl
iTCO_wdt               16384  0
think_lmi              36864  0
mei_hdcp               24576  0
8250_dw                24576  0
mei_pxp                20480  0
i2c_designware_platform    16384  0
snd_hda_ext_core       36864  3 snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl
firmware_attributes_class    16384  1 think_lmi
mtd                    86016  3 spi_nor,cmdlinepart
i2c_designware_core    36864  1 i2c_designware_platform
i915                 3043328  81
ee1004                 20480  0
intel_wmi_thunderbolt    20480  0
snd_soc_acpi_intel_match    73728  3 snd_sof_intel_hda_common,snd_soc_skl,snd_sof_pci_intel_cnl
intel_pmc_bxt          16384  1 iTCO_wdt
snd_soc_acpi           16384  3 snd_soc_acpi_intel_match,snd_sof_intel_hda_common,snd_soc_skl
intel_rapl_msr         20480  0
wmi_bmof               16384  0
watchdog               32768  1 iTCO_wdt
intel_tcc_cooling      16384  0
x86_pkg_temp_thermal    20480  0
snd_soc_core          352256  5 soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl
intel_powerclamp       20480  0
iwlmvm                442368  0
uvcvideo              131072  4
coretemp               20480  0
crc32_pclmul           16384  0
hid_logitech_dj        28672  0
btusb                  69632  0
polyval_clmulni        16384  0
polyval_generic        16384  1 polyval_clmulni
snd_compress           28672  1 snd_soc_core
gf128mul               16384  1 polyval_generic
btrtl                  28672  1 btusb
ac97_bus               16384  1 snd_soc_core
ghash_clmulni_intel    16384  0
btbcm                  24576  1 btusb
videobuf2_vmalloc      20480  1 uvcvideo
snd_pcm_dmaengine      16384  1 snd_soc_core
mac80211             1097728  1 iwlmvm
sha512_ssse3           49152  0
btintel                45056  1 btusb
btmtk                  16384  1 btusb
sha512_generic         16384  1 sha512_ssse3
snd_hda_codec_hdmi     81920  2
videobuf2_memops       20480  1 videobuf2_vmalloc
aesni_intel           393216  8
uas                    32768  0
drm_buddy              20480  1 i915
videobuf2_v4l2         36864  1 uvcvideo
libarc4                16384  1 mac80211
crypto_simd            16384  1 aesni_intel
videobuf2_common       69632  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
bluetooth             913408  46 btrtl,btmtk,btintel,btbcm,bnep,btusb,rfcomm
snd_hda_intel          57344  2
ttm                    86016  1 i915
cryptd                 28672  3 crypto_simd,ghash_clmulni_intel
snd_intel_dspcfg       32768  4 snd_hda_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_skl
nls_iso8859_1          16384  1
nvidia_uvm           1417216  0
videodev              282624  5 videobuf2_v4l2,uvcvideo,videobuf2_common
nls_cp437              20480  1
snd_intel_sdw_acpi     20480  2 snd_sof_intel_hda_common,snd_intel_dspcfg
usb_storage            81920  1 uas
nvidia_drm             77824  2
drm_display_helper    172032  1 i915
vfat                   24576  1
rapl                   16384  0
tpm_crb                20480  0
fat                    90112  1 vfat
cec                    61440  1 i915
scsi_mod              274432  3 sd_mod,usb_storage,uas
mc                     73728  6 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common
thinkpad_acpi         135168  0
hid_generic            16384  0
snd_hda_codec         176128  7 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda,snd_soc_skl,snd_sof_intel_hda
ucsi_acpi              16384  0
nvidia_modeset       1282048  2 nvidia_drm
typec_ucsi             53248  1 ucsi_acpi
nvram                  16384  1 thinkpad_acpi
intel_gtt              24576  1 i915
ledtrig_audio          16384  3 snd_ctl_led,snd_hda_codec_generic,thinkpad_acpi
scsi_common            16384  3 scsi_mod,usb_storage,uas
ecdh_generic           16384  2 bluetooth
tpm_tis                16384  0
intel_cstate           20480  0
snd_hda_core          118784  10 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl,snd_sof_intel_hda
typec                  86016  1 typec_ucsi
iwlwifi               462848  1 iwlmvm
thunderbolt           372736  0
ecc                    40960  1 ecdh_generic
libaes                 16384  2 bluetooth,aesni_intel
intel_uncore          217088  0
psmouse               167936  0
roles                  16384  1 typec_ucsi
thermal                28672  0
platform_profile       16384  1 thinkpad_acpi
evdev                  28672  35
snd_hwdep              16384  1 snd_hda_codec
agpgart                45056  2 intel_gtt,ttm
tpm_tis_core           32768  1 tpm_tis
battery                28672  1 thinkpad_acpi
processor_thermal_device_pci_legacy    16384  0
ac                     20480  0
int3403_thermal        20480  0
drm_kms_helper        192512  3 drm_display_helper,nvidia_drm,i915
video                  65536  3 thinkpad_acpi,i915,nvidia_modeset
i2c_algo_bit           16384  1 i915
snd_pcm               155648  12 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_sof_utils,snd_soc_skl,snd_hda_core,snd_pcm_dmaengine
processor_thermal_device    20480  1 processor_thermal_device_pci_legacy
input_leds             16384  0
processor_thermal_rfim    16384  1 processor_thermal_device
processor_thermal_mbox    16384  2 processor_thermal_rfim,processor_thermal_device
mac_hid                16384  0
cfg80211             1126400  3 iwlmvm,iwlwifi,mac80211
fb_sys_fops            16384  1 drm_kms_helper
processor_thermal_rapl    20480  1 processor_thermal_device
intel_lpss_pci         28672  0
mei_me                 53248  2
intel_lpss             16384  1 intel_lpss_pci
snd_timer              49152  3 snd_seq,snd_hrtimer,snd_pcm
syscopyarea            16384  1 drm_kms_helper
intel_rapl_common      28672  2 intel_rapl_msr,processor_thermal_rapl
int3400_thermal        20480  0
e1000e                315392  0
sysfillrect            16384  1 drm_kms_helper
idma64                 20480  0
tiny_power_button      16384  0
intel_pmc_core         53248  0
sysimgblt              16384  1 drm_kms_helper
virt_dma               20480  1 idma64
wmi                    36864  4 video,intel_wmi_thunderbolt,wmi_bmof,think_lmi
mei                   159744  5 mei_hdcp,mei_pxp,mei_me
acpi_thermal_rel       16384  1 int3400_thermal
snd                   118784  21 snd_ctl_led,snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_sof,snd_timer,snd_compress,thinkpad_acpi,snd_soc_core,snd_pcm
i2c_i801               36864  0
spi_intel_pci          16384  0
int340x_thermal_zone    20480  2 int3403_thermal,processor_thermal_device
ptp                    36864  1 e1000e
spi_intel              28672  1 spi_intel_pci
rfkill                 32768  10 iwlmvm,bluetooth,thinkpad_acpi,cfg80211
mfd_core               20480  2 intel_pmc_bxt,intel_lpss
soundcore              16384  2 snd_ctl_led,snd
intel_pch_thermal      20480  0
i2c_smbus              20480  1 i2c_i801
intel_soc_dts_iosf     20480  1 processor_thermal_device_pci_legacy
pps_core               24576  1 ptp
acpi_pad               28672  0
button                 24576  0
serio_raw              20480  0
nvidia              55775232  115 nvidia_uvm,nvidia_modeset
nf_conntrack_sane      20480  0
nf_conntrack          172032  2 xt_conntrack,nf_conntrack_sane
nf_defrag_ipv6         24576  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
libcrc32c              16384  2 nf_conntrack,nf_tables
ctr                    16384  2
loop                   32768  0
cpufreq_powersave      20480  0
tun                    61440  0
tap                    28672  0
macvlan                28672  0
bridge                311296  0
stp                    16384  1 bridge
llc                    16384  2 bridge,stp
kvm_intel             380928  0
kvm                  1122304  1 kvm_intel
drm                   585728  19 drm_kms_helper,drm_display_helper,nvidia,drm_buddy,thinkpad_acpi,nvidia_drm,i915,ttm
irqbypass              16384  1 kvm
fuse                  155648  5
backlight              24576  6 video,drm_display_helper,thinkpad_acpi,i915,drm,nvidia_modeset
i2c_core              114688  15 i2c_designware_platform,videodev,i2c_designware_core,drm_kms_helper,i2c_algo_bit,rmi_smbus,drm_display_helper,ee1004,nvidia,i2c_smbus,thinkpad_acpi,i2c_i801,i915,psmouse,drm
deflate                16384  1
efi_pstore             16384  0
configfs               57344  1
efivarfs               24576  1
tpm                    94208  3 tpm_tis,tpm_crb,tpm_tis_core
rng_core               20480  1 tpm
dmi_sysfs              20480  0
ip_tables              36864  1
x_tables               53248  9 xt_conntrack,ip6t_rpfilter,nft_compat,xt_LOG,xt_tcpudp,ip6_tables,ipt_rpfilter,xt_pkttype,ip_tables
autofs4                53248  0
ext4                  958464  3
crc32c_generic         16384  0
crc16                  16384  2 bluetooth,ext4
mbcache                16384  1 ext4
jbd2                  163840  1 ext4
nvme                   53248  4
atkbd                  36864  0
xhci_pci               24576  0
libps2                 20480  2 atkbd,psmouse
xhci_pci_renesas       20480  1 xhci_pci
vivaldi_fmap           16384  1 atkbd
nvme_core             151552  5 nvme
xhci_hcd              315392  1 xhci_pci
t10_pi                 16384  2 sd_mod,nvme_core
crc32c_intel           24576  7
crc64_rocksoft         20480  1 t10_pi
crc64                  20480  1 crc64_rocksoft
crc_t10dif             20480  1 t10_pi
crct10dif_generic      16384  0
crct10dif_pclmul       16384  1
crct10dif_common       16384  3 crct10dif_generic,crc_t10dif,crct10dif_pclmul
i8042                  40960  0
rtc_cmos               28672  1
serio                  28672  8 rmi_core,serio_raw,atkbd,psmouse,i8042
dm_mod                155648  0
dax                    45056  1 dm_mod
xpad                   45056  0
ff_memless             20480  1 xpad
led_class              20480  5 snd_hda_codec_generic,input_leds,iwlmvm,xpad,thinkpad_acpi
joydev                 28672  0
usbhid                 65536  2 hid_logitech_dj,hid_logitech_hidpp
hid                   151552  4 usbhid,hid_generic,hid_logitech_dj,hid_logitech_hidpp
usbcore               339968  8 xhci_hcd,usbhid,xpad,usb_storage,uvcvideo,btusb,xhci_pci,uas
usb_common             16384  3 xhci_hcd,usbcore,uvcvideo

For Steam, I had to remap my controller with the Steam tool.
I should have done something wrong, or miss something…

1 Like

Ok, it’s weird…

I tried xboxdrv.

[eyome@nixos:~]$ sudo xboxdrv
[sudo] Mot de passe de eyome : 
xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmail.com> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain 
conditions; see the file COPYING for details. 

Controller:        Microsoft X-Box 360 pad
Vendor/Product:    045e:028e
USB Path:          001:003
Controller Type:   Xbox360

-- [ ERROR ] ------------------------------------------------------
 Error couldn't claim the USB interface: LIBUSB_ERROR_BUSY
Try to run 'rmmod xpad' and then xboxdrv again or start xboxdrv with the option --detach-kernel-driver.

So I removed “xpad”, build the new config, restart the PC and retest.
Same result:

[eyome@nixos:~]$ sudo xboxdrv
[sudo] Mot de passe de eyome : 
xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmail.com> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain 
conditions; see the file COPYING for details. 

Controller:        Microsoft X-Box 360 pad
Vendor/Product:    045e:028e
USB Path:          001:003
Controller Type:   Xbox360

-- [ ERROR ] ------------------------------------------------------
 Error couldn't claim the USB interface: LIBUSB_ERROR_BUSY
Try to run 'rmmod xpad' and then xboxdrv again or start xboxdrv with the option --detach-kernel-driver.

So I tried xboxdrv --detach-kernel-driver:

[eyome@nixos:~]$ sudo xboxdrv --detach-kernel-driver
xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmail.com> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain 
conditions; see the file COPYING for details. 

Controller:        Microsoft X-Box 360 pad
Vendor/Product:    045e:028e
USB Path:          001:003
Controller Type:   Xbox360

Your Xbox/Xbox360 controller should now be available as:
  /dev/input/js0
  /dev/input/event5

Press Ctrl-C to quit, use '--silent' to suppress the event output
X1: -3907 Y1:  2148  X2:  3744 Y2:  -546  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:1 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1: -4011 Y1:  2148  X2:  3744 Y2:  -546  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:1 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1: -3907 Y1:  2148  X2:  3848 Y2:  -437  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1: -4011 Y1:  2148  X2:  3848 Y2:  -546  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1: -3907 Y1:  2148  X2:  3848 Y2:  -546  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:1 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1: -3907 Y1:  2148  X2:  3848 Y2:  -437  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:1 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0

I tested “A” button here, and it works fine… (I still don’t get why it doesn’t work with xpad…)
BUT, It still don’t work on Lutris or Bottles :cry:

Following the good old Arch wiki:
https://wiki.archlinux.org/title/Gamepad#xboxdrv

It seems I need to start xboxdrv.service, maybe it is my problem?
I don’t see xboxdrv as option here: NixOS Search so how could I do?

Thank you!

Ok, some news.

I tried to restart from the beginning: no more ushid, joydev, xpad, xboxdrv, sc controller…
(Thank you Nixos, this configuration.nix file is great!)

I tried to play to one of my humble bundle games (“VVVVVV”) with Bottles with a fresh new bottles.
And my controller worked!
I tried to play to Never alone on Epic with Bottles on fresh new bottles, only “A” and"B" buttons worked, not d-pad nor analogic sticks.
I tried also to play to Never Alone on Lutris and Heroic launcher, and I have the same problem.
I really don’t understand where the problem is…