Comments (15)
That is a side effect from how the controller input thread is written. The only time that the input thread sleeps is when it is waiting for input from the ReadFile function. The DS4 has a different poll rate depending on the connection being used. For a USB connection, the poll rate is around 4 ms. For a Bluetooth connection, the poll rate averages around 1.5 ms although there can be isolated periods of latency as high as 15 ms; that is considered normal behavior for the DS4 hardware. The main way to reduce CPU usage would be to impose a slower poll rate for the controller input thread as opposed to reading input as soon as it is ready.
from ds4windows.
Clear explanation. Thank you.
Just for my curiosity: why is there a different polling timeout/sleep-time for Bt?
from ds4windows.
Based on what I have read, that is just how the hardware was designed to behave. A DS4 using a Bluetooth connection can supposedly send reports as quickly as 1.3 ms. The following is my main source. The page is really useful for the various documented HID reports.
http://eleccelerator.com/wiki/index.php?title=DualShock_4
from ds4windows.
In my case the cpu usage is at 11% on i7 6700hq. I've tried it with default settings too. Cpu usage is at 1% with Jays2Kings version.
from ds4windows.
Are you using multiple controllers? In the old Jays2Kings version, one major limiting factor that increased lag but reduced CPU usage were some ties to the GUI thread which caused some extra sleep time in the input thread. The changes made since have reduced lag but increased CPU usage since there is less waiting happening in the input thread now. The problem really affects Bluetooth connections the most because of the high poll rate of the controller when using a Bluetooth connection.
The only decent way to lower CPU usage would be to set a fixed poll rate for the input thread. When using a Bluetooth connection, a new input report is read about once every 1.5 ms. If more than one Bluetooth controller is connected then that can likely cause DS4Windows to always be active and increase CPU usage. On my system, CPU usage maxes out at around 5% when using one controller connected via Bluetooth.
from ds4windows.
I see, 5% usage is probably comparable to mine depending on your cpu. I only have one controller. Is the input lag higher with usb connection?
from ds4windows.
As an aside, besides imposing a sleep time in the input thread, I have found decent values to control the input report rate from the DS4 hardware when a controller is connected via Bluetooth. The byte that sets the mode was already known but I have only ever seen a few known values documented; the primary source is from the hid_sony Linux driver. There is a fairly simple way to get the input report rate to change between 1000 Hz to 66 Hz. The lower 4 bits for 0x80 allow for the input report period rate to be changed by 1 ms increments.
from ds4windows.
Looking back at this has shown that the Task based async FileStream methods caused the biggest jump in CPU usage. I have done some experiments and I think the next release will just use the synchronous methods but still use overlapped IO. It looks like the system will still impose its own timeout on the device handles. Looking at the current test, the CPU maxes out around 2 % for a Bluetooth controller compared to the older standard in version 1.4.52 which makes out at around 3%.
from ds4windows.
In case anyone would like to test it out, here is an archive with the latest changes.
https://drive.google.com/open?id=0B6yGHDx0CFzDaEV2RXZEZV9hRHc
from ds4windows.
Cpu usage is almost 0 now, with 1.4.70 it was around 10 to 11%.
from ds4windows.
That is good news. Also, it looks like the next release will have the option to change the poll rate used for a DS4 connected via Bluetooth. I have to test it a bit more but it seems like the controls are slightly better when the poll rate interval is set at 4 ms instead of using the highest poll rate. That might just be me but it seems like the option could be useful. The default will still be set at the maximum possible poll rate.
from ds4windows.
Needs moar test versions xD
from ds4windows.
Ask and ye shall receive. There are some other experiments being done that are not finalized yet.
https://drive.google.com/open?id=0B6yGHDx0CFzDd3M0QXVHVzYtU00
from ds4windows.
thank you
from ds4windows.
A new version has been released. This should solve issues with high CPU usage in DS4Windows. I will keep this issue open for a few days just in case anyone runs into problems.
https://github.com/Ryochan7/DS4Windows/releases/download/v1.4.71/DS4Windows_1.4.71_x64.zip
from ds4windows.
Related Issues (20)
- Kernel related HOT 1
- DS4Windows creating a problem with the latest update HOT 10
- Dualsense Edge Not Working HOT 2
- Says .NET install was not found despite .NET being installed HOT 3
- DS4Windows crashes when profiles with certain macros are loaded. HOT 1
- Bluescreen when connecting a controller HOT 2
- N/A
- Touchpad mouse not working on UAC programs can be fixed? HOT 2
- Haptic Feedback and Adaptive Triggers. HOT 2
- PS Vita Support (new plugin) HOT 2
- Astro C40 controller is supported but doesnt show up. HOT 3
- DS5 Connection HOT 1
- Please add Victrix Pro BFG support (VID & PID inside) HOT 1
- Support new released gamepad: Nacon Revolution 5 Pro (Playstation 5)
- Rumble/Vibration/Haptic Passthrough HOT 1
- settings reset each time app updates
- Any way to stop Defender Picking it up as False-Positive? HOT 1
- [Feature Request] Show a battery indicator in the system tray
- Auto profile not working HOT 1
- 🌿 Thank you! ✨
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ds4windows.