Skip to content

Commit

Permalink
**v2021.9.20 (202109200)**
Browse files Browse the repository at this point in the history
- General enhancements
- Manual capacitySync toggle (`[capacity_sync|cs] = [true|false]`) - it overrides the automatic. Both include the `freeze at 2%` feature. This is the actual `capacity_freeze2` replacement now. `capacity_mask` implies `capacity_sync`.
- Unlike in previous versions, changes to `capacity_mask` and `capacity_sync` take effect (within a few seconds) without a daemon restart.
- Updated documentation
  • Loading branch information
VR-25 committed Sep 20, 2021
1 parent 4663ba7 commit 3eaf5d4
Show file tree
Hide file tree
Showing 9 changed files with 195 additions and 102 deletions.
59 changes: 40 additions & 19 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ <h1 id="advanced-charging-controller-acc">Advanced Charging Controller (ACC)</h1
<li><a href="#initializing-acc">Initializing ACC</a></li>
<li><a href="#managing-acc">Managing ACC</a></li>
<li><a href="#the-output-of---info">The Output of --info</a></li>
<li><a href="#profiles">Profiles</a></li>
<li><a href="#more">More</a></li>
</ul>
</li>
Expand Down Expand Up @@ -281,8 +282,8 @@ <h4 id="notes-2">Notes</h4>
<h2 id="default-configuration">DEFAULT CONFIGURATION</h2>
<pre><code><code><div>#DC#

configVerCode=202109190
capacity=(-1 60 70 75 false)
configVerCode=202109200
capacity=(-1 60 70 75 false false)
temperature=(40 60 90 65)
cooldownRatio=()
cooldownCurrent=
Expand Down Expand Up @@ -319,16 +320,16 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION</h2>

# NOTES

# The daemon does not have to be restarted after making changes to this file - unless one of the changes is capacity_mask or charging_switch.
# The daemon does not have to be restarted after making changes to this file - unless one of the changes is charging_switch.

# Changes to current_workaround (cw) only take effect after an acc [re]initialization (install, upgrade or accd --init) or system reboot.
# A change to current_workaround (cw) only takes effect after an acc [re]initialization (install, upgrade or &quot;accd --init&quot;) or system reboot.

# If those 3 variables are updated with &quot;acc --set&quot;, accd is restarted automatically (--init is implied as needed).
# If those 2 variables are updated with &quot;acc --set&quot; (not acca --set), accd is restarted automatically (--init is implied as needed).


# BASICS

# capacity=(shutdown_capacity cooldown_capacity resume_capacity pause_capacity capacity_mask)
# capacity=(shutdown_capacity cooldown_capacity resume_capacity pause_capacity capacity_sync capacity_mask)

# temperature=(cooldown_temp max_temp max_temp_pause shutdown_temp)

Expand Down Expand Up @@ -374,6 +375,7 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION</h2>
# cc cooldown_capacity
# rc resume_capacity
# pc pause_capacity
# cs capacity_sync
# cm capacity_mask

# sc shutdown_capacity
Expand Down Expand Up @@ -466,10 +468,16 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION</h2>
# pause_capacity (pc) #
# Capacity or voltage_now_millivolts at which charging should pause.

# capacity_sync (cs) #
# Some devices, notably from the Pixel lineup, have a capacity discrepancy issue between Android and the kernel.
# This forces Android to report the actual battery capacity supplied by the kernel.
# The discrepancy is usually detected and corrected automatically by accd.
# This setting overrides the automatic behavior.
# Besides, it also prevents Android from getting capacity readings below 2%, since some systems shutdown before battery level actually drops to 0%.

# capacity_mask (cm) #
# This forces Android to report &quot;capacity = capacity * (100 / pause_capacity)&quot;, effectively masking capacity limits.
# It also prevents Android from getting capacity readings below 2% (because some systems shutdown before battery level actually drops to 0%).
# A daemon restart is required after changing this (automated by &quot;acc --set&quot;).
# This forces Android to report &quot;capacity = capacity * (100 / pause_capacity)&quot;, effectively masking capacity limits (more like capacity_sync on steroids).
# It also prevents Android from getting capacity readings below 2%, since some systems shutdown before battery level actually drops to 0%.

# cooldown_temp (ct) #
# Temperature (°C) at which the cooldown cycle starts.
Expand Down Expand Up @@ -894,21 +902,34 @@ <h3 id="the-output-of---info">The Output of --info</h3>
POWER_NOW=0 # (CURRENT_NOW * VOLTAGE_NOW) (Watts)</p>
<p>Note that the power information refers to what is actually supplied to the battery, not what's coming from the adapter.
External power is always converted before it reaches the battery.</p>
<h3 id="profiles">Profiles</h3>
<p>Those are simply different config files.
A config path can be supplied as first argument to <code>acca</code> and second to <code>accd</code> executables.</p>
<p>Examples:</p>
<p><em>Copy the config:</em></p>
<p>Current config: <code>/dev/.vr25/acc/acca --config cat &gt; /path/to/new/file</code></p>
<p>Default config: <code>/dev/.vr25/acc/acca /path/to/new/file --version</code> (<code>--version</code> can be replaced with any option + arguments, as seen below.)</p>
<p><em>Edit the copy:</em></p>
<p><code>/dev/.vr25/acc/acca /path/to/new/file --set pause_capacity=75 resume_capacity=70</code> (if the file does not exist, it is created as a copy of the default config.)</p>
<p><em>Use the copy:</em></p>
<p><code>/dev/.vr25/acc/accd --init /path/to/new/file</code> (the daemon is restarted with the new config.)</p>
<p><em>Back to the main config:</em></p>
<p><code>/dev/.vr25/acc/accd --init</code></p>
<h3 id="more">More</h3>
<p>ACC daemon does not have to be restarted after making changes to the config.
It picks up new changes within seconds.</p>
<p>There are a few exceptions:</p>
<ul>
<li><code>capacity_mask</code> (<code>cm</code>) and <code>charging_switch</code> (<code>s</code>) requires a daemon restart.</li>
<li><code>current_workaround</code> (<code>cw</code>) requires <code>accd --init</code>.</li>
<li><code>charging_switch</code> (<code>s</code>) requires a daemon restart (<code>/dev/.vr25/acc/accd</code>).</li>
<li><code>current_workaround</code> (<code>cw</code>) requires a full re-initialization (<code>/dev/.vr25/acc/accd --init</code>).</li>
</ul>
<p>This information is in the <a href="#default-configuration">default configuration</a> section as well.</p>
<hr>
<h2 id="troubleshooting">TROUBLESHOOTING</h2>
<h3 id="battery-capacity--level-doesnt-seem-right">Battery Capacity (% Level) Doesn't Seem Right</h3>
<p>When Android's battery level differs from that of the kernel, ACC daemon automatically syncs it by stopping the battery service and feeding it the real value every few seconds.</p>
<p>Pixel devices are known for having battery level discrepancies for the longest time.</p>
<p>If your device shuts down before the battery is actually empty, capacity_mask may help.
<p>If your device shuts down before the battery is actually empty, capacity_sync or capacity_mask may help.
Refer to the <a href="#default-configuration">default configuration</a> section above for details.</p>
<h3 id="bootloop">Bootloop</h3>
<p>While uncommon, it may happen.</p>
Expand Down Expand Up @@ -1202,13 +1223,6 @@ <h2 id="links">LINKS</h2>
</ul>
<hr>
<h2 id="latest-changes">LATEST CHANGES</h2>
<p><strong>v2021.8.31 (202108310)</strong></p>
<ul>
<li>Additional charging switches</li>
<li>Fixed &quot;current_now is always 0 mA.&quot;</li>
<li>Logs are exported as a tarball archive.</li>
<li>Updated readme &gt; notes/tips for front-end developers &gt; initializing acc</li>
</ul>
<p><strong>v2021.9.5 (202109050)</strong></p>
<ul>
<li>Additional charging switches (including a group of 3 for OnePlus that allegedly enable idle mode)</li>
Expand All @@ -1230,6 +1244,13 @@ <h2 id="latest-changes">LATEST CHANGES</h2>
<li>Support for &quot;volatile&quot; plugins (gone on reboot, useful for debugging): <code>/dev/.vr25/acc/plugins/</code></li>
<li>Updated documentation (mainly tips &gt; idle mode and alternatives)</li>
<li>Upgrade rollback feature (<code>-b|--rollback</code> or wizard option <code>f</code>)</li>
</ul>
<p><strong>v2021.9.20 (202109200)</strong></p>
<ul>
<li>General enhancements</li>
<li>Manual capacitySync toggle (<code>[capacity_sync|cs] = [true|false]</code>) - it overrides the automatic. Both include the <code>freeze at 2%</code> feature. This is the actual <code>capacity_freeze2</code> replacement now. <code>capacity_mask</code> implies <code>capacity_sync</code>.</li>
<li>Unlike in previous versions, changes to <code>capacity_mask</code> and <code>capacity_sync</code> take effect (within a few seconds) without a daemon restart.</li>
<li>Updated documentation</li>
</ul>

</body>
Expand Down
75 changes: 55 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- [Initializing ACC](#initializing-acc)
- [Managing ACC](#managing-acc)
- [The Output of --info](#the-output-of---info)
- [Profiles](#profiles)
- [More](#more)
- [TROUBLESHOOTING](#troubleshooting)
- [Battery Capacity (% Level) Doesn't Seem Right](#battery-capacity--level-doesnt-seem-right)
Expand Down Expand Up @@ -239,8 +240,8 @@ In interactive mode, it also asks the user whether they want to download and ins
```
#DC#
configVerCode=202109190
capacity=(-1 60 70 75 false)
configVerCode=202109200
capacity=(-1 60 70 75 false false)
temperature=(40 60 90 65)
cooldownRatio=()
cooldownCurrent=
Expand Down Expand Up @@ -277,16 +278,16 @@ currentWorkaround=false
# NOTES
# The daemon does not have to be restarted after making changes to this file - unless one of the changes is capacity_mask or charging_switch.
# The daemon does not have to be restarted after making changes to this file - unless one of the changes is charging_switch.
# Changes to current_workaround (cw) only take effect after an acc [re]initialization (install, upgrade or accd --init) or system reboot.
# A change to current_workaround (cw) only takes effect after an acc [re]initialization (install, upgrade or "accd --init") or system reboot.
# If those 3 variables are updated with "acc --set", accd is restarted automatically (--init is implied as needed).
# If those 2 variables are updated with "acc --set" (not acca --set), accd is restarted automatically (--init is implied as needed).
# BASICS
# capacity=(shutdown_capacity cooldown_capacity resume_capacity pause_capacity capacity_mask)
# capacity=(shutdown_capacity cooldown_capacity resume_capacity pause_capacity capacity_sync capacity_mask)
# temperature=(cooldown_temp max_temp max_temp_pause shutdown_temp)
Expand Down Expand Up @@ -332,6 +333,7 @@ currentWorkaround=false
# cc cooldown_capacity
# rc resume_capacity
# pc pause_capacity
# cs capacity_sync
# cm capacity_mask
# sc shutdown_capacity
Expand Down Expand Up @@ -424,10 +426,17 @@ currentWorkaround=false
# pause_capacity (pc) #
# Capacity or voltage_now_millivolts at which charging should pause.
# capacity_sync (cs) #
# Some devices, notably from the Pixel lineup, have a capacity discrepancy issue between Android and the kernel.
# capacity_sync forces Android to report the actual battery capacity supplied by the kernel.
# The discrepancy is usually detected and corrected automatically by accd.
# This setting overrides the automatic behavior.
# Besides, it also prevents Android from getting capacity readings below 2%, since some systems shutdown before battery level actually drops to 0%.
# capacity_mask (cm) #
# This forces Android to report "capacity = capacity * (100 / pause_capacity)", effectively masking capacity limits.
# It also prevents Android from getting capacity readings below 2% (because some systems shutdown before battery level actually drops to 0%).
# A daemon restart is required after changing this (automated by "acc --set").
# Implies capacity_sync.
# This forces Android to report "capacity = capacity * (100 / pause_capacity)", effectively masking capacity limits (more like capacity_sync on steroids).
# It also prevents Android from getting capacity readings below 2%, since some systems shutdown before battery level actually drops to 0%.
# cooldown_temp (ct) #
# Temperature (°C) at which the cooldown cycle starts.
Expand Down Expand Up @@ -903,15 +912,41 @@ Note that the power information refers to what is actually supplied to the batte
External power is always converted before it reaches the battery.


### Profiles

Those are simply different config files.
A config path can be supplied as first argument to `acca` and second to `accd` executables.

Examples:

_Copy the config:_

Current config: `/dev/.vr25/acc/acca --config cat > /path/to/new/file`

Default config: `/dev/.vr25/acc/acca /path/to/new/file --version` (`--version` can be replaced with any option + arguments, as seen below.)

_Edit the copy:_

`/dev/.vr25/acc/acca /path/to/new/file --set pause_capacity=75 resume_capacity=70` (if the file does not exist, it is created as a copy of the default config.)

_Use the copy:_

`/dev/.vr25/acc/accd --init /path/to/new/file` (the daemon is restarted with the new config.)

_Back to the main config:_

`/dev/.vr25/acc/accd --init`


### More

ACC daemon does not have to be restarted after making changes to the config.
It picks up new changes within seconds.

There are a few exceptions:

- `capacity_mask` (`cm`) and `charging_switch` (`s`) requires a daemon restart.
- `current_workaround` (`cw`) requires `accd --init`.
- `charging_switch` (`s`) requires a daemon restart (`/dev/.vr25/acc/accd`).
- `current_workaround` (`cw`) requires a full re-initialization (`/dev/.vr25/acc/accd --init`).

This information is in the [default configuration](#default-configuration) section as well.

Expand All @@ -926,7 +961,7 @@ When Android's battery level differs from that of the kernel, ACC daemon automat

Pixel devices are known for having battery level discrepancies for the longest time.

If your device shuts down before the battery is actually empty, capacity_mask may help.
If your device shuts down before the battery is actually empty, capacity_sync or capacity_mask may help.
Refer to the [default configuration](#default-configuration) section above for details.


Expand Down Expand Up @@ -1327,14 +1362,6 @@ A common workaround is having `resume_capacity = pause_capacity - 1`. e.g., resu
## LATEST CHANGES


**v2021.8.31 (202108310)**

- Additional charging switches
- Fixed "current_now is always 0 mA."
- Logs are exported as a tarball archive.
- Updated readme > notes/tips for front-end developers > initializing acc


**v2021.9.5 (202109050)**

- Additional charging switches (including a group of 3 for OnePlus that allegedly enable idle mode)
Expand All @@ -1357,3 +1384,11 @@ A common workaround is having `resume_capacity = pause_capacity - 1`. e.g., resu
- Support for "volatile" plugins (gone on reboot, useful for debugging): `/dev/.vr25/acc/plugins/`
- Updated documentation (mainly tips > idle mode and alternatives)
- Upgrade rollback feature (`-b|--rollback` or wizard option `f`)


**v2021.9.20 (202109200)**

- General enhancements
- Manual capacitySync toggle (`[capacity_sync|cs] = [true|false]`) - it overrides the automatic. Both include the `freeze at 2%` feature. This is the actual `capacity_freeze2` replacement now. `capacity_mask` implies `capacity_sync`.
- Unlike in previous versions, changes to `capacity_mask` and `capacity_sync` take effect (within a few seconds) without a daemon restart.
- Updated documentation
Loading

0 comments on commit 3eaf5d4

Please sign in to comment.