Hacking sys-hidplus-client-rs - An alternative client for sys-hidplus

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
sys-hidplus-client-rs

For context to those who aren't familiar with it, sys-hidplus is a sysmodule created by @nachuz that allows the Switch to receive controller inputs sent by a computer using a client - a program that the computer uses to send these inputs. In other words, controllers can be used for a Switch over a network rather than a direct USB or Bluetooth connection, which in turn allows users to use normally unsupported controllers. This is meant to be used alongside a low-latency video capture device (or sys-dvr) and a game streaming service - like Parsec - to allow for Switch gameplay from practically anywhere, using any computer-compatible controller.

I eventually learned about the project and saw that their original client had a lot that could be refactored, so I went ahead and decided to rewrite it in Rust. Nachuz is aware of this client, and while they have also rewritten their client, they encouraged me to continue work on this to support Mac and Linux computers. I also wanted to use this as a chance to implement and test new features that they could add at a later point. I originally made my releases in the sys-hidplus thread, but I figured I might as well keep things cleaner and move updates to my client to its own thread.

tl;dr sys-hidplus-client-rs is an alternative client for sys-hidplus that mainly aims to push out new, experimental features that may or may not be on the more unstable side, such as:
  • Support for up to 8 controllers.
  • The ability to use the home button.
  • Individual controllers can be configured in the following ways:
    • Artificial input delay, useful for putting yourself at an even playing field with those who have some input delay playing through Parsec.
    • Left and right analog stick deadzones, useful for mitigating stick drift and helping stick flicks get recognized more easily.
  • These settings are saved to a file and will persist across different sessions.
  • Users have more choice over which controller goes into what slot; pressing right bumper on a controller assigns it to the first available slot, rather than all connected controllers being assigned immediately.

Getting Started:

Other Links:

Credits:
Special thanks go to:
  • Nachuz for sys-hidplus and their clients, as well as everyone who helped them out. I literally would not be working on this project if it weren't for them.
  • Kemosahbee for testing the client, reporting bugs, and giving suggestions as well as feedback. Many important bugs were found thanks to him and his testing efforts.
  • cathery for their sysmodule sys-con, which helped me figure out how to emulate the home button.
 
Last edited by kenesu_h,

Chrisssj2

Well-Known Member
Member
Joined
Feb 12, 2008
Messages
2,361
Trophies
0
XP
3,239
Country
Netherlands
Right bumper is the rb above the right trigger right? I will be looking forward to testing this soon as when I have more time.
Great initiative!!!
Hope xbox series X controller works well with this too.
 
Last edited by Chrisssj2,

ConspiracyFactualist

Well-Known Member
Newcomer
Joined
Sep 11, 2021
Messages
61
Trophies
0
Age
39
XP
73
Country
United States
Can't get it to work but the original hidplus by nachus works. I am on 11.0.1 Atmosphere 17.1. Could that be the problem?

But otherwise I tried following your directions I installed your fork on sd card, used GUI and put my IP and hit Start Client. I'm using a Mayflash Magic-NS adapter on my PC though could that be the issue? I tried with Wii U Pro controller and Dualshock 4 controller neither works. Again both work on Hidplus with the same Mayflash adapter.
 

ConspiracyFactualist

Well-Known Member
Newcomer
Joined
Sep 11, 2021
Messages
61
Trophies
0
Age
39
XP
73
Country
United States
The Dualshock 4 was hooked up to my PS4 not PC I forgot I had switched it back.

But as far as Wii U Pro controller (using Mayflash) suddenly it's kind of working, but only the buttons. I can't use d-pad or joystick? Is it just not supported?

Edit: rebooted the client and it worked, for about 5 seconds. Then it stopped and won't work at all since. And yes I am hitting RB. Seems as long as I continuously hit buttons it will work but as soon as I stop hitting buttons it will stop working. Guess I'll have to use Hidplus unless you know how to fix it.

Now I'm thinking it may be on my end the wireless internet on my switch. (even though I have 5G) Will try ethernet another time.
 
Last edited by ConspiracyFactualist,

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
The Dualshock 4 was hooked up to my PS4 not PC I forgot I had switched it back.

But as far as Wii U Pro controller (using Mayflash) suddenly it's kind of working, but only the buttons. I can't use d-pad or joystick? Is it just not supported?

Edit: rebooted the client and it worked, for about 5 seconds. Then it stopped and won't work at all since. And yes I am hitting RB. Seems as long as I continuously hit buttons it will work but as soon as I stop hitting buttons it will stop working. Guess I'll have to use Hidplus unless you know how to fix it.

Now I'm thinking it may be on my end the wireless internet on my switch. (even though I have 5G) Will try ethernet another time.
Hey there, thanks for all this info. I can only give a quick response at the moment, but I'll do my best to address all of this. I'd definitely try out ethernet, but to be honest, if sys-hidplus worked totally fine for you before, I think the problem lies within my fork and client.

My fork is built upon the latest version of the original sys-hidplus, so it's built primarily for 12.x.x support, though from the sounds of it, the Dualshock 4 at least worked okay. I do think this is fixable, though it will need a lot of active communication between us since I personally don't have a Wii U Pro Controller (let alone a Mayflash adapter) to test and debug with. That said, I'm aware the adapter has both a DInput and XInput mode. Have you tried it out in both modes by any chance? Please let me know.

--------------------- MERGED ---------------------------

Right bumper is the rb above the right trigger right? I will be looking forward to testing this soon as when I have more time.
Great initiative!!!
Hope xbox series X controller works well with this too.
Yep! Right bumper is the button right above the right trigger.
 

ConspiracyFactualist

Well-Known Member
Newcomer
Joined
Sep 11, 2021
Messages
61
Trophies
0
Age
39
XP
73
Country
United States
I was thinking the Switch dock has an ethernet port but it doesn't. I was using xinput I'll try dinput just to see if it works later and report back but ultimately that wouldn't work for me for other games and my setup on PC.

No the Dualshock 4 wasn't working but I realized it was hooked up to my PS4. I'll also try it later on PC.
 
Last edited by ConspiracyFactualist,

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
Nevermind this post was wrong I thought I had the solution but I was running HidPlus and this at the same time. Still having same problem with this regardless if GUI or command line.
Yeah, I was afraid that would happen. After thinking it over during last night, I have a few ideas:
  • sys-hidplus version 1 is to be specifically for 10.0.0-11.0.1 support, whereas 1.1 is for 12.x.x. I take it you're using version 1 since you're on 11.0.1? If so, I'm thinking that me relying on 1.1 is what could be breaking things on your end, which might make sense since I remember version 1 broke for Switches on 12.x.x. I could try making a release built off version 1, which shouldn't take too long.
    • I've also been suggested that if you want to stay on your current Switch FW then you could also try updating Atmosphere, but I don't think this will make much of a difference.
  • If the Dualshock 4 happens to work, then we can maybe isolate the problem to how the client takes in the pro controller's inputs. No pressure on testing it ASAP, but I'd love to hear if it has the same problem as your pro controller. You might have to try both a bluetooth and direct USB connection.
 

ConspiracyFactualist

Well-Known Member
Newcomer
Joined
Sep 11, 2021
Messages
61
Trophies
0
Age
39
XP
73
Country
United States
Yeah I really don't have a specific reason that I haven't updated, just haven't. I could do that if needed. I got some days off coming up after today (Monday) I'll go ahead and update to 12 and report back.

But before I update I'll try a Dualshock 4, but it would still be Mayflash so I'm thinking Mayflash is seen as like the "controller" and it doesn't matter which controller you use as I'm using xinput for both the Wii U Pro and the Dualshock 4 on the mayflash adapter.
 
Last edited by ConspiracyFactualist,

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
Yeah I really don't have a specific reason that I haven't updated, just haven't. I could do that if needed. I got some days off coming up after today (Monday) I'll go ahead and update to 12 and report back.

But before I update I'll try a Dualshock 4, but it would still be Mayflash so I'm thinking Mayflash is seen as like the "controller" and it doesn't matter which controller you use as I'm using xinput for both the Wii U Pro and the Dualshock 4 on the mayflash adapter.
I'm thinking that if the Mayflash doesn't work with the Wii U Pro, it probably won't work for the DS4, so I'd recommend trying without the adapter if it doesn't - well, if you're willing to do that. Kemosahbee and I have tested DS4s without it and they work fine, although we've never tested it with the adapter and I'm not totally sure if he tested it using bluetooth at some point. I know for sure we tested it with a USB connection though. My PC doesn't support bluetooth so I can't check it out right now.

Edit: Really wishing I had a Mayflash of my own so I could replicate this situation.
 
Last edited by kenesu_h,

ConspiracyFactualist

Well-Known Member
Newcomer
Joined
Sep 11, 2021
Messages
61
Trophies
0
Age
39
XP
73
Country
United States
I updated to 12.1 and it's working now. :)

So happy to have home button support, thanks.

Edit: It was working then I did a few things and left it idle for less than 5 minutes, and it stopped working. I pressed RB and it worked for a second then stopped. Maybe there's still some issue with Mayflash idk.

I mentioned in one of the previous posts if I click my mouse on the GUI it will work, but if I click my mouse elsewhere it stops working. That seems to be why it works then doesn't work. I don't even know if there's any issue with Mayflash at all just seems to be other problems but you would know more than me. At least I know a way to get it to work consistantly by clicking on the GUI but would love it if that wasn't necessary.
 
Last edited by ConspiracyFactualist,

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
I updated to 12.1 and it's working now. :)

So happy to have home button support, thanks.

Edit: It was working then I did a few things and left it idle for less than 5 minutes, and it stopped working. I pressed RB and it worked for a second then stopped. Maybe there's still some issue with Mayflash idk.

I mentioned in one of the previous posts if I click my mouse on the GUI it will work, but if I click my mouse elsewhere it stops working. That seems to be why it works then doesn't work. I don't even know if there's any issue with Mayflash at all just seems to be other problems but you would know more than me. At least I know a way to get it to work consistantly by clicking on the GUI but would love it if that wasn't necessary.
It's probably best to move this to DM's past this point since there's a lot of things I want to check in with. To address this though, I think it's safe to say that there's nothing wrong with the Mayflash itself, and it definitely sounds like a client problem since it's only working as long as you have the GUI focused. I'm not totally sure why this is happening since Kemosahbee and I haven't encountered the same issues - we didn't need to focus the GUI for it to work, and I don't think we came across any issues where leaving it idle caused it to stop working, but I do have a few ideas. Can you run the client with the command line interface and see if that requires you to keep the terminal open (for inputs to be registered)? Please let me know how it goes in a DM.
 
Last edited by kenesu_h,

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
1.1.0-alpha.5 has been released:
https://github.com/kenesu-h/sys-hidplus-client-rs/releases/tag/1.1.0-alpha.5

Copy and pasting from the release page:
This release specifically, although partially, fixes one bug where controller input would not be recognized if the GUI or command line window wasn't focused. The caveat with this (and why this is considered a partial fix) is:
  • ConspiracyFactualist reported that focusing OBS will prevent background controller input for them. This is not a problem for everyone and I'm still not sure why this is.
  • Only ConspiracyFactualist had this issue so far, which could point to this being a machine-specific issue. It's very possible that we could see more issues down the line because of computers being inherently different.
This fix should at least universally ensure background input for everyone, which should (hopefully) be independent of whatever window they have focused.

Special thanks goes out to ConspiracyFactualist on GBATemp for reporting this bug, testing the fix, and just being patient and great to work with.
 

ConspiracyFactualist

Well-Known Member
Newcomer
Joined
Sep 11, 2021
Messages
61
Trophies
0
Age
39
XP
73
Country
United States
There is one more issue that I find to work better in the original Hidplus. I turn on the Switch with the original joycons and on the original Hidplus if it's running my controller from my PC defaults as the first player and the joycons are player 2 but on your fork the joycons are the first player I believe that's due to the fact of having to hit Rbumper to activate the controller but I'm not 100% sure. Is there any way to default the controller as player 1 over the joycon? When I get in game the joycon is player 1 and the PC controller won't work the only fix I've found is hitting the power button on the switch like a reset then the PC controller works.

I would love to not have to hit Rbumper if possible at all and the controller just work without having to do that like the original but maybe it's not possible?

Edit: I think I have a workaround for this already. If I hit Rbumper on the PC controller and activate it before I turn on the switch then it works, but if I don't it doesn't.
 
Last edited by ConspiracyFactualist,

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
There is one more issue that I find to work better in the original Hidplus. I turn on the Switch with the original joycons and on the original Hidplus if it's running my controller from my PC defaults as the first player and the joycons are player 2 but on your fork the joycons are the first player I believe that's due to the fact of having to hit Rbumper to activate the controller but I'm not 100% sure. Is there any way to default the controller as player 1 over the joycon? When I get in game the joycon is player 1 and the PC controller won't work the only fix I've found is hitting the power button on the switch like a reset then the PC controller works.

I would love to not have to hit Rbumper if possible at all and the controller just work without having to do that like the original but maybe it's not possible?

Edit: I think I have a workaround for this already. If I hit Rbumper on the PC controller and activate it before I turn on the switch then it works, but if I don't it doesn't.
You're right that this is due to the requirement of pressing right bumper on your PC controller. I was about to suggest just leaving the client on and connecting it before the Joy-Cons, but I saw your edit and also realize that using Joy-Cons will wake up and auto-connect to the Switch; this kind of makes the whole right bumper thing inconvenient in your case.

That said, I can remove the right bumper restriction or add it to the client's settings as a toggle. It's not that it's not possible, it's just that I prioritized giving individual controllers more control over what player number they got, instead of the client auto-assigning everything without giving players a say. I realize I'm making it sound way worse than it actually is though, and I also realize now that's not the best solution in everyone's use case.

If you feel like the workaround is annoying to go through, I can take some time later today to add the aforementioned right bumper toggle.
 
Last edited by kenesu_h,

ConspiracyFactualist

Well-Known Member
Newcomer
Joined
Sep 11, 2021
Messages
61
Trophies
0
Age
39
XP
73
Country
United States
You're right that this is due to the requirement of pressing right bumper on your PC controller. I was about to suggest just leaving the client on and connecting it before the Joy-Cons, but I saw your edit and also realize that using Joy-Cons will wake up and auto-connect to the Switch; this kind of makes the whole right bumper thing inconvenient in your case.

That said, I can remove the right bumper restriction or add it to the client's settings as a toggle. It's not that it's not possible, it's just that I prioritized giving individual controllers more control over what player number they got, instead of the client auto-assigning everything without giving players a say. I realize I'm making it sound way worse than it actually is though, and I also realize now that's not the best solution in everyone's use case.

If you feel like the workaround is annoying to go through, I can take some time later today to add the aforementioned right bumper toggle.

I hope I'm not coming across as high maintenance I just like things as automated as possible lol. But yes I would love to have a toggle thank you.
 

kenesu_h

Member
OP
Newcomer
Joined
Jul 22, 2021
Messages
24
Trophies
0
XP
135
Country
United States
I hope I'm not coming across as high maintenance I just like things as automated as possible lol. But yes I would love to have a toggle thank you.
Nah don't worry you're not coming off as high maintenance lol, if anything I think these are completely valid criticisms and I do want to make this client the best that it can be. Plus, this isn't really that hard to implement (even in theory), so it's kind of a matter of "why not".

Edit: I found out the hard way that what I had in mind still had a few caveats that didn't make it that much better than its current state lol
 
Last edited by kenesu_h,
General chit-chat
Help Users
    DinohScene @ DinohScene: congratz on surviving!