Ryochan7 / DS4Windows

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

Latency spikes every three seconds #290

Closed jurplel closed 5 years ago

jurplel commented 6 years ago

The latency will remain at 1-2ms for about 3 seconds and then spike up to about 15ms.

My Bluetooth adapter is a Premiertek BT400. I have tested with maximum BT Poll rate and Flush HID, and it doesn't make any difference. The old version of DS4Windows (1.4.118) has the same thing but only goes up to 5ms or so which makes it much more livable. I have the revised Dualshock 4. I'm also on Windows 10 insider build 17672, but I observed this previously. I've also tried disabling power management on the Bluetooth adapter and re-pairing.

Anybody have any idea what's going on?

Darthagnon commented 6 years ago

I remember reading somewhere that the DS4 is fussy about what Bluetooth hardware it works with, to the point that the site recommended buying a certain model of dongle for it to work. I don't know if things have changed since then, but you could try https://inputmapper.com/downloads/inputmapper-1-5/category/2-input-mapper, an alternative DS4-on-Windows tool, and see if the problem is still there. If yes, then it's hardware, if no, then it's software...

jonaaa20 commented 6 years ago

I'm having the same problem, when I press any button, the latency goes up to 10 - 25ms instantly, even disconnect it, I can only fix it when I reboot my system...

Darthagnon commented 6 years ago

Is latency only present when using the controller wirelessly, or does it persist when using it via USB? If wireless, what's your bluetooth hardware, and what model of DS4 are you using, @jonaaa20 ?

jurplel commented 6 years ago

@Darthagnon Inputmapper has no problem, the little DS4 icon goes yellow every 3 seconds, but you can't notice it in-game at all. With the old DS4Windows, it is noticable in game subtly. With the current DS4Windows, it's borderline unplayable.

My bluetooth dongle uses BCM20702

jonaaa20 commented 6 years ago

@Darthagnon i use a CSR 4.0 adapter and I have a V2 DS4, it only happens on Bluetooth.

Ryochan7 commented 6 years ago

@jonaaa20 Can you post a link to the profile that you are using when you experience that problem?

@jeep70 I am not sure what might be causing your problems but I would recommend that you disable the Flush HID option. That is an relic from older versions of DS4Windows that is just left in for older profiles. The option was honestly a bad workaround for latency problems to begin with and it has been disabled by default for a long time.

jurplel commented 6 years ago

@Ryochan7 Flush HID has no effect for me

jonaaa20 commented 6 years ago

@Ryochan7 i didn't know that flush hid isn't recommended on the latest versions, I'm gonna test the 119 version.

jonaaa20 commented 6 years ago

Sorry for the double post but i did some tests on GRID 2, the controller is disconnecting a lot on BT, USB is fine.

Here's the log:

25/05/2018 07:07:21: DS4Windows version 1.4.119 25/05/2018 07:07:21: LinkedProfiles.xml can't be found. 25/05/2018 07:07:21: Starting... 25/05/2018 07:07:21: Connection to Scp Virtual Bus established 25/05/2018 07:07:21: Searching for controllers... 25/05/2018 07:07:21: Using Shared Mode 25/05/2018 07:07:43: Found Controller:70:20:84:44:63:08 (BT) 25/05/2018 07:07:43: Plugging in X360 Controller #1 25/05/2018 07:07:43: X360 Controller # 1 connected 25/05/2018 07:07:43: Controller 1 is using Profile “Default" 25/05/2018 07:09:03: Controller 1's latency over 10ms 25/05/2018 07:09:08: X360 Controller # 1 unplugged 25/05/2018 07:09:08: Controller 1 was removed or lost connection 25/05/2018 07:09:40: Found Controller:70:20:84:44:63:08 (BT) 25/05/2018 07:09:40: Plugging in X360 Controller #1 25/05/2018 07:09:40: X360 Controller # 1 connected 25/05/2018 07:09:40: Controller 1 is using Profile “Default" 25/05/2018 07:09:59: Controller 1's latency over 10ms 25/05/2018 07:09:59: Controller 1's latency now under 10ms 25/05/2018 07:09:59: Controller 1's latency over 10ms 25/05/2018 07:10:00: Controller 1's latency now under 10ms 25/05/2018 07:10:00: Controller 1's latency over 10ms 25/05/2018 07:10:00: Controller 1's latency now under 10ms 25/05/2018 07:10:00: Controller 1's latency over 10ms 25/05/2018 07:10:00: Controller 1's latency now under 10ms 25/05/2018 07:10:00: Controller 1's latency over 10ms 25/05/2018 07:10:00: Controller 1's latency now under 10ms 25/05/2018 07:10:09: Controller 1's latency over 10ms 25/05/2018 07:10:14: X360 Controller # 1 unplugged 25/05/2018 07:10:14: Controller 1 was removed or lost connection

Ryochan7 commented 6 years ago

It seems like I have similar problems in a Windows 7 VM although there are some other factors at play as well. My main test game for the VM used to be Broforce but the latest update does not run well under VirtualBox. The overworld section works fine but the game slows down to a slideshow once a level is loaded. That even happens when DS4Windows is not running and attempting to use KB controls.

Anyway, version 1.4.116 has the least problems that I have seen and it seems relatively stable. Version 1.4.117 and later suffer horrible and constant latency problems. I am in the middle of setting up a Windows 7 install on a spare partition so hopefully I will have something that I can test soon.

Ryochan7 commented 6 years ago

The test did not turn out too well. Running Windows 7 on actual hardware did not exhibit the problems that I was having in the VM. DS4Windows ran fine on a real Windows 7 install. I made an attempt to wade through the VM problems and test the problem there.

The only real problem that I found was regarding USB connections. Output reports were being sent out constantly due to a minor oversight. That issue caused DS4Windows major latency problems when run in a VM. Even though it should not have affected it, BT connections seem more stable now as well. The code path was not affected by the other change. One other minor tweak was implemented for BT connections while I was fiddling with the code.

Ryochan7 commented 6 years ago

Updating VIrtualBox and the extensions to the latest release improved performance dramatically. Broforce is playable in VirtualBox again. I don't experience any latency spikes while using a BT connection.