Differences between revisions 24 and 25
Revision 24 as of 2021-12-01 10:26:33
Size: 4795
Comment: make translation header easy to include in translated pages
Revision 25 as of 2023-07-30 21:38:16
Size: 6758
Editor: ccts
Comment: xboxdrv, antimicrox
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
Line 18: Line 19:
Line 19: Line 21:
Line 22: Line 25:
connected gamepads and calibrate them. The process in the KDE Plasma desktop
is documented here but the instructions are near-universally applicable.
connected gamepads and calibrate them.
Line 26: Line 28:

The process in the KDE Plasma desktop is documented here but the instructions are near-universally applicable.

Line 38: Line 44:
There are many useful games in the Debian repositories
for verifying that your gamepad works as expected, but
DebianPkg:supertuxkart is especially recommended due to its
fantastic gamepad support.

There are many useful games in the Debian repositories for verifying that your gamepad works as expected, but DebianPkg:supertuxkart is especially recommended due to its fantastic gamepad support.

Within a terminal, you can also monitor input device events, either with the joystick API (older) or the evdev API (newer).

 - DebianPackage:joystick provides `jstest`, which will help you monitor /dev/input/js* (older API).

 - DebianPackage:evtest provides the evtest command, which will help you detect your pads device label names, and listen to their events.
Line 46: Line 57:
Line 54: Line 66:
Line 79: Line 92:

=== Xbox One over Bluetooth ===
Line 99: Line 114:

=== Uncommon gamepads with specific game engines ===

It can happen although your gamepad works fine with most native linux games, it might not work on some others. This issue mostly happens with proprietary game engines (like Unity3D using the Rewired API).
Some games might check if your gamepad is amongst the most common ones, in order to automatically map the buttons with actions, but might not allow you to reconfigure the mapping or have bugs with less common gamepads.

DebianPackage:xboxdrv is a userspace gamepad driver which can emulate an Xbox controller, from any gamepad (provided it has enough buttons for your need).

Here is an example which maps a Logitech Rumblepad 2 to look like an Xbox controller:

{{{
xboxdrv --evdev /dev/input/by-id/usb-Logitech_Logitech_RumblePad_2_USB-event-joystick \
        --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y,ABS_Z=y2,ABS_RZ=x2 \
        --evdev-keymap BTN_THUMB=a,BTN_THUMB2=b,BTN_TRIGGER=y,BTN_TOP=x,BTN_TOP2=lb,BTN_PINKIE=rb,BTN_BASE=lt,BTN_BASE2=rt,BTN_BASE3=Back,BTN_BASE4=Start \
        --axismap -Y1=Y1,-Y2=Y2 \
        --mimic-xpad
}}}

See `xboxdrv --help` or the manpage, and more specifically `xboxdrv --help-*` (or `xboxdrv --help-all`) for lists of possible mappings.

=== Map gamepad to keyboard keys ===

DebianPackage:antimicrox is another approach which helps you translate gamepad events to keyboard keys, which might be useful when your game doesn't support your gamepad at all but is keyboard playable.



Translation(s): English - Italiano - Português (Brasil)

(!) ?Discussion


http://www.debian.org/logos/openlogo-nd-50.png http://www.debian.org/Pics/debian.png

Portal/IDB/logo_portal.png Welcome to the Debian gamepad portal!


Portal/IDB/icon-game-32x32.pngThis article talks about gamepad installation and setup. The two stages of configuration are often driver installation, and device configuration. Many devices have support integrated into the kernel and will work as soon as they're plugged in. Others can be more difficult.


Generic configuration

Given that the majority of devices have their necessary drivers built-in, the only thing most people might need to do is calibrate their controller afterwards. Many desktops have built-in configuration modules to select any connected gamepads and calibrate them.

KDE

The process in the KDE Plasma desktop is documented here but the instructions are near-universally applicable.

  • Open Application Launcher > Search > Game Controller

or

  • Open Application Launcher > System Settings > Input Devices > Game Controller

  • Select your gamepad in the "Device" drop-down box
  • Hit the "Calibrate" button in the bottom-left and follow the on-screen instructions

KDE_Gamepad_Configuration.png


Testing

There are many useful games in the Debian repositories for verifying that your gamepad works as expected, but supertuxkart is especially recommended due to its fantastic gamepad support.

Within a terminal, you can also monitor input device events, either with the joystick API (older) or the evdev API (newer).

  • - joystick provides jstest, which will help you monitor /dev/input/js* (older API).

    - evtest provides the evtest command, which will help you detect your pads device label names, and listen to their events.


Specific devices

Xbox and PlayStation controllers

Xbox, Xbox 360, and Xbox One controllers, including many knock-offs, should work out-of-the-box with no issues. This includes both wired and wireless variants, whether by using official wireless receivers or through Bluetooth. This also applies for the DualShock 3 and DualShock 4 controllers commonly used by the PlayStation consoles.

In December 2020, Sony published an official Linux driver for the "DualSense" controller that comes with the PlayStation 5 that should bring its support up to parity with previous Sony controllers, but the patchset remains under review.

Steam Controller

Support for the Steam Controller is provided through the steam-devices package. By default, it works in "desktop mode" where it emulates mouse input. It will act as a proper controller only for games launched through Steam.

There's a project developing a user-mode driver for the Steam Controller that allows it to emulate an Xbox controller in any game without need for the proprietary Steam client. It is not officially supported in Debian however, and it will require extra configuration of its own: https://github.com/kozec/sc-controller

Nintendo Switch Pro Controller

While support is not integrated into Debian yet, Steam implements its own driver, with udev rules available in the non-free steam-devices package. Patches to the kernel for a generic Nintendo driver are set to be included in Linux 5.16, and the driver will likely become available in Debian 12/Bookworm.


Troubleshooting

Xbox One over Bluetooth

If you struggle with connecting an Xbox One controller over Bluetooth, it may fix it to disable ERTM. This can be done once by running:

# echo 1 > /sys/module/bluetooth/parameters/disable_ertm

If this fixes it, you may want to set this permanently so it isn't reversed on reboot. To do this, create a new file using Nano (or your preferred editor):

# nano /etc/modprobe.d/bluetooth.conf

And add a single line to the new file:

options bluetooth disable_ertm=Y

Note that ERTM is seldom used by any non-controller devices and it should not interfere with any other normal Bluetooth functionality to disable it. But if you do happen to run into issues with other Bluetooth devices after making this change, it may be helpful to try reverting it.

Uncommon gamepads with specific game engines

It can happen although your gamepad works fine with most native linux games, it might not work on some others. This issue mostly happens with proprietary game engines (like Unity3D using the Rewired API). Some games might check if your gamepad is amongst the most common ones, in order to automatically map the buttons with actions, but might not allow you to reconfigure the mapping or have bugs with less common gamepads.

xboxdrv is a userspace gamepad driver which can emulate an Xbox controller, from any gamepad (provided it has enough buttons for your need).

Here is an example which maps a Logitech Rumblepad 2 to look like an Xbox controller:

xboxdrv --evdev /dev/input/by-id/usb-Logitech_Logitech_RumblePad_2_USB-event-joystick \
        --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y,ABS_Z=y2,ABS_RZ=x2 \
        --evdev-keymap BTN_THUMB=a,BTN_THUMB2=b,BTN_TRIGGER=y,BTN_TOP=x,BTN_TOP2=lb,BTN_PINKIE=rb,BTN_BASE=lt,BTN_BASE2=rt,BTN_BASE3=Back,BTN_BASE4=Start \
        --axismap -Y1=Y1,-Y2=Y2 \
        --mimic-xpad

See xboxdrv --help or the manpage, and more specifically xboxdrv --help-* (or xboxdrv --help-all) for lists of possible mappings.

Map gamepad to keyboard keys

antimicrox is another approach which helps you translate gamepad events to keyboard keys, which might be useful when your game doesn't support your gamepad at all but is keyboard playable.


CategoryPortal | CategoryHardware | CategoryGamepad