..:: PCSX2 Forums ::..

Full Version: DS4 To XInput Wrapper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The only way to turn off controller properly is to send HID Control Virtual_Cable_Unplug event. The issue is it has to come from the host. There is no native implementation for this functionality, so only way is to acquire a handle on primary BT radio in the machine and send a command to it on byte level. The problem is that all radios are different and stacks, so acquiring handle is very tricky.
I found MS documentation on how to get radio handle with their stack, but for some reason I think in newer version of windows the bthprops.dll is not there.
http://msdn.microsoft.com/en-us/library/...s.85).aspx

USB reports are limited to 64 bytes, therefore BT is used instead. Also, PS4 choose this approach to make seamless plug/unplug. so controller doesn't have to reconnect when unplugged.

No matter what PS button will act as Guide in Steam if in shared mode.

Regarding FPS drop it might be an issue with Xinput or game system itself because i can't see how 1-3% can affect it drastically. I have most intensive game take at max 60% of my CPU and i can't replicate any FPS drops.
This is an amazing tool. It froze up my windows first couple of times, but now its working fine, unplugging the controller before letting the tool make any changes (eg launching tool for 1st time, stopping & starting, hiding/unhiding) seemed to help.

Tested it in some games and it works great, just need to get used to the analog stick placement, was used to X360 haha..

BTW for those trying to use this with Dark Souls, it works perfectly for me including the rumble and all. At first it wasn't working at all, but was working in other games. I could be totally wrong, but I think Dark Souls latches onto the 1st controller it detects, and for me it was detecting the DS4 controller even though it has no functionality for it, and there's no way to change the controllers in options so it simply didn't work. Using the tool to hide the DS4 controller didn't work either (at first)... I noticed when I used the tool to hide DS4, it was actually getting rid of the X360 controller proxy in devices window.

Closing any program that detected the controller before using the tool to hide did the trick for me (in my case I closed down Steam, hiding DS4 worked a treat and X360 controller was still in devices).

I get the impression it's kind of a sore topic bringing up Dark Souls, hope I don't rub anyone the wrong way with this...

Thanks for the tool Smile
(02-25-2014, 09:20 PM)InhexSTER Wrote: [ -> ]The only way to turn off controller properly is to send HID Control Virtual_Cable_Unplug event. The issue is it has to come from the host. There is no native implementation for this functionality, so only way is to acquire a handle on primary BT radio in the machine and send a command to it on byte level. The problem is that all radios are different and stacks, so acquiring handle is very tricky.
I worried this might be the case.
(02-25-2014, 09:20 PM)InhexSTER Wrote: [ -> ]USB reports are limited to 64 bytes, therefore BT is used instead. Also, PS4 choose this approach to make seamless plug/unplug. so controller doesn't have to reconnect when unplugged.
I suppose I was expecting that there would be no way to turn off while plugged in.
(02-25-2014, 09:20 PM)InhexSTER Wrote: [ -> ]No matter what PS button will act as Guide in Steam if in shared mode.
I think electrobrains was referring specifically to exclusive mode, but without having to map the button to Unbound.
(02-25-2014, 09:23 PM)Ohmz Wrote: [ -> ]I get the impression it's kind of a sore topic bringing up Dark Souls, hope I don't rub anyone the wrong way with this...

Thanks for the tool Smile

Dark Souls has gotten so much publicity from this thread they or we may as well start bothering one another about legal issues.

The general steps to solving the problem were identified ages ago and mentioned a lot, so when we're asked 'How to fix Dark Souls? The app is broken!' it does tend to get under our skin Smile Glad to see you figured it out anyway
@HecticSeptic
Just thought I'd point out that the links in your signature are broken. You just have "attachment.php" part of the link but not the "forums.pcsx2.net" part.
(02-25-2014, 10:06 PM)BravoGangUS Wrote: [ -> ]@HecticSeptic
Just thought I'd point out that the links in your signature are broken. You just have "attachment.php" part of the link but not the "forums.pcsx2.net" part.

Good find, that was me trying to be sneaky earlier when it gave me a character limit Smile

Edit: Had to abandon the colour on the second line to fall under 300...sigh
New release of DS4Tool!

As you can see from the zip, there are a lot of changes in the project and it require some explanation.

ServiceDestroyer is a commodity application, it's purpose is to delete the test service and his event log if someting goes wrong with the application.

DS4ToolService is the service for test, no action required; do not execute it.

DS4ToolServiceTester is the first application to launch, it register DS4ToolService as an actual service (you can see it in the system service after that) and an event log. When you close, it should unregister the service, but if something goes wrong, use ServiceDestroyer.
With DS4ToolServiceTester you can simulate some events (actually only the connection/disconnection of the first controller).

DS4Tool is the client application, it require that DS4ToolService is installed and active.

tl;dr; Launch DS4ToolServiceTester and then DS4Tool.

Disclaimer: probably the event log in DS4ToolServiceTester will write some strange error message instead actual message. I'm investigating it, on my dev machine it work flawlessy, but on the notebook where i tested the release it give that strange error.
@InhexSTER: attached a build of DS4 tool which can share the ScpVBus with the Scp Drivers, I'll be releasing Scp Drivers which leverage this functionality shortly.

@electrobrains: Tested the XInput Plugin/Unplug behaviour on Win 8.1, it appears to have the same behaviour as XP/Vista/7.
I try to install the virtual bus driver but i have this error:

INFO - ENTER: DriverPackageInstallW
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - Installing INF file 'C:\Program Files\DS4Tool 1.2.1\Virtual Bus Driver\System\ScpVBus.inf' (Plug and Play).
INFO - Could not open file C:\Windows\System32\DriverStore\FileRepository\scpvbus.inf_amd64_21ca245c0e23d7a5\scpvbus.inf.
ERROR - PnP Install failed.
INFO - Attempting to rollback ...
INFO - No devices to rollback
INFO - RETURN: DriverPackageInstallW (0x3EE)
The program install only bus driver and the service not work.
(02-25-2014, 09:20 PM)InhexSTER Wrote: [ -> ]Regarding FPS drop it might be an issue with Xinput or game system itself because i can't see how 1-3% can affect it drastically. I have most intensive game take at max 60% of my CPU and i can't replicate any FPS drops.

Well... a Haswell i7 K edition might make fps drop replication quite challenging Smile I imagine people experiencing fps drops are using much less powerful systems, and I still have a hunch that there are errors happening in the background - as its not intensive at all without them.