Comments (12)
Yeah, legiond was originally intended to replace the fancurve-set script (which was really, really slow and has no timer support).
It works well, at least for this purpose, converting the most time-consuming process of using legion_cli to non-blocking, as well as simpler configuration (at least for the user, that is)
The current legiond still works fine and remains low on resources when you press fn+q hysterically. This is actually the main issue I want to deal with.
from lenovolegionlinux.
I actually think that this daemon may not have any more functionality that can still be added, except for fn+r.
Maybe the effort put into converting to python code wasn't quite worth it? But I'm in favor of reducing code that has duplicate functionality, if it's done without sacrificing efficiency (powerstate.c is still fast when not using ppd)
from lenovolegionlinux.
I actually think that this daemon may not have any more functionality that can still be added, except for fn+r.
The fn+r will be a bit challenged I will have to give a look at the ideapad_driver on the Linux kernel and create a patch to add the missing Lenovo button (the missing button are fn+r, fn+printscr and fn+start if I not missing any)
Maybe the effort put into converting to python code wasn't quite worth it? But I'm in favor of reducing code that has duplicate functionality, if it's done without sacrificing efficiency (powerstate.c is still fast when not using ppd)
Maybe what can be done is creating a legion_cli
(if doesn’t already exist) called legion_cli profile_set
that set the correct power profile for the state of charger and power profile.
@st0nie I also think would be better to read the /sys/firmware/acpi/platform_profile
instead of calling powerprofilesctl
in powerstate.c
since any user could decide to not have power-profile-daemon install
from lenovolegionlinux.
The current legiond still works fine and remains low on resources when you press fn+q hysterically. This is actually the main issue I want to deal with.
I would agree at least for daemon to still in C. I don't know if the daemon will react weirdly in that situation if written in python.
The last time I checked daemon written in python tend to be more were kinda slow when use with a timer
from lenovolegionlinux.
@st0nie I also think would be better to read the
/sys/firmware/acpi/platform_profile
instead of callingpowerprofilesctl
inpowerstate.c
since any user could decide to not have power-profile-daemon install
Current behavior is to use ppd only when /sys/firmware/acpi/platform_profile
is unavailable.
Using ppd is much less efficient and does not support balanced-performance mode.
I don't think it's a major problem.
from lenovolegionlinux.
It works well, at least for this purpose, converting the most time-consuming process of using legion_cli to non-blocking, as well as simpler configuration (at least for the user, that is)
Very interesting insight @st0nie . Great work!
- Why is legion_cli called so often? How otten is it called and how slow is legion_cli?
- Very good idea making the call to legion_cli non blocking. Is this needed because of systemd? How did you do it? Is this done by seperating it in legiond-cli and legiond?
The current legiond still works fine and remains low on resources when you press fn+q hysterically. This is actually the main issue I want to deal with.
Interesting. So the problem is that if we press fn+q with high frequency, we get throttled by systemd? Was the solution to convert it in two program legiond-cli and legiond?
from lenovolegionlinux.
Maybe what can be done is creating a
legion_cli
(if doesn’t already exist) calledlegion_cli profile_set
that set the correct power profile for the state of charger and power profile.
Good idea, @MrDuartePT . What do you think what properties should be set? All from legiond?
from lenovolegionlinux.
The last time I checked daemon written in python tend to be more were kinda slow when use with a timer
Interesting! Was this with a systemd timer or python timer?
from lenovolegionlinux.
Maybe what can be done is creating a
legion_cli
(if doesn’t already exist) calledlegion_cli profile_set
that set the correct power profile for the state of charger and power profile.Good idea, @MrDuartePT . What do you think what properties should be set? All from legiond?
My ideia is that legiond should be maintain how it is, what it can be done to simplify is to create a command for legion_cli
to automatically set the fan profile (depending of the ac state and power mode):
1 - Make the daemon simple
2 - The profile names are hardcoded
This way would reduce complexity, (well the parser will still exist to set the cpu control and gpu control, but that feature are separate from legion_cli
).
Also I made that addition because Power Option
tab on legion_gui
only seem to work on custom mode. At least cpu_control
and gpu_control
(at least for amd, nvidia disable tdp control on newer driver) work outside of custom mode, and can accept any cli application to control the parameters.
The last time I checked daemon written in python tend to be more were kinda slow when use with a timer
Interesting! Was this with a systemd timer or python timer?
For my knowledge with any init system any python daemon with timer, not work really well and are more heavy in resource that a C daemon.
What you think as well @st0nie
from lenovolegionlinux.
Also one more thing @st0nie @johnfanv2 I also thinking changing legiond acpi files to udev instead, since udev is a hard required for many system instead of acpid.
For exemple TLP uses udev to check if the charger was unplugged or not, that way rerunning the tlp auto script: https://github.com/linrunner/TLP/blob/main/tlp.rules.in
from lenovolegionlinux.
Also one more thing @st0nie @johnfanv2 I also thinking changing legiond acpi files to udev instead, since udev is a hard required for many system instead of acpid.
But how can we handle fn+q ?
A dirty solution might be let the kmod call legionctl directly
from lenovolegionlinux.
Also one more thing @st0nie @johnfanv2 I also thinking changing legiond acpi files to udev instead, since udev is a hard required for many system instead of acpid.
But how can we handle fn+q ? A dirty solution might be let the kmod call legionctl directly
Yes you a right I forget udev can't check for keypress
Let scratch the udev ideia
from lenovolegionlinux.
Related Issues (20)
- More support HOT 1
- GKCN60WW legion 5 15ach6h HOT 1
- [BUG] Error when trying the GUI HOT 13
- Could this project support windows? HOT 7
- [BUG] crash since powerstate module got added HOT 11
- Fedora 40 issue HOT 2
- [BUG]When the GPU temp and usage increases, the fan curve fails HOT 2
- [BUG]When the load and temperature of the NVIDIA GPU increase, the fan speed lock at 2300 rpm HOT 2
- [BUG] fan curve doesnt work on 5 pro 16irx8 HOT 1
- [BUG] Cannot change fancurve Legion 5 15IAH7H HOT 2
- [Question] Is the thinkbook 16+ 2024 raptor edition applicable? HOT 1
- Support for Lenovo 7 Pro 16IRX9 (2023) HOT 12
- Cannot interact with GUI on 16IAH7H gen 7 / 2022
- [BUG] After the latest update in Garuda LenovoLegionLinux doesnt work anymore. HOT 4
- Arch Linux LenovoLegionLinux won't launch after install, No module named 'legion_linux' HOT 8
- [BUG] repository 'https://johnfanv2.github.io/LenovoLegionLinux/package_repo/ubuntu ./ Release' no longer has a Release file HOT 1
- Support for Lenovo Legion Slim 5 16AHP9
- [BUG] Running `systemd_install.sh` failed
- [BUG] Incorrect CPU Long Term Power Limit (Cross Loading) applied and cannot be changed 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 lenovolegionlinux.