adjustor 2.1.0__tar.gz → 2.1.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {adjustor-2.1.0/src/adjustor.egg-info → adjustor-2.1.2}/PKG-INFO +1 -1
- {adjustor-2.1.0 → adjustor-2.1.2}/pyproject.toml +1 -1
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/asus/__init__.py +29 -17
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/asus/settings.yml +12 -13
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/hhd.py +17 -11
- {adjustor-2.1.0 → adjustor-2.1.2/src/adjustor.egg-info}/PKG-INFO +1 -1
- {adjustor-2.1.0 → adjustor-2.1.2}/LICENSE +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/MANIFEST.in +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/readme.md +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/setup.cfg +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/__init__.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/__main__.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/core/__init__.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/core/acpi.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/core/alib.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/core/const.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/core/lenovo.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/core/platform.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/__init__.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/lenovo/__init__.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/lenovo/settings.yml +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/smu/__init__.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/smu/qam.yml +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/drivers/smu/smu.yml +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/events.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/settings.yml +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor/utils.py +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor.egg-info/SOURCES.txt +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor.egg-info/dependency_links.txt +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor.egg-info/entry_points.txt +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor.egg-info/requires.txt +0 -0
- {adjustor-2.1.0 → adjustor-2.1.2}/src/adjustor.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: adjustor
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.2
|
4
4
|
Summary: Adjustor, a userspace program for managing the TDP of handheld devices.
|
5
5
|
Author-email: Kapenekakis Antheas <pypi@antheas.dev>
|
6
6
|
Project-URL: Homepage, https://github.com/hhd-dev/adjustor
|
@@ -73,6 +73,8 @@ def set_fan_curve(points: list[int], curve: list[int]):
|
|
73
73
|
for fan in (1, 2):
|
74
74
|
with open(os.path.join(dir, f"pwm{fan}_enable"), "w") as f:
|
75
75
|
f.write(f"1")
|
76
|
+
if fan == 1:
|
77
|
+
time.sleep(TDP_DELAY)
|
76
78
|
|
77
79
|
return True
|
78
80
|
|
@@ -87,14 +89,16 @@ def disable_fan_curve():
|
|
87
89
|
|
88
90
|
for fan in (1, 2):
|
89
91
|
with open(os.path.join(dir, f"pwm{fan}_enable"), "w") as f:
|
90
|
-
f.write(f"
|
92
|
+
f.write(f"2")
|
93
|
+
if fan == 1:
|
94
|
+
time.sleep(TDP_DELAY)
|
91
95
|
|
92
96
|
return True
|
93
97
|
|
94
98
|
|
95
99
|
class AsusDriverPlugin(HHDPlugin):
|
96
100
|
def __init__(self) -> None:
|
97
|
-
self.name = f"
|
101
|
+
self.name = f"adjustor_asus"
|
98
102
|
self.priority = 6
|
99
103
|
self.log = "adja"
|
100
104
|
self.enabled = False
|
@@ -116,7 +120,7 @@ class AsusDriverPlugin(HHDPlugin):
|
|
116
120
|
self.initialized = True
|
117
121
|
out = {"tdp": {"asus": load_relative_yaml("settings.yml")}}
|
118
122
|
if not self.enforce_limits:
|
119
|
-
out["tdp"]["asus"]["children"]["tdp"]["max"] =
|
123
|
+
out["tdp"]["asus"]["children"]["tdp"]["max"] = 50
|
120
124
|
return out
|
121
125
|
|
122
126
|
def open(
|
@@ -189,17 +193,19 @@ class AsusDriverPlugin(HHDPlugin):
|
|
189
193
|
|
190
194
|
self.queue_tdp = None
|
191
195
|
if boost:
|
192
|
-
|
196
|
+
time.sleep(TDP_DELAY)
|
197
|
+
set_tdp("fast", FTDP_FN, min(MAX_TDP, int(steady * 53 / 30)))
|
193
198
|
time.sleep(TDP_DELAY)
|
194
199
|
set_tdp("slow", STDP_FN, min(MAX_TDP, int(steady * 43 / 30)))
|
195
200
|
time.sleep(TDP_DELAY)
|
196
|
-
set_tdp("fast", FTDP_FN, min(MAX_TDP, int(steady * 53 / 30)))
|
197
|
-
else:
|
198
201
|
set_tdp("steady", CTDP_FN, steady)
|
202
|
+
else:
|
203
|
+
time.sleep(TDP_DELAY)
|
204
|
+
set_tdp("fast", FTDP_FN, steady)
|
199
205
|
time.sleep(TDP_DELAY)
|
200
206
|
set_tdp("slow", STDP_FN, steady)
|
201
207
|
time.sleep(TDP_DELAY)
|
202
|
-
set_tdp("
|
208
|
+
set_tdp("steady", CTDP_FN, steady)
|
203
209
|
|
204
210
|
# Handle fan curve resets
|
205
211
|
if conf["tdp.asus.fan.manual.reset"].to(bool):
|
@@ -207,31 +213,37 @@ class AsusDriverPlugin(HHDPlugin):
|
|
207
213
|
for k, v in zip(POINTS, DEFAULT_CURVE):
|
208
214
|
conf[f"tdp.asus.fan.manual.st{k}"] = v
|
209
215
|
|
210
|
-
# Handle fan curve limits
|
211
|
-
if conf["tdp.asus.fan.manual.enforce_limits"].to(bool):
|
212
|
-
|
213
|
-
|
214
|
-
|
216
|
+
# # Handle fan curve limits
|
217
|
+
# if conf["tdp.asus.fan.manual.enforce_limits"].to(bool):
|
218
|
+
# for k, v in zip(POINTS, MIN_CURVE):
|
219
|
+
# if conf[f"tdp.asus.fan.manual.st{k}"].to(int) < v:
|
220
|
+
# conf[f"tdp.asus.fan.manual.st{k}"] = v
|
215
221
|
|
216
222
|
# Check if fan curve has changed
|
217
223
|
# Use debounce logic on these changes
|
218
224
|
if tdp_set and conf["tdp.asus.fan.mode"].to(str) == "manual":
|
219
225
|
self.queue_fan = curr + APPLY_DELAY
|
220
|
-
if conf["tdp.asus.fan.mode"].to(str) != self.old_conf["fan.mode"].to(str):
|
221
|
-
self.queue_fan = curr + APPLY_DELAY
|
222
226
|
for i in POINTS:
|
223
227
|
if conf[f"tdp.asus.fan.manual.st{i}"].to(int) != self.old_conf[
|
224
228
|
f"fan.manual.st{i}"
|
225
229
|
].to(int):
|
226
230
|
self.queue_fan = curr + APPLY_DELAY
|
231
|
+
# If mode changes, only apply curve if set to manual
|
232
|
+
# otherwise disable and reset tdp
|
233
|
+
if conf["tdp.asus.fan.mode"].to(str) != self.old_conf["fan.mode"].to(str):
|
234
|
+
if conf["tdp.asus.fan.mode"].to(str) == "manual":
|
235
|
+
self.queue_fan = curr + APPLY_DELAY
|
236
|
+
else:
|
237
|
+
try:
|
238
|
+
disable_fan_curve()
|
239
|
+
except Exception as e:
|
240
|
+
logger.error(f"Could not disable fan curve. Error:\n{e}")
|
241
|
+
self.queue_tdp = curr + APPLY_DELAY
|
227
242
|
|
228
243
|
apply_curve = self.queue_fan and self.queue_fan < curr
|
229
244
|
if apply_curve:
|
230
245
|
try:
|
231
|
-
# Always disable fan curve first
|
232
|
-
disable_fan_curve()
|
233
246
|
if conf["tdp.asus.fan.mode"].to(str) == "manual":
|
234
|
-
time.sleep(TDP_DELAY)
|
235
247
|
set_fan_curve(
|
236
248
|
POINTS,
|
237
249
|
[
|
@@ -2,7 +2,7 @@ title: Asus TDP
|
|
2
2
|
type: container
|
3
3
|
tags: [hide-title]
|
4
4
|
hint: >-
|
5
|
-
Uses the interface of
|
5
|
+
Uses the interface of Armory Crate to set the TDP of the device.
|
6
6
|
children:
|
7
7
|
tdp:
|
8
8
|
type: int
|
@@ -10,15 +10,14 @@ children:
|
|
10
10
|
hint: >-
|
11
11
|
Average TDP Target.
|
12
12
|
|
13
|
-
Sets the values STAMP and Skin Power Limit to it.
|
14
|
-
|
15
|
-
limit to +2W.
|
13
|
+
Sets the values STAMP and Skin Power Limit to it without boost.
|
14
|
+
With boost, it sets the fast value to 53/30*tdp and the slow value to 43/30*tdp.
|
16
15
|
Boost is recommended for desktop use.
|
17
16
|
|
18
17
|
min: 5
|
19
18
|
max: 30
|
20
19
|
step: 1
|
21
|
-
default:
|
20
|
+
default: 15
|
22
21
|
unit: W
|
23
22
|
boost:
|
24
23
|
type: bool
|
@@ -84,16 +83,16 @@ children:
|
|
84
83
|
<<: *speed_template
|
85
84
|
title: 100C
|
86
85
|
default: 75
|
87
|
-
|
88
|
-
enforce_limits:
|
89
|
-
title: Enforce Minimums
|
90
|
-
type: bool
|
91
|
-
default: True
|
92
|
-
hint: >-
|
93
|
-
Enforce a reasonable minimum fan curve.
|
94
86
|
|
95
87
|
reset:
|
96
88
|
title: Restore Default
|
97
89
|
type: action
|
98
90
|
hint: >-
|
99
|
-
Restore a default sane fan curve.
|
91
|
+
Restore a default sane fan curve.
|
92
|
+
|
93
|
+
disclaimer:
|
94
|
+
title: Fan Curve Limitation
|
95
|
+
type: display
|
96
|
+
default: >-
|
97
|
+
Asus hardware limits the minimum fan curve depending on TDP.
|
98
|
+
The minimums are 25%, 50%, and 75% for low, middle, and high TDPs.
|
@@ -22,7 +22,7 @@ CONFLICTING_PLUGINS = {
|
|
22
22
|
|
23
23
|
|
24
24
|
class AdjustorInitPlugin(HHDPlugin):
|
25
|
-
def __init__(self) -> None:
|
25
|
+
def __init__(self, use_acpi_call: bool = True) -> None:
|
26
26
|
self.name = f"adjustor_init"
|
27
27
|
self.priority = 5
|
28
28
|
self.log = "adji"
|
@@ -31,6 +31,7 @@ class AdjustorInitPlugin(HHDPlugin):
|
|
31
31
|
self.safe_mode = False
|
32
32
|
self.enabled = False
|
33
33
|
self.action_enabled = False
|
34
|
+
self.use_acpi_call = use_acpi_call
|
34
35
|
|
35
36
|
def open(self, emit: Emitter, context: Context):
|
36
37
|
self.context = context
|
@@ -78,15 +79,16 @@ class AdjustorInitPlugin(HHDPlugin):
|
|
78
79
|
self.enabled = False
|
79
80
|
return
|
80
81
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
"
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
82
|
+
if self.use_acpi_call:
|
83
|
+
initialize()
|
84
|
+
if not check_perms():
|
85
|
+
conf["hhd.settings.tdp_enable"] = False
|
86
|
+
conf["tdp.tdp.tdp_error"] = (
|
87
|
+
"Can not write to 'acpi_call'. It is required for TDP."
|
88
|
+
)
|
89
|
+
self.failed = True
|
90
|
+
self.enabled = False
|
91
|
+
return
|
90
92
|
|
91
93
|
self.failed = False
|
92
94
|
self.enabled = True
|
@@ -177,10 +179,12 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
|
|
177
179
|
with open("/proc/cpuinfo") as f:
|
178
180
|
cpuinfo = f.read().strip()
|
179
181
|
|
182
|
+
use_acpi_call = False
|
180
183
|
drivers_matched = False
|
181
184
|
if prod == "83E1":
|
182
185
|
drivers.append(LenovoDriverPlugin())
|
183
186
|
drivers_matched = True
|
187
|
+
use_acpi_call = True
|
184
188
|
|
185
189
|
if "ROG Ally RC71L" in prod:
|
186
190
|
drivers.append(AsusDriverPlugin())
|
@@ -205,6 +209,7 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
|
|
205
209
|
),
|
206
210
|
)
|
207
211
|
drivers_matched = True
|
212
|
+
use_acpi_call = True
|
208
213
|
|
209
214
|
if not drivers_matched:
|
210
215
|
for name, (dev, cpu) in CPU_DATA.items():
|
@@ -219,6 +224,7 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
|
|
219
224
|
drivers.append(
|
220
225
|
SmuQamPlugin(dev, ROG_ALLY_PP_MAP),
|
221
226
|
)
|
227
|
+
use_acpi_call = True
|
222
228
|
break
|
223
229
|
|
224
230
|
if not drivers:
|
@@ -227,6 +233,6 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
|
|
227
233
|
|
228
234
|
return [
|
229
235
|
*drivers,
|
230
|
-
AdjustorInitPlugin(),
|
236
|
+
AdjustorInitPlugin(use_acpi_call=use_acpi_call),
|
231
237
|
AdjustorPlugin(),
|
232
238
|
]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: adjustor
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.2
|
4
4
|
Summary: Adjustor, a userspace program for managing the TDP of handheld devices.
|
5
5
|
Author-email: Kapenekakis Antheas <pypi@antheas.dev>
|
6
6
|
Project-URL: Homepage, https://github.com/hhd-dev/adjustor
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|