Git Product home page Git Product logo

Comments (12)

st0nie avatar st0nie commented on June 3, 2024

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.

st0nie avatar st0nie commented on June 3, 2024

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.

MrDuartePT avatar MrDuartePT commented on June 3, 2024

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.

MrDuartePT avatar MrDuartePT commented on June 3, 2024

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 avatar st0nie commented on June 3, 2024

@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

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.

johnfanv2 avatar johnfanv2 commented on June 3, 2024

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!

  1. Why is legion_cli called so often? How otten is it called and how slow is legion_cli?
  2. 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.

johnfanv2 avatar johnfanv2 commented on June 3, 2024

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.

Good idea, @MrDuartePT . What do you think what properties should be set? All from legiond?

from lenovolegionlinux.

johnfanv2 avatar johnfanv2 commented on June 3, 2024

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.

MrDuartePT avatar MrDuartePT commented on June 3, 2024

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.

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.

MrDuartePT avatar MrDuartePT commented on June 3, 2024

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.

st0nie avatar st0nie commented on June 3, 2024

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.

MrDuartePT avatar MrDuartePT commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.