VR-25 / acc

Advanced Charging Controller
https://github.com/Magisk-Modules-Repo/acc
GNU General Public License v3.0
1.71k stars 107 forks source link

Battery jump between idle and charging during idle mode #237

Closed feather-47 closed 6 months ago

feather-47 commented 7 months ago

Phone: Galaxy Note 10 ROM: SealROMv7 I've flashed the newest .zip (202401260), acc -i report STATUS=Idle with charging_switch=battery/hmt_ta_charge 1 0 -- so Idle mode work. When running an app in idle_app, i noticed that battery slowly charged up, acc -w showed the battery to be idle for ~11s then switched to charging for also ~11s then repeat. I've only tried to address it with accd and rerunning the test with acc -t and acc -ss.

acc -le acc-logs-d1.tgz.zip

VR-25 commented 7 months ago

The Android API used for getting information of the currently running foreground app is not very reliable. I'll add a tolerance to mitigate the fluctuations.

feather-47 commented 7 months ago

I just notice it today but, idle mode seem to be working properly if resume_capacity < CAPACITY < pause_capacity At first, it was 80 < 82 < 85, idle mode ran smoothly, battery even slowly discharged as if it wasn't emulated. Then i let it discharge to <80 and fluctuation appeared. So i set acc -s rc= lower than the CAPACITY then and idle mode worked smoothly again. But then, idle mode would still continue after i have closed the app, unless i unplug and replug the cable. This also happened during the 202401190 dev build i think.

axet commented 7 months ago

I have similar issues with my Nexus 5 device. When I ran 'acc 50 40' device is not charging. But monitoring CURRENT= showing values from -2000 to 2000 it seems charger is not turned off completely and keep maintaining battery level.

Web showing some answers:

Here are two modes available for devices: 'ac/charging_enabled' and 'battery/battery_charging_enabled' first suppose to cut power off completely and battery_charging_enabled suppose to maintain current battery charge level. Seems like some devices misbehave and using only one preferred mode. It maybe kernel issue or IC issue.

EDIT: I guess acc can detect such behaviour and report it back to the user (you can see 4mA while idle):

1/6: ac/charging_enabled 1 0
  switch: off (0)   current: 4mA    status: Idle
  switch: off (0)   current: 6mA    status: Idle
  switch: on (1)    current: 953mA  status: Charging
  Switch works ✅
- battIdleMode=true
feather-47 commented 6 months ago

Idle mode worked properly with new dev update