libretro / libretro/RetroArch

Set All Controls: Analog L2/R2 issues for udev and linuxraw, but not sdl2

Open
#16,767 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

This bug is specific to controllers featuring analog (pressure-sensitive) L2/R2 triggers.

When mapping the L2/R2 buttons at a standard speed, the system erroneously registers them as double inputs. This malfunction appears to be related to the pressure sensitivity feature, causing a single press to be interpreted as two separate inputs.

Expected behavior
  • Gradual L2 press: Should register as a single L2 input
  • Gradual R2 press: Should register as a single R2 input

The current behavior deviates from this expected outcome, resulting in unintended double inputs for these trigger buttons.

Actual behavior

Flatpak 1.19.1 uses udev as controller driver by default, which is used in this example.

Fast pressing

When L2 and R2 are activated with extreme speed (using a quick finger-slapping motion), the system does not register double-clicking. This contrasts with the problematic behavior observed during normal-speed activation. However, the L2/R2 variables are set to digital (input_l2_btn, input_r2_btn) instead of analog (input_l2_axis, input_r2_axis) which is incorrect.

input_driver = "udev"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_vendor_id = "1356"
input_product_id = "3302"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_l3_axis = "11"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"

Issue: Pressing L2/R2 extremely quickly generates:

input_l2_btn = "6"
input_r2_btn = "7"

Expectation: Pressing L2/R2 extremely quickly should generate:

input_l2_axis = "+2"
input_r2_axis = "+5"
Normal pressing

Normal pressing speed is registered as slow pressing.

  • Normal speed pressing L2:
input_driver = "udev"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_vendor_id = "1356"
input_product_id = "3302"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_axis = "+2"
input_l3_btn = "11"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"

Issue: Pressing L2 ("slowly") generates:

input_l2_btn = "6"
input_r2_axis = "+2"

Expectation: Pressing L2 ("slowly") should only generate:

input_l2_axis = "+2"
  • Normal speed pressing L2:
input_driver = "udev"
input_device = "Sony Interactive Entertainment DualSense Wireless Controller"
input_vendor_id = "1356"
input_product_id = "3302"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_l3_axis = "+5"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"

Issue: Pressing R2 ("slowly") generates:

input_r2_btn = "7"
input_l3_axis = "+5"

Expectation: Pressing R2 ("slowly") should only generate:

input_r2_axis = "+5"
Steps to reproduce the bug
  • Settings -> Input -> RetroPad Binds -> Port 1 Controls -> Set All Controls
Version/Commit
  • RetroArch: 1.19.1 Flatpak
OS
  • Ubuntu MATE 22.04, Trisquel 11.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through Settings → Input → RetroPad Binds → Port 1 Controls → Set All Controls with an analog-trigger controller. Compare the udev and linuxraw mappings with sdl2, focusing on L2/R2 being reported as both button and axis inputs; done means each trigger is mapped only to its expected analog axis during normal and rapid presses.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
frontend, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.