libretro / libretro/RetroArch

"Mapped port" input discarded while corresponding controller is disconnected

Open
#12,741 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Given two controllers connected with the "dinput" input driver and "xinput" controller driver, both mapped to core port 1, when the primary controller (player 1) is disconnected, the secondary controller (player 2) is no longer functional until primary is reconnected. RetroArch confirms via OSD that secondary has been remapped as controller 1, but core receives no input data for port 1 until the original controller 1 is reconnected.

Using the dinput controller driver instead of xinput produces the expected result but precludes usage of the Guide button for RetroArch hotkeys, so I'm filing this issue to petition for a solution on xinput's side.

Expected behavior

With two controllers mapped to port 1, each should continue controlling port 1 even if the other is disconnected.

Actual behavior

Secondary controller no longer controls port 1 when primary controller is disconnected.

Steps to reproduce the bug
  1. Set dinput input driver and xinput controller driver
  2. Set player 2's "mapped port" to 1
  3. Turn on two controllers
  4. Launch a game
  5. Disconnect the controller that was connected first
  6. Observe that the controller connected second no longer works
Version/Commit
  • RetroArch: v1.9.7 (official)
Environment information
  • OS: Windows 10 Pro x64 20H1

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 disconnect and remapping sequence on Windows with the dinput input driver and xinput controller driver. Read the xinput controller-driver handling around controller disconnects and mapped ports, then verify that the remaining controller still delivers input to port 1 after the original controller is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.