Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix phantom configured controllers #3720

Merged
merged 1 commit into from Oct 16, 2022

Conversation

mageven
Copy link
Contributor

@mageven mageven commented Sep 22, 2022

ReloadConfiguration and RefreshInputConfigForHLE pass the unfiltered InputConfig down the chain even when the mapped host controller is invalid (missing, etc..). Bug probably introduced with #2194 and #2269.

Admittedly I don't understand Miria much, so I've opted for a shallow fix. Let me know if there's a better way or I missed something.

Enable guest controller only when a valid host controller is mapped.
@mageven
Copy link
Contributor Author

mageven commented Sep 23, 2022

Thinking about it more, this change is slightly wider reaching than I intended, although I think for the better.

Now physically connecting/disconnecting controllers will immediately reconfigure the assigned player on the guest side. So, essentially a "P2 has joined" when the corresponding controller for P2 is connected and vice versa. I think this flow is closer to how it works natively. Only difference being right now the player index is fixed (in the input settings) but on hardware it is dynamically assigned with help from controller applet.

A few users might be annoyed if their controller has connectivity issues (bad signal or flimsy USB connector), the game or controller applet will pester them to fix it. Before this PR, controller disconnects would be invisible to the game as the player is never removed. This would've resulted in lost inputs without any notice so I think it's better this way.

Note: This fix only effects emulation side. Ryu's input configuration is persistent (for other good reasons). The GUI will still show once-configured-but-now-disconnected controllers as "disabled", just with this PR it won't effect the guest. Not sure if there's an issue already open for UI inconsistency.

@MutantAura MutantAura added gui Related to Ryujinx.Ui fix Fix something input Related to Ryujinx.Input or Ryujinx.Input.SDL2 labels Sep 23, 2022
@MutantAura
Copy link
Collaborator

MutantAura commented Sep 23, 2022

By "phantom configured controllers" here does this fix the bug where the controller applet will pop-up seemingly with no controllers configured, or is this fixing the GUI bug where multiple of the same controller can sometimes appear in the dropdown? I think it's the former? I've added the GUI tag for now just to be safe.

@mageven
Copy link
Contributor Author

mageven commented Sep 24, 2022

I've not touched SDL2 controller detection or input configuration GUI so it's definitely not the latter. Also, I wasn't aware of multiple copies of a controller appearing. Is that not an SDL2 specific quirk? Not sure how to filter them out.

where the controller applet will pop-up seemingly with no controllers configured

As a side-effect, yes. Without this change, it could pop-up when the stale host controllers would still be mapped to players that the game doesn't like. Then the usual support advice given was to delete the entire config.json.

The title's "configured controllers" refers to log lines with the same name-

GUI.WindowThread Hid Configure: Configured Controller ProController to Player1
GUI.WindowThread Hid Configure: Configured Controller JoyconPair to Player2

@MutantAura MutantAura removed the gui Related to Ryujinx.Ui label Sep 24, 2022
Copy link
Member

@riperiperi riperiperi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one. I think the original service has all controllers attached, but then the controller applet decides which are actually "bound" via manual selection with L+R.

@marysaka marysaka merged commit 49eadbc into Ryujinx:master Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something input Related to Ryujinx.Input or Ryujinx.Input.SDL2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants