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

There is a 150,000 millisecond delay before starting DS4Windows from sleep. #2948

Closed
AmuletOfNight opened this issue May 20, 2023 · 4 comments

Comments

@AmuletOfNight
Copy link

AmuletOfNight commented May 20, 2023

Describe the bug
Every single time I wake my computer from sleep, consistently, DS4Windows is unusable, for approximately 2 minutes.

It is PROBABLY this code:

https://github.com/search?q=repo%3ARyochan7/DS4Windows%20150000&type=code

Task startupTask = Task.Delay(150000).ContinueWith(t =>

Needs to be changed to:

Task startupTask = Task.Run(() =>
{
    App.rootHub.Start();
});

Can we remove the over 2 minute delay on power resume, please?

To Reproduce
Steps to reproduce the behavior:

  1. Wake computer from sleep
  2. Observe.

Expected behavior
I would expect DS4Windows to resume in a reasonable amount of time, not 2+ minutes.

Screenshots and Logs
If applicable, add screenshots to help explain your problem. Also, please add the most
log file (ds4windows_log.txt) from the Logs folder in your DS4Windows config folder.

image

ds4windows_log.txt

Desktop (please complete the following information):

  • Controller Make and Model: Sony DualSense (CFI-ZCT1W)
  • OS: [Windows 11 Pro 22H2 22621.1702]
  • DS4Windows Version [3.2.10]

Additional context
Add any other context about the problem here.

@AmuletOfNight
Copy link
Author

I did just build a copy of DS4Windows with this fix, and it appears to have resolved my issue.

@AmuletOfNight AmuletOfNight changed the title Takes forever to resume from sleep, or never resumes from sleep. There is a 150,000 millisecond delay before starting DS4Windows from sleep. May 20, 2023
@DistractionRectangle
Copy link

It was introduced as a work around for issue #2869

@Ryochan7
Copy link
Owner

Can we remove the over 2 minute delay on power resume, please?

Unfortunately, no. The arbitrary delay is imposed because it seems like the ViGEmBus driver is not ready by the time the system is initially resumed. Trying to re-connect with ViGEmBus too early will result in a connection failure that cannot be fixed until DS4Windows is restarted. FakerInput does not seem to suffer from this problem and DS4Windows is able to connect to FakerInput almost immediately after the system is resumed.

My system barely ever resumes properly so I cannot readily test the suspend and resume routines.

@Ryochan7
Copy link
Owner

My system is somewhat cooperating with suspend currently; cannot guarantee how long that will last. Anyway, playing with the routine again. Ended up lowering the resume delay to 5 seconds and no problems so far. It has actually worked with no delay enabled on system resume but I cannot trust no delay to keep working reliably. Will temporarily re-open this issue since it is relevant again.

@Ryochan7 Ryochan7 reopened this Jun 22, 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

3 participants