Ryochan7 / DS4Windows

Like those other ds4tools, but sexier
https://ryochan7.github.io/ds4windows-site/
GNU General Public License v3.0
6.99k stars 807 forks source link

Use DInput Only always sets itself on start up. WTH? #478

Closed m-7761 closed 5 years ago

m-7761 commented 6 years ago

How does this happen? Every time I start DS4Windowas nowadays the default profile has Use DInput Only enabled, and so it doesn't appear as a controller, and I'm pretty sure this makes Sony's controller malfunction too.

Why would a setting set itself? Every time I must go into the profile, and change it, and save it, and so I can use the controller. The next day, it's turned back on.

Kind of makes DS4Windows impossible to use in practice.

mika-n commented 6 years ago

Some permissions problems in "%APPDATA%\DS4Windows" settings folder and DS4Windows executable cannot save properties in those profile config files? Try running DS4Windows using "run as administrator" option.

Is your computer part of a corporate AD domain? Maybe some domain policy issue and it reverts profile settings from a roaming profile? Try deleting the %APPDATA%\DS4Windows profile folder and let the app re-create it. Maybe it solves weird permission issues.

Ryochan7 commented 6 years ago

Is the Profiles.xml file being saved when closing DS4Windows? Is ScpVBus working properly on your system? For the second problem, you can go to the Windows Device Manager and then perform a Disable device and Enable device cycle on the System devices\Scp Virtual Bus Driver device. You can try DS4Windows again after doing that and see if you run into the same problem.

m-7761 commented 6 years ago

Thanks for feedback! I will look into the configuration file. I think the most down to earth explanation is the configuration is not saved, and so it gets reloaded, but I have changed some things like the low battery color, which seemed to stick. Maybe I was thinking there is some explanation for this particular option reverting itself (even though it goes against expectations to change settings behind the user's back, it happens) or possibly a bug that fails to fill out the option, leaving it in a default state.

EDITED: Oh yeah, thanks for the advice about ScpBus. I've been killing the ScpService EXE as necessary.

Ryochan7 commented 5 years ago

Killing that service would kill the connection to the driver device but that would not help if a problem already exists. Changing the status of the device in the Windows Device Manager would be necessary.

m-7761 commented 5 years ago

Just for the record (post Closed) I'm still going to look into this, eventually. I just don't use DS4Windows every day. There's something to this.

Ryochan7 commented 5 years ago

I just assumed that this issue ran its course and that you either solved the problem or moved on to other options. I will reopen this issue.

m-7761 commented 5 years ago

BTW: System devices\Scp Virtual Bus Driver doesn't kill my SIXAXIS hosted by ScpToolkit. It prompts for system restart. I don't know if cycling it is helpful... maybe after killing the process, to get it back. (I've been using the standalone server for that.)

I thought there might be something funny about the configuration file. But what I can say is that before I started DS4Windows, the Default.xml file has <DinputOnly>False</DinputOnly> in it. Except DInputOnly was, again, checked at start up. After editing/saving the setting, the Default.xml file is written to, and still says False. After exiting DS4Windows, and starting it back up, the setting remains False...

HOWEVER every time I restart the system (Windows) it's been turned back on. This is about the 8th time I've observed this happen, and never any different.

Since it is false in the XML file at start up, it's never being turned on. What is the default setting for it? True or False? Why would it be turned on, ever? There is something here. It seems to be independent of the configuration save/load process. It seems to happen only on first time the program is run, per reboot. It's so weird, something ought to spring to mind?

EDITED: For the record, I'm not running as Administrator. I've had similar problems with PSVRToolkit, half functioning when not Administrator. I don't know, but it seems a decade out from the time that any living software should require elevated privileges to run, and if software does so, it should refuse to run any other way, if this is the problem. I haven't tried to Run As Administrator, and am frankly not enthusiastic to. If I'm being perfectly honest, I've been using Sony's queer DirectInput device more than DS4Windows of late, but I'm definitely interested in having access to extras. Like I was trying to play a game over BT with it yesterday, and for the first time noticed how intrusive that light bar is in the dark. (I hid my hands under a blanket!)

Ryochan7 commented 5 years ago

The DInput Only option defaults to false in the BackingStore class. The flag is only set to true if the option is explicitly enabled in a profile or if ScpVBus fails to expose a virtual Xbox 360 controller when requested.

I can see some concerns about forcing the Run As Administrator option. I wouldn't want a Linux program to explicitly ask for root access unless I know exactly what is being run. It just doesn't help that Windows does not allow a regular user access to certain functionality and the Windows scheduler is not that great; one example is that using the exclusive mode workaround requires administrator privileges. I even tried forcing administrator access with version 1.5.15 but I just had to revert that option thanks to Windows not allowing programs to run at startup that require administrator access. Improving output performance has been a priority for me and using the Run As Administrator option is a way to make sure Windows gives DS4Windows higher priority so that it can perform better.

m-7761 commented 5 years ago

"or if ScpVBus fails to expose a virtual Xbox 360"

Okay, case solved. Make it not do this then... as someone affected by it, I can tell you it's not a helpful feature. Did I miss someone's explaining this???

(I've been running without Run As, and it works. So unless it's just a performance thing, you should not allow it to be run otherwise.)

Ryochan7 commented 5 years ago

The only other suggestion is that you might have to change the "Use XInput Ports" range. Especially with ScpToolkit running, there might be a port range conflict. Changing the port range to use 5-8 or something different might be needed to avoid conflicts.

m-7761 commented 5 years ago

THE PROBLEM IS by turning on that setting, you're just making a minor problem a big problem. Everything works. But it's unusable as-is because DS4Windows is turning that on. Maybe reevaluate why that is even necessary? (EDITED: I'm not even sure there is a problem. Except for that getting turned on behind my back.)

Ryochan7 commented 5 years ago

Sounds like a PEBCAK tbh. Should not be running conflicting software at the same time in the first place. Marking this issue as invalid.