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

Add a virtual controller to merge Joy-Cons. #434

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

madwind
Copy link

@madwind madwind commented Dec 23, 2024

No description provided.

@Daenorth
Copy link
Contributor

Done testing on MK8, PKM Letsgo, Super Mario Oddeysey, all works like a charm with orientation, Motion, Dual mode and single mode.

@ghost
Copy link

ghost commented Jan 1, 2025

I tested it under botw and it works fine.

I'm sakuba

@stenwill
Copy link

stenwill commented Jan 3, 2025

It works fine when I used single JC on SMP

@madwind madwind deleted the master branch January 8, 2025 01:36
@madwind madwind restored the master branch January 8, 2025 01:38
@madwind madwind reopened this Jan 8, 2025
@RanceJustice
Copy link

I've been continuing to test the PR (still using the compiled version produced by the github-actions bot ) and the vast majority of time it works without issue! My primary focus has been on the new Fitness Boxing 3 so far, but I've also confirmed Fit Boxing Fist of the North Star and Fitness Circuit; waiting to test Ring Fit Adventure until I can get the latest update + my saves dumped properly.

Most play testing has gone smoothly. The issues of frequent faux(?) disconnects still necessitates turning the Ignore Applet setting on. There are infrequent (usually once per 30+ minute 'workout' session with one of the aforementioned games that make use of Dual Joycon w/ motion ) issues of controls not registering (both button press and motion at times, require going back to keyboard to pause emulation to check if there has been a disconnect visible at the OS level or if not present, then Ryujinx Input settings etc.. ..and then take steps to remedy the potential issue) or perhaps connection, but there are enough differences that I'm trying to pin down commonalities so I can identify what is specific to this PR and/or new functionality vs a prexisting Ryujinx issue that is simply exacerbated, or something unrelated all together. Overall though, most of the time it seems things are working as intended.

I'm still waiting on another set of JoyCons to arrive for comparison/to eliminate local hardware variables, will update later. Also if there are any specific usage/feature requests primary developers/contributors wish to have tested, please let me know. Great work so far!

@georip
Copy link

georip commented Feb 1, 2025

"When I tested using one pair of controllers, Fitness Boxing worked fine. However, when using two pairs of controllers, this version of the emulator couldn't simulate two pairs—only one pair of controllers could be used normally. I wanted to play Fitness Boxing with two players."

@madwind
Copy link
Author

madwind commented Feb 9, 2025

"When I tested using one pair of controllers, Fitness Boxing worked fine. However, when using two pairs of controllers, this version of the emulator couldn't simulate two pairs—only one pair of controllers could be used normally. I wanted to play Fitness Boxing with two players."

I only have one pair of Joy-Cons, so I can't determine how automatic pairing should work when there are two pairs of Joy-Cons.

@mcost45
Copy link

mcost45 commented Feb 9, 2025

If intentionally implementing this for one pair only: I think it would make sense to signify in the UI that this type only works for one pair (e.g. disable the option if already in use + show a tooltip explanation), otherwise most users would probably consider it a bug.

Otherwise, without some setup screen similar what the switch does for paired joycon selection, it seems the only option would be to determine the pairs arbitrarily. A very rough idea could be:

  1. Sort the joycons by ids (alphabetically?)
  2. When the 'paired' type is newly selected, take the first two 'free' joycons and mark them as paired
  3. If an additional input selects the 'paired' type, take the next two joycons and mark them as paired, and so on

This would enable initial multiple pairings, while leaving room for some kind of joycon pair selection UI to be implemented in the future.

@RanceJustice
Copy link

Continuing along testing (still using the same compiled version above - ryujinx-Release-1.2.0+d264c27 ) and overall things are going smoothly with the primary issue being the disconnects and controller applet messages (if enabled). Disconnects (or notification thereof) happens several times per play session on Fitness Boxing 3. These can fall into several parameters and I'll try and break them down as to illustrate different things that may be going on

A) Ignore Applet option turned OFF (default)

When Ignore Applet pop-ups are turned off, there will be frequent pop-ups suggesting that the JoyCons are not connected / are not a correct configuration for this game (ie it properly shows the game, in the case of Fitness Boxing 3, expects the Dual Joycon pair ). This seems to happen in several circumstances. No matter what, I will need to use my PC's keyboard to click on the "OK" button on the pop up to resume playing.

  1. There is no visible disruption with the JoyCons connection. The lighting on the joycons themselves, nor the pairing/connection status in the OS etc.. is not abnormal. and thus no sign anything has gone wrong. It may be these are "false positives" or they right themselves so quickly its difficult to detect. Most of the time, this is simply an issue of hitting the OK button on the pop up and returning to play.
  2. Very temporary visible lighting change on the JoyCons (usually the Left joycon). Typically this is the Player lighting indicators changing from the static lit 1st player (on both L and R), to quickly blinking to one of the others/back and forth similar to the 'pairing or connection seeking state" Often it will happen so quickly that by the time I look down, I see the lighting return to the default P1 without having to do anything. Occasionally, if it has made it 'further' I press a button on the joycon and it usually return to P1 quickly. In this case, there is no disruption at all with the Bluetooth pairing/connection on the OS level - both JoyCons read as "connected' the entire time, so I am thinking it is something going on in Ryujinx and/or the custom driver for Dual Joycon.
  3. Major disruption / disconnect at the OS level. This is where one of the JoyCons at the OS level changes from "Connected" to "Paired"., often. Its worth noting that this can happen with and without any LED indicator variation; sometimes both will stay P1 lit and under such circumstances I've found out the major issue is happening by either going to the controller mapping settings area and finding them not connected or more likely, pressing to resume on the pop up only to find out that it wasn't an issue of number 1 or 2 above, but in fact the JoyCons are completely unresponsive in play; I have to quickly jump back to my keyboard and hit F5 and F11 to pause emulation and close fullscreen. In any event, whenever this happens Ryujinx can no longer detect the JoyCon pair (or even the remaining one) etc...... at this point, Usually the process is occasionally pressing buttons on the affected JoyCon in the hopes it will reconnect, but if that doesn't work to move it back to "connected" again, then to instruct at the OS level to "forget" the entire pairing, and repair both JoyCons until they're "connected" again then hope that Ryujinx will detect them both and allow selecting them as the input. This is the most unusual occurrence and unlike the other two, does not happen at every play session.

B) Ignore Applet option turned ON

This is a trade-off in that in the case of variant 1 and 2 above, gameplay is not interrupted for the most part. Now, there MAY be some occasional missed inputs but its hard to discern during those variants right themselves very quickly. The bigger issue is with Variant 3, especially if the LED indicators on the JoyCons have not shown any change. In this case, while playing suddenly inputs drop entirely leaving me to race for the keyboard so I can pause emulation and then attempt to fix the JoyCon connectivity, as described previously. While overall turning the Ignore Applet option on does mean less "needless" interruptions to gameplay, it does make the situation more hectic in the case of a an actual significant disconnection.

As of late I've returned to playing with the Ignore Applet option turned OFF again to see how often I'm interrupted and the different parameters linked above. I'm attaching a most recent log - a play session that had Type 1 and 2 events, but had no Type 3. When connected it seems to be working flawlessly for a Dual Joycon layout including dual gyro/motion, so perhaps if there can be an improvement to connectivity / reporting within the driver/Ryujinx, the functionality (at least for a single player - I've not attempted to look into multiple Dual Joycon pairs, but it seems mcost45 has identified an issue and potential solution there), is overall ready to go! Thanks and hope this helps !
Ryujinx_1.2.0+cf7e7b5_2025-02-13_19-49-21.log

@madwind
Copy link
Author

madwind commented Feb 14, 2025

@RanceJustice Maybe you can try changing the Bluetooth adapter for testing, such as using a 4.0 adapter or one with an antenna, or modifying the Bluetooth name.

@RanceJustice
Copy link

@madwind If you think its worth it, I'll grab a latest BT 5.x USB adapter stand alone. If there's a major difference I'd be surprised given that with the exception of the Type3 description above I'm not sure there's anything noticed as a disconnection, but to be comprehensive its a good idea and the adapters are not usually very expensive.

@bozis92
Copy link

bozis92 commented Feb 18, 2025

@madwind : the joycon only has full compability with BT 4.0
i have one here and when i use a differente BT adaptar i get severous delay and keep disconnect

sorry for my bad english

@bozis92
Copy link

bozis92 commented Feb 18, 2025

tested a few games

house of dead, arms, donkey kong

everything works fine, no disconnection issues or delay iput.

@RanceJustice
Copy link

RanceJustice commented Feb 21, 2025

@madwind : the joycon only has full compability with BT 4.0 i have one here and when i use a differente BT adaptar i get severous delay and keep disconnect

sorry for my bad english

Huh, when you use a different one less than 4.0 or one greater than 4.0? In theory, anything above 4.0 should easily support it as its all backwards compatible according to BT standards. Still, stranger things have happened.

tested a few games

house of dead, arms, donkey kong

everything works fine, no disconnection issues or delay iput.

Are any of these using both inputs individually, especially via gyro/motion? Though it is a good idea, I should test a game that is using a Dual Joycon layout that plays as a "standard gamepad" (ie the game could be played just the same by the Pro Controller, perhaps with a single point of gyro usage) such as Splatoon 3, BOTW, or those you mentioned vs one that is specific like the exercise titles that need both to register individual inputs and both gyro sides simultaneously.

@bozis92
Copy link

bozis92 commented Feb 21, 2025

@RanceJustice

the game ARMS use both input individually! and works perfects here!

you have to make move with your right and left hand to play the game.

@bozis92
Copy link

bozis92 commented Feb 21, 2025

@RanceJustice about the BT adapter.
its a joycon issue
whenever i use a version above >4.0 i get delay input and disconecting issues.
on youtube and reddit there's a few reports about this!

i have in my house
BT adapter 4.0 , 5.0 , 5,3 and only 4.0 works with joycon

@RanceJustice
Copy link

@RanceJustice about the BT adapter. its a joycon issue whenever i use a version above >4.0 i get delay input and disconecting issues. on youtube and reddit there's a few reports about this!

i have in my house BT adapter 4.0 , 5.0 , 5,3 and only 4.0 works with joycon

When those issues happen (ie the disconnects) are they the sort that have a visible change at the OS level such as the status changing in your Devices list from "connected" to falling back to "paired" ? Also, do these problems you describe happen with any application using JoyCons (ie another Switch emulator, emulators for other platforms, Steam Input using JoyCons for PC titles, any 3rd party driver package like DS4Windows/DualSenseX/BetterJoy etc) if you're not using a BT 4.0 adapter? Or is it only an issue with Ryujinx?

In any event I'll be sure to pick up both a 4.0 adapter specifically and a 5.x to compare, in addition to motherboard's built in BT that I've been using thus far(which claims to be 4.0). Thanks!

@bozis92
Copy link

bozis92 commented Feb 22, 2025

@RanceJustice
when the issues happen its a OS level issues!
for your first question:
You can see in the Bluetooth adapter settings that the Joycons are no longer connected.
for your second question:
sometimes you cant paired the 2 joy-con at the same time, sometime when you connect those they disconnect immediately
these problems happen regardless the program was on top on windows.
you cant even enter on emulator without the disconect issues.

BUT with you change to BT 4.0 those problem suddenly dissapearIt
could be a problem with my joycons since they are over 2 years old and it could have been a manufacturing defect or something like that, but if you search on Google for "joycons bluetooth 5.0" you get all kinds of trouble due to bluetooth

@bozis92
Copy link

bozis92 commented Feb 26, 2025

One more thing!
pokemon lets go, (eever or pikachu), doesnt recongnize MOTION SENSIOR,
single joy-con or portable mode with dual joycon.
maybe something to fix using this PR?

@RanceJustice
Copy link

@bozis92

Thanks for that description. I have a couple new USB BT adapters on the way to check things out. From what you describe, I think my issues may be different or at least partially so. Given that both my PC's included BT happens to be 4.0, and that I don't have any difficulty pairing both JoyCons in Windows (or Linux, but I've been sticking to Windows for the testing given its most likely other users will make use of Windows) and I only rarely see a disconnect that is visible at the PC OS level, I'm wondering if something else is going on here.

In my more detailed report above, only the "type 3" error causes any sort of occasional disconnection (this may not happen at every 30-min+ playtest) - the ones type 1 and 2 are not visible at the OS level at all, but simply within Ryujinx (ie such as the controller applet pop up). Aside from that, none of the other issues you mention like only being able to connect one JoyCon to the OS at a time, or issues entering the emulator with JoyCons connected etc...are not what I've experienced anyway. Not to mention that, at least last I checked, I didn't get the kinds of disconnects (or notification thereof at the emulator level) using other emulators that allowed Dual Joycon w/ motion. So I think there could be more than one thing going on here.

It may very well need to come down to yet another set of JoyCons to test but it seems like we're having different experiences given what you've mentioned. The BT I've been using for testing thus far has been 4.0 (and integrated to my X99 platform's WiFi chip I've used thus far), but I'm picking up stand alone 4.0 and 5.x USB adapters (as soon as I can find those that are equally supported on Windows and Linux) and test with those. Alternately, it may come down to using another set of JoyCons entirely - the ones I've used for consistency's sake have been dependable yet old from a release-era Switch but its not out of the question that could be a part of the issue. However, I'd think if it was a hardware issue exclusively on the JoyCon side then it would be happening no matter the emulator or use case. Still, good information..

Oh, regarding the Pokemon Lets Go issue you cite, you mention portable mode? Perhaps that is an issue? My understanding is portable mode is with both joycons expected to be fixed to the Switch, as opposed to Docked mode with the JoyCons or other controllers, in hand? Though if it seems to not register at all, even a single motion sensor for a single JoyCon or ProController, in Docked mode - then that may be something outside of both this PR (which has to do with the driver combining Dual JoyCons into a single input but allowing both motion sensors to work together) and the 'standard' Ryujinx functionality which should be able to handle a single ProController input with a single gyro point? Thus, maybe its an issue with the game itself or its particular implementation/controls?

@bozis92
Copy link

bozis92 commented Mar 4, 2025

can we make a build with this PR with the last improvemetns?

@bozis92
Copy link

bozis92 commented Mar 4, 2025

@RanceJustice about pokemon lets go
even on portable mode the gyro is need to catch pokemon.
like this!
image
my configs:
image

and the game wont recongnize any gyro or motion.

@bozis92
Copy link

bozis92 commented Mar 4, 2025

@GabCoolDude i think has failed compile this PR with the recents improvments

@GabCoolDude
Copy link
Collaborator

That's because @madwind needs to fix the errors in their code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants