Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Small Test HidGuardian Management App #1219

Closed
Ryochan7 opened this issue Apr 13, 2020 · 9 comments
Closed

Small Test HidGuardian Management App #1219

Ryochan7 opened this issue Apr 13, 2020 · 9 comments

Comments

@Ryochan7
Copy link
Owner

I finally got around to coding an HIDer replacement app. Not a great app but it does what I want. The app does provide some unique functionality and I think it is slightly better than HIDer used to be.

Like HIDer, this program is used to manage the affected devices list that is used by HidGuardian. An HID device can be selected from a list and individual hardware IDs can be added to the affected devices list. The app can also whitelist any currently running process so that blocked devices can be detected by an app not directly compatible with HidGuardian.

Probably should come up with an actual name for the app sometime.

HidHideTest_20200412.7z:
https://drive.google.com/file/d/1I6wTShLOayi4uA2BWHTYCEXz7VeG_Xer/view?usp=sharing

Source:
https://gitlab.com/ryochan7/hidhidetest

hid_hide_test_prototype

@mika-n
Copy link
Collaborator

mika-n commented Apr 13, 2020

Seems to work and does the job to setup HidGuardian sysreg entries for DS4 gamepads.
If HidGuardian is needed only with DS4Windows app then the combination of DS4Windows+HidGuardHelper does the runtime house keeping in simple and effective way. This HideHid app does the hidg sysreg tweaking in simple and efficient way.

Especially comment tag is useful when DS4Windows profile is used in dualshock4 mode. By commenting out the "HID VID_054C&PID_05C4" line (the first line in the screenshot above) makes it possible to use HidGuardian and dualshock4 profiles with DS4Windows app.

@Ryochan7
Copy link
Owner Author

HidGuardian has been more useful for me lately due to my recent Touchmote experiments. Trying to figure out how to get HidGuardian to hide the DolphinBar exposed gamepads was a pain. The process of hiding Wiimotes is definitely a lot easier with this. I had my own issues with HIDer and HidCerberus so I didn't use either tool outside of testing.

@Ryusennin
Copy link

Out of the bed, I suggest HidNinja or HIDden (mmm... right).

@Transcan
Copy link

Transcan commented May 7, 2020

Is there a way to hide original DS4 while not hiding the virtual DS4 one?
Both has the same "HID VID_054C&PID_05C4&REV_0100" so I can't filter only the original without affecting the virtual one.
I found this "Device instance path" in the original: "HID\VID_054C&PID_05C4\6&36255264&A&0000" and is different from the virtual one.
Unluckily HIDguardian doesn't work with it.

@Ryochan7
Copy link
Owner Author

Ryochan7 commented May 8, 2020

HidGuardian only works on defined Hardware IDs. The device instance ID will change depending on which port a device is plugged into. Also, I want to think that the instance ID can change per Windows session but I cannot remember for sure.

For now, the only way to work around this would be to comment out the Affected Devices entry for that Hardware ID after DS4Windows has opened the real DS4. Then you can load a profile that plugs in a virtual DS4 via ViGEmBus and that virtual DS4 will be available to the system. The Affected Devices list is checked when a device is plugged into the system so the virtual DS4 would be blocked if you load the profile beforehand.

At one time, I had a custom build of HidGuardian that would ignore virtual devices created by ViGEmBus. Unfortunately, I lost the old patch a while ago. I have not had the need to have that functionality back so I haven't taken the time to add that feature back to my custom version.

@mika-n
Copy link
Collaborator

mika-n commented May 9, 2020

@Transcan Have you tried to connect the DS4v1 over BT and using HidHider test app to comment out the USB hardware ID from HidG AffectedDevices sysreg entry? This way HidG would not hide the HID\VID_054C&PID_04C4 device ID which is actually the same used by ViGem virtual ds4 device. However, the original physical BT device would be hidden because AffectedDevices sysreg entry still has HID{000xxxxxx} type of entries.

I haven't tried this, but this could work with DS4v1. The dS4v2 devices doesn't suffer from this issue because you can comment out all DS4v1 device IDs from the AffectedDevices sysreg entry and to hide only DS4v2 device ID.

@Transcan
Copy link

Transcan commented May 9, 2020

Thanks both for the responses.
Yes, right now I'm using it via BT, but the battery is old and it discharge very quickly.
So I tried Ryochan's method and it works!: Turn the filter on, plug in the controller, turn the filter off and then start DS4Windows. This way the original HID is hidden and the virtual is shown.
Not too many steps to be a burden, so meanwhile a better solution comes up, I take it.

As my understanding, the problem comes from that the virtual controller emulates a DS4v1's ID, same ID as my actual physical controller. That makes me think... Can ViGEmBus emulate the ID of a DSv2?
That will solve this problem in a more automatic and easy way. I could hide DSv1 and let DSv2 unaffected, as Mika-n stated.

@mika-n
Copy link
Collaborator

mika-n commented May 9, 2020

ViGem interface has a support for a custom VID/PID values, but when I tested it at some point it (ie. used DS4v2 device ID while trying to solve the DS4v1 HidG issue with ds4 virtual devices) then it didn't work. ViGem still insisted to register the virtual DS4 device with ds4v1 hardware ID.
https://github.com/ViGEm/ViGEmClient/blob/master/src/ViGEmClient.cpp#L784

Could be that there was a bug in ViGem back then or my test did something wrong. Haven't looked at this thing since then (I mainly use DS4v2 gamepad). Anyway, the idea would have been to add an additional ControllerOutput profile option by letting user to choose between virtual ds4v1 or ds4v2 device type.

One more "DIY solution idea". I have several mobile phone USB cables which don't work with DS4 gamepad. Those cables don't carry over data signales between PC and the DS4, but can charge the gamepad. If you have such cables then you could use "hybrid wired/wireless" solution where data is carried over BT, but wire is used to charge the gamepad. Or connect the gamepad with a long usb cable to wall socket while charging it instead of charging via PC.

As a side note PS4 console works this way also. When you connect the DS4 gamepad with usb cable then it is used only to pair the gamepad and charge it, but data is carried over BT to PS4 console.

@BatyaPlay
Copy link

BatyaPlay commented Jun 13, 2023

Добрый человек. Спасибо тебе огромное. Твоя программа и твой труд помогли мне. Спасли так сказать от страшного поступка)) Добра тебе в дом и здоровья! Только ради комментария здесь зарегистрировался)

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

No branches or pull requests

5 participants