Comments (16)
Wow that's so cool! Manufacturers sure know how to make things interesting 😂
from acc.
Just to make things more fun I found out that if current_cmd
is toggled on while the device is not plugged in, the battery will report "charging". Yes really -_-
from acc.
A while ago, I came across /proc/mtk_battery_cmd/current_cmd "0 0" "0 1"
. Is that your switch as well?
ACC is undergoing major changes. As part of these, several config variables are now arrays (e.g., chargingSwitch=(/proc/mtk_battery_cmd/current_cmd "0 0" "0 1")
).
If you want to try experimental builds, message me on https://t.me/vr25xda (preferred), https://fb.me/vr25xda or https://m.me/vr25xda .
Thanks!
from acc.
Yep, that's the switch (btw it's a Blackview 9600 Pro).
One unrelated thing I've noticed is that toggling it stops charging but keeps the battery at that level, while to make it actually discharge I need to toggle en_power_path
as well.
As for trying the experimental builds, thanks a lot for the offer, but unfortunately I cannot tinker much with this device as it is the primary phone of a friend :(
from acc.
I can't get enough of Mediatek's "nice" surprises. Holly nuts!
Could you elaborate more on en_power_path
? I can make acc toggle it.
from acc.
So /proc/mtk_battery_cmd/en_power_path
is normally 1, when set to 0 it stops charging and also begins discharging but there is a catch: the battery status always remains "charging" , so acc doesn't work.
To get the complete behaviour (battery stops charging, starts discharging and reports the correct status) one has to toggle both en_power_path
and current_cmd
.
from acc.
Interesting and Intriguing!
This will give birth to a new feature: toggling multiple switches at once.
from acc.
Terrible Design!
Lets say the device is plugged in and charging. After charging is disabled (i.e., through toggling the 2 switches), is it enabled automatically on replug, without toggling the switches back?
Were you able to find any file that reports the correct external power supply status (i.e., plugged/unplugged)?
Still on this question, does su -c acpi -a
do that?
from acc.
Sorry for the delay, I managed to get some time with the phone to run the tests. The results are braindead haha
- Once one touches current_cmd it becomes fully manual, ie the phone won't charge when plugged in unless the switch is toggled
- acpi -a reports two adapters, "Adapter 0" seems to reliably indicate whether the phone is plugged in while "Adapter 1" is always "Off-line"
from acc.
Finally, at least one pleasant surprise... hopefully! 😁
If acpi -a
really reports the correct external power supply status (plugged/unplugged), regardless of whether switches were toggled, we have a winner.
From acpi -a
and battery/status
's data combination, we have three basic battery statuses:
- Plugged in and charging (at least one adapter online AND battery/status == "charging")
- Plugged in, but not charging (at least one adapter online AND battery/status == "discharging|not charging")
- Unplugged and discharging (all adapters offline)
I just finished implementing and testing the "multiple switches toggling" feature. It's ready for third-party testing. I'm in touch with another MTK user - who will be testing the real deal.
from acc.
That's great! So to ensure that the braindead status "unplugged but charging" never happens I guess acc will have to toggle the switches when it detects an unplug haha
from acc.
Thou Shalt Go Mad.
MediaTek Inc.
from acc.
I implemented everything we discussed so far.
Even though this is a pre-release, the daemon is pretty much stable at this point.
https://www.dropbox.com/s/cdfok5fek2g5z5f/acc-202001180.zip?dl=0
Notes
-
Don't use acc -s|--set for editing the config. It's not ready yet. Use acc -c|--config EDITOR OPTS instead (e.g., acc -c vim). If you run just
acc -c
, the fallback editors are nano -l > vim > vi. You can always edit /data/adb/acc-data/config.txt with any other means. -
Apparently, MTK requires a [slightly] longer delay after toggling the switches - for changes to take effect. ACC has the config variable switchDelay (default: 1 second). You may want to increase that before performing any testing - and play with it along the way. This is because, in auto mode (chargingSwitch unset), switch_cycle() is in charge. After switchDelay, it resets switches which don't work. That's where the default delay can be an issue.
switchDelay=10
is a good starting point. -
If you don't want to play with switchDelay right now, set
chargingSwitch=(/proc/mtk_battery_cmd/current_cmd "0 0" "0 1" /proc/mtk_battery_cmd/en_power_path 1 0)
and test whetheracc -d
disables charging - andacc -e
re-enables it. This is the manual/daemon-less mode. -
The documentation is not fully updated yet. At this point, besides switchDelay and chargingSwitch[@], the only other values you have to care about are
capacity[2]
(resume, default: 75) andcapacity[3]
(stop, default: 80).
from acc.
Wow that's great! I can't wait to try it, as soon as I see my friend I'll try and report back
from acc.
So I finally got the chance to test (sorry for the delay!), but I'm running into a weird problem: I flashed the zip with magisk but apparently it gets installed into /sbin/.magisk/modules/acc/ but not into /sbin/.acc/, and this prevents it from starting... if i try manually I get like
Blackview:/ # /sbin/.magisk/modules/acc/acc.sh
/sbin/.magisk/modules/acc/acc.sh[466]: .: /sbin/.acc/acc/setup-busybox.sh: No such file or directory
I'm probably missing something obvious sorry
from acc.
@kbios, the repo is up-to-date.
Dowload the latest version: https://GitHub.com/VR-25/ACC/archive/dev.zip .
Extract the zip and run the following to install:
$ su
# sh /path/to/extracted/install-current.sh
from acc.
Related Issues (20)
- Battery jump between idle and charging during idle mode HOT 4
- How exactly does native battery idle mode work? HOT 1
- nexus 10 (manta) failed to install acc HOT 1
- Update app on F-droid or upload to IzzyOnDroid HOT 1
- Fast charging & Mar 2024 update HOT 6
- Pixel 5 Idle Configuration Help HOT 4
- Redmi 7 issues HOT 6
- resetBsOnPause and resetBsOnUnplug not working on Pixel 8 / Android 14 HOT 1
- Charging Does Not Stop At Pause Capacity HOT 9
- Battery is slowly draining with Idle mode enabled HOT 10
- Xiaomi Poco X4 Issues HOT 1
- v2024.4.7-rc fails with segfault HOT 15
- Charge % limit not working with wireless charging on OnePlus 12 HOT 4
- Pixel 6 latest version intermittent charging HOT 3
- damon stopped with exit code 1 pixel 8 A14 HOT 13
- "Charge once" becomes permanent until restarting acc HOT 3
- Can you add support for APatch? Installation failed in APatch. HOT 1
- acca crashes with latest build HOT 2
- OnePlus 9 Pro
- Nothing phone 2a HOT 1
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 acc.