Ryochan7 / DS4Windows

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

Battery Level DualSense #1600

Closed AlexRux closed 3 years ago

AlexRux commented 4 years ago

Describe the bug It shows 10%+ battery if it's connected with a cable and 50% with BT.

Screenshots image image image

Ryochan7 commented 4 years ago

I am going to blame the controller firmware for some of the odd battery level discrepancies. The data is very inconsistent in the input report. DS4Windows is interpreting the input report as expected.

TheMasterDingo commented 4 years ago

I am going to blame the controller firmware for some of the odd battery level discrepancies. The data is very inconsistent in the input report. DS4Windows is interpreting the input report as expected.

i read somewhere on reddit that when connected to the ps5 it updates the controller firmware, and there was an update for the dualsense firmware this days

edit: here the link

DaRkL3AD3R commented 4 years ago

It would be extremely unfortunate if there were no way to update the firmware on the controller if you don't have a PS5. Would make buying it any time within the first couple years pointless if something like this is tied to firmware updates.

Ryusennin commented 4 years ago

I don't think Sony will ever bother implementing a discrete firmware update feature on PC, except maybe through their PS Now streaming service (which would make sense, since at some point the DualSense will probably become mandatory).

AlexRux commented 4 years ago

So we'll not be able to update its firmware? Damn, I need a friend that buys a PS5 so. Could DS4Windows do it?

rocketbucket10 commented 4 years ago

Sadly, the controller firmware cannot be downloaded (only the console firmware), so an updating feature cannot be implemented.

PSNow updates firmware on PC? (DS4)

AlexRux commented 3 years ago

PSNow updates firmware on PC? (DS4)

This one?

JamieStivala commented 3 years ago

Same issue here, 80% on Bluetooth, 100% wired

rocketbucket10 commented 3 years ago

PSNow updates firmware on PC? (DS4)

This one?

Yes, that's where you can download the PS5 firmware, but sadly you cannot download the controller firmware from there. Even if you somehow extract the controller firmware, you would still need a program or a tool to update Dualsense.

usergithub64 commented 3 years ago

In this case, the whole point of using Dualsense on a PC is lost without a firmware update. It needs someone with a PS5 to be able to update the firmware in Dualsense and then extract it and make it freely available for download. And at the same time, you need a program to update the firmware in Dualsense via PC.

rocketbucket10 commented 3 years ago

While firmware updates would be nice, they are not really needed to get the controller working on PC. But since I'm not a dev, take everything I say with a grain of salt. We should wait for @Ryochan7's response.

DaRkL3AD3R commented 3 years ago

Well, sadly, let it be known: the BT battery level reading is accurate. I ran my controller down from 100% to 0% until the controller turned itself off to reserve enough to juice the battery backup when plugged in, and DS4Windows accurately reported battery level to 0% then shortly after it died.

I have to say, this controller has the worst battery life of any device I've ever used save for quad copter drones. Even my Index controllers for VR last longer and have far more sensors and work to do. This thing is pretty abysmal. I am highly contemplating returning it to the store after experiencing this as it really doesn't offer any benefit over the DS4v2 and honestly I find the rumble to be pretty bad when using it in XInput mode with emulators and PC games.

AlexRux commented 3 years ago

@Ryochan7 I'm an electronic engineer. I know that batteries can last longer if its charge level is maintained at 60%. Can we just introduce an option called "Battery save" that stop charging the pad at 60%? (Knowing that the charge level is correct)

This can be disabled if one wants to fully charge the pad and enabling if you want to use the pad with the cable all the time. Keeping the battery al 100% is a killer for the battery itself.

Can you please think about this feature? I know that some laptop maker has implemented it to save laptop battery lives.

rocketbucket10 commented 3 years ago

@AlexRux Not sure if this feature would be possible, since the battery level cannot be shown correctly, due to the firmware.

AlexRux commented 3 years ago

@AlexRux Not sure if this feature would be possible, since the battery level cannot be shown correctly, due to the firmware.

Yep, but that's not a big deal. There's no need to be perfect at 60%. It's just a way to prevent to fully charge the battery.

mika-n commented 3 years ago

How to force the firmware in DualSense or DS4 pad to charge its battery if the cable is still connected? At least I don't know how to programmatically force DS4 gamepad not to charge over 60% when the cable is connected. DS4 firmware does what it does and takes care of the charging logic. I'm sure DS5 pad firmware does the same.

DS4/DS5 firmware stops charging when the battery is fully charged, but when it starts to re-charge? Probably not right away when the battery level drops few knots.

Some PCs have an option to configure usb port behaviour how the power is fed (standby or only when PC is running). It may be possible to code an app to control this behavior based on the battery charging status from DS4Windows app, but on the other hand there is no standardized way to do it as far I know. If each PC/motherboard/usb host driver needs a different way to control the usb host power circuit then the tool is outside the scope of DS4Windows app.

Or if you hook up an external USB hub to PC then WinOS assigns a specific usb host driver to control the hub. Each usb host driver has various options to control device settigns. Or in some cases if the device driver is disabled then WinOS cuts out the power feeding to the usb hub (ie. hub is taking its power from PC). You can disable usb hub driver via DeviceManager. Maybe you could do it this way. Feel free to experiment and tell here how it went.

External tool can query the battery level of DS4/DS5 gamepads via DS4Windows command line interface: https://github.com/Ryochan7/DS4Windows/wiki/Command-line-options

Aida-Enna commented 3 years ago

I don't have this issue with my DualSense controller - I don't suppose there's some way I could "dump" the firmware from it for other users?

Ryochan7 commented 3 years ago

Just now looking into this. HidReportInspector shows that a near empty BT connection starts with a value of 4 for the battery byte in the report (index 54 for BT) . Not sure why. A USB connection shows a value of 16 which is used as a charging flag for that byte. Both USB and BT interfaces will have the same value for the relevant byte when the controller is plugged in via USB. For both connections, a value of 32 indicates that the battery is considered fully charged and that is the point where the controller will stop flashing the orange light.

A temporary workaround has been added to the code. Not too sure if it will stay in there or get removed later. Need to monitor both connections and hotplug the USB connection on occasion to monitor the values.

Ryochan7 commented 3 years ago

Never mind. The controller just seems to put out inconsistent data sometimes. Marking this issue as closed as the problem is not with DS4Windows

an3k commented 3 years ago

Are you sure? It should read something like 100% or anything above 70% since I charged this brand new controller until it stopped charging (and DS4Windows reported 100%)

image

DaRkL3AD3R commented 3 years ago

Are you sure? It should read something like 100% or anything above 70% since I charged this brand new controller until it stopped charging (and DS4Windows reported 100%)

image

Did you update the firmware of your controller? There's a known bug with the white controllers running original firmware where you might charge it to full, unplug it then the next day the battery is dead. That looks exactly like the issue and is not tied to PC use or DS4Windows. It's just the controller.

an3k commented 3 years ago

I did not. Does the buggy firmware mean the battery is empty or just reported as empty?

OnTopic: In the screenshot you can see a reported battery level of 0% and at the same time 12% so something is wrong in DS4Windows.

DaRkL3AD3R commented 3 years ago

It means the battery is empty. You'll get the controller switched off soon after powering it on if you don't charge it again. As for the 0% vs 12% yep that's probably a DS4Windows bug. I returned my dualsense and waited for an official black one so my pre-order should be ready next week. Once I pick it up I'll see if it has the same battery drain overnight problem or if it has the latest firmware and no issues.

mika-n commented 3 years ago

Are you sure? It should read something like 100% or anything above 70% since I charged this brand new controller until it stopped charging (and DS4Windows reported 100%) image

Did you update the firmware of your controller? There's a known bug with the white controllers running original firmware where you might charge it to full, unplug it then the next day the battery is dead. That looks exactly like the issue and is not tied to PC use or DS4Windows. It's just the controller.

That is not a bug, but a feature. The bottom "status text" is not an active status but just the latest output of the logfile. Now the latest logfile line just happened to be the connection msg where it also shows the battery level at the time the controller was connected but the logfile line could several hours old "status" if no more new logfile outputs. Or the bottom status line could show pretty much anything else what happens to be at the last line in the logfile

And DS4Windows app just reports what is read from the controller, so if the gamepad reports 0% battery then that's what DS4Windows app is going to show. The battery value is not exact math in DS4 or DS5 because it uses just few bits to report the battery value, so it is always some kind of coarse approximation (hardware issue, not a software issue).

You should hook up the DS5 to PS5 console to force the firmware update. At the moment there is no other way to update the DS5 firmware.

ayeball commented 3 years ago

Is it not a way to update ds5 controller firmware in pc or emulation ps ?

mika-n commented 3 years ago

no, at the moment there is no way to update DS5 firmware in PC. No one has reverse engineered the protocol and Sony haven't added that support in PSRemotePlay app (maybe they do it at some point, who knows)

an3k commented 3 years ago

That is not a bug, but a feature. The bottom "status text" is not an active status but just the latest output of the logfile. Now the latest logfile line just happened to be the connection msg where it also shows the battery level at the time the controller was connected but the logfile line could several hours old "status" if no more new logfile outputs. Or the bottom status line could show pretty much anything else what happens to be at the last line in the logfile

Thanks for the info!

Last night I charged my DualSense using my Pixel 2 XL charger which is a "native USB-C one" (5 V, 9 V, and so on) and suddenly my DualSense reports the voltage correctly and doesn't lose its charge. Looks like you have to use a high-powered charger to keep this thing working correctly.

DaRkL3AD3R commented 3 years ago

Just posting that the new Midnight Black controllers still have the dead battery overnight issue and also have the misreported battery % when comparing USB vs BT: https://i.imgur.com/LEVkp6t.png

It seems more consistently wrong now where BT always reports higher battery life than USB. EG USB claims the battery is at 25% then a minute later disconnect and switch to BT and it will claim 62%. Really frustrating how buggy this thing is.

an3k commented 3 years ago

As I said, I "fixed" my white controller by charging it once with a high power USB-C charger. I think the charger has to be USB-PD compatible, not just high power.

Nimish2711 commented 1 year ago

Facing same issue ds4 struck on 0% while i charged it for 2 hour still ds4 showing 0% anyone have solution

JamieStivala commented 1 year ago

Sony released a PC firmware updater which can be found here: https://controller.dl.playstation.net/controller/lang/en/fwupdater.html

Nimish2711 commented 1 year ago

I have updated firmware but problem is still here now i am charging it with my 45w charger and its showing 25%