Skip to content

cellPad: Disconnect and reconnect the controller when the device type is changed#16596

Merged
Megamouse merged 2 commits into
RPCS3:masterfrom
sanjay900:support-device-change
Jan 23, 2025
Merged

cellPad: Disconnect and reconnect the controller when the device type is changed#16596
Megamouse merged 2 commits into
RPCS3:masterfrom
sanjay900:support-device-change

Conversation

@sanjay900

@sanjay900 sanjay900 commented Jan 22, 2025

Copy link
Copy Markdown
Contributor

Games expect a disconnection and reconnection when a controllers device type changes, since normally that would require physically unplugging the controller and swapping it for a new one.

Ive made it so that if the device class, vid or pid changes, then a timer is started and the controllers is disconnected until the timer expires, to simulate the controller being disconnected.

@sanjay900 sanjay900 changed the title pad: Send disconnection notification if pad class changes pad: Send disconnection notification if a pads class changes Jan 22, 2025
@sanjay900 sanjay900 force-pushed the support-device-change branch from b653948 to 9e29ef5 Compare January 22, 2025 07:32
@Megamouse Megamouse self-requested a review January 22, 2025 07:45
@sanjay900 sanjay900 force-pushed the support-device-change branch from 9e29ef5 to f8bc539 Compare January 22, 2025 08:39
@sanjay900 sanjay900 changed the title pad: Send disconnection notification if a pads class changes cellPad: always forward state changes so that other state changes are handled besides connection status Jan 22, 2025
@sanjay900 sanjay900 changed the title cellPad: always forward state changes so that other state changes are handled besides connection status cellPad: Update reported_info for more than just connection status Jan 22, 2025
@sanjay900 sanjay900 marked this pull request as draft January 22, 2025 10:25
@sanjay900 sanjay900 force-pushed the support-device-change branch from f8bc539 to 153b014 Compare January 22, 2025 10:30
@sanjay900 sanjay900 changed the title cellPad: Update reported_info for more than just connection status cellPad: Send disconnection notification when swapping device class Jan 22, 2025
@sanjay900 sanjay900 marked this pull request as ready for review January 22, 2025 10:30
@sanjay900 sanjay900 marked this pull request as draft January 22, 2025 10:41
@sanjay900 sanjay900 force-pushed the support-device-change branch from 153b014 to 4fce44f Compare January 22, 2025 10:52
Comment thread rpcs3/Input/pad_thread.cpp Outdated
@sanjay900 sanjay900 force-pushed the support-device-change branch 3 times, most recently from fafe249 to aed2639 Compare January 22, 2025 21:06
@sanjay900 sanjay900 changed the title cellPad: Send disconnection notification when swapping device class cellPad: Disconnect and reconnect the controller when the device class is changed Jan 22, 2025
@sanjay900 sanjay900 force-pushed the support-device-change branch from aed2639 to dbb4942 Compare January 22, 2025 21:21
@sanjay900 sanjay900 changed the title cellPad: Disconnect and reconnect the controller when the device class is changed cellPad: Disconnect and reconnect the controller when the device type is changed Jan 22, 2025
@sanjay900 sanjay900 marked this pull request as ready for review January 22, 2025 21:22
Comment thread rpcs3/Input/pad_thread.cpp Outdated
Comment thread rpcs3/Input/pad_thread.cpp Outdated
@sanjay900 sanjay900 force-pushed the support-device-change branch from e1ad584 to 9072a03 Compare January 22, 2025 22:21
@Megamouse Megamouse merged commit fd66b6b into RPCS3:master Jan 23, 2025
@digant73

digant73 commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

@sanjay900 it could be nice if you could have a look to this bug #14063 (or #16445 reporting easy steps to reproduce the issue) related to RPCS3 crash after some time the pad is disconnected (e.g. for inactivity). Maybe it is also a bug on RPCS3 that could be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants