Open YisuiDenghua opened 1 year ago
@YisuiDenghua
Is Y9000X the original or Chinese name?
I added your model/BIOS to the kernel module. Please get the new version, recompile, and reload the kernel module (no need to force anymore).
Then, please test the following features. We have to try a bit to find the correct configuration.
Please read the fan speeds and temperatures (see README) and confirm that they are sensible and change accordingly, e.g. when you put load onto the CPU the CPU temp and the fan speeds should increase, but GPU temp should stay roughly the same.
We will start by confirming that power mode change work and to get me more debug info. Please change the power mode with Fn+Q and provide the output of the following commands in each mode.
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
sudo cat /sys/kernel/debug/legion/fancurve
Then please also check if the power mode is read correctly in the OS (see README). Then please check if you can set the power mode with the GUI (see README) and the LED changes accordingly.
Tests the following features with the GUI. Please check that if works or otherwise give precise information about what does not work. Please try to check that reading and writing works with the software.
Please provide the log output from the GUI from the log tab for all the tests.
In order to fix/configure the keyboard backlight and begin with setting fan curves, please put your keyboard backlight to off, medium, or bright. Provide the output of the following commands (in that order) in each backlight state:
sudo cat /sys/kernel/debug/legion/fancurve
sudo dmesg | tail -n 30
First, please give again the output of
sudo cat /sys/kernel/debug/legion/fancurve
sudo dmesg | tail -n 30
Second, please use the GUI and enter custom mode. Do you have a custom mode (e.g. in Legion Toolkit in Windows)? Then change the fan curve (currently only the first row for fan 1), write it to hardware, and read it back. Please report back if it works and provide the log output from the GUI and sudo dmesg | tail -n 70
.
@YisuiDenghua
Is Y9000X the original or Chinese name?
I added your model/BIOS to the kernel module. Please get the new version, recompile, and reload the kernel module (no need to force anymore).
Then, please test the following features. We have to try a bit to find the correct configuration.
Temperatures and Fan Speeds
Please read the fan speeds and temperatures (see README) and confirm that they are sensible and change accordingly, e.g. when you put load onto the CPU the CPU temp and the fan speeds should increase, but GPU temp should stay roughly the same.
Powermode
We will start by confirming that power mode change work and to get me more debug info. Please change the power mode with Fn+Q and provide the output of the following commands in each mode.
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C sudo cat /sys/kernel/debug/legion/fancurve
Then please also check if the power mode is read correctly in the OS (see README). Then please check if you can set the power mode with the GUI (see README) and the LED changes accordingly.
Tests the following features with the GUI. Please check that if works or otherwise give precise information about what does not work. Please try to check that reading and writing works with the software.
Please provide the log output from the GUI from the log tab for all the tests.
Fn Lock
* Enable fn-lock: A LED might turn on. fn functions now work without pressing Fn * Disable fn-lock: A LED might turn on. fn functions now work only when pressing Fn
Win Key
* Enable Win Key: Win Key should work, e.g. open start menu or trigger some other action * Disable Win Key: Win Key has no function anymore
Touchpad
* Enable Touchpad: Touchpad works * Disable Touchpad: Touchpad does not work
Battery Conservation
* Enabled: charging stops if above 60 % (or 80% depending on model) * Disabled: charging works up to 100% Note: Sometimes it takes a 10-20 seconds before it takes effect
Rapid Charging
* Enabled: Charging is faster; Check this by comparing the time until fully charged displayed in system information or by comparing charging current. * Disabled: Charging is slower Note: Sometimes it takes a 10-20 seconds before it takes effect .
Charge Output Always On
* Enabled: Some USB output is always powered even when laptop is off or sleeping; Test e.g. by trying to charge your phone. * Disabled: USB outputs are off when laptop is off
Display Overdrive
* Enabled: display somehow faster * Disabled: display not faster Just check if checkbox can be checked or not if you cannot verify that it has an effect.
Keyboard Backlight
In order to fix/configure the keyboard backlight and begin with setting fan curves, please put your keyboard backlight to off, medium, or bright. Provide the output of the following commands (in that order) in each backlight state:
sudo cat /sys/kernel/debug/legion/fancurve sudo dmesg | tail -n 30
Fan curve
First, please give again the output of
sudo cat /sys/kernel/debug/legion/fancurve sudo dmesg | tail -n 30
Second, please use the GUI and enter custom mode. Do you have a custom mode (e.g. in Legion Toolkit in Windows)? Then change the fan curve (currently only the first row for fan 1), write it to hardware, and read it back. Please report back if it works and provide the log output from the GUI and
sudo dmesg | tail -n 70
.
Sorry, I don't know how to use the new version in my system.
I updated the code. You just have to download the code from github again. Then, compile/build it again (make
), and load the module (make reloadmodule
). See the README (https://github.com/johnfanv2/LenovoLegionLinux) for detailed instructions.
I updated the code. You just have to download the code from github again. Then, compile/build it again (
make
), and load the module (make reloadmodule
). See the README (https://github.com/johnfanv2/LenovoLegionLinux) for detailed instructions.
Since NixOS doesn't follow FHS, make
is not usable on it. I'm still trying to package the new version of the driver. But I'm not familiar with packaging a kernel module.
Maybe you could install make like here https://stackoverflow.com/questions/74649163/how-to-install-the-make-command-in-nixos or here https://www.reddit.com/r/NixOS/comments/s71md4/installing_make/. It is enough to have the files in your home folder and compile it there. There is no need to install the new driver but insmod
must be possible. It is used inside the makefile.
@johnfanv2
Thanks. Tested with make
, no errors found.
Y9000X is it's original name.
Conclusion : "Charge Output Always On", "Fan curve"
I tested CPU with stress --cpu 4 --timeout 60
, then used psensor
to monitor the temperature.
CPU temp raised, then I heard the sound of the fan. But on psensor
, the speeds of the fan didn't raise.
And then I test with the Lenovo Legion Linux GUI, it shows that the speeds of the fan raised.
GPU temp stay roughly the same.
the 2nd image shows the temp and the fan's speeds when I'm putting load onto the CPU.
These are outputs of sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
, sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
and sudo cat /sys/kernel/debug/legion/fancurve
Then I used the GUI tools to change power mode, it works fine and the LED changed its colour. I also tested it with powerprofilesctl list
, no problems found.
I used the GUI tools to change Fn Lock, it works as expected.
Works.
Works.
Works.
Works.
Doesn't work.
Log:
INFO:legion_linux.legion:Click on UI Charge Output from USB always on element for AlwaysOnUSBChargingFeature
Error occured
Traceback (most recent call last):
File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 185, in update_feature_from_view
self.feature.set(gui_value)
File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 452, in set
raise NotImplementedError()
NotImplementedError
Works.
Error.
ERROR:legion_linux.legion:[38003.058552] legion_laptop: Set fancurve
[38003.120511] legion_laptop: Set fancurve
[38003.182298] legion_laptop: Set fancurve
[38003.244527] legion_laptop: Set fancurve
[38003.306660] legion_laptop: Set fancurve
[38003.368817] legion_laptop: Set fancurve
[38003.430410] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8
[38003.460389] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8
[38003.490660] legion_laptop: Set fancurve
[38003.551943] legion_laptop: Set fancurve
[38003.613297] legion_laptop: Set fancurve
[38003.674760] legion_laptop: Set fancurve
[38003.736034] legion_laptop: Set fancurve
[38003.797313] legion_laptop: Set fancurve
[38003.858559] legion_laptop: Set fancurve
[38003.919722] legion_laptop: Set fancurve
[38003.981033] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9
[38004.011085] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9
[38081.441538] ACPI Error: Aborting method \_SB.GZFD.WMAD due to previous error (AE_AML_BUFFER_LIMIT) (20220331/psparse-529)
[38081.441545] legion_laptop: ACPI evaluation error for: 14afd777-106f-4c9b-b334-d388dc7809be:1
Error occured [Errno 22] 无效的参数
Traceback (most recent call last):
File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 205, in update_view_from_feature
feature_value = self.feature.get()
^^^^^^^^^^^^^^^^^^
File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 297, in get
invalue = self._read_file_int(self.filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 231, in _read_file_int
return int(self._read_file_str(file_path))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 228, in _read_file_str
raise err
File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 222, in _read_file_str
out = str(filepointer.read()).strip()
^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] 无效的参数
Dmesg:
[38148.997516] legion_laptop: Set fancurve
[38149.058965] legion_laptop: Set fancurve
[38149.120227] legion_laptop: Set fancurve
[38149.181502] legion_laptop: Set fancurve
[38149.242746] legion_laptop: Set fancurve
[38149.304167] legion_laptop: Set fancurve
[38149.365391] legion_laptop: Set fancurve
[38149.426655] legion_laptop: Set fancurve
[38149.487865] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 3
[38149.518094] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 3
[38149.548167] legion_laptop: Set fancurve
[38149.609493] legion_laptop: Set fancurve
[38149.670691] legion_laptop: Set fancurve
[38149.732098] legion_laptop: Set fancurve
[38149.793410] legion_laptop: Set fancurve
[38149.854660] legion_laptop: Set fancurve
[38149.915852] legion_laptop: Set fancurve
[38149.977085] legion_laptop: Set fancurve
[38150.038469] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 4
[38150.068546] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 4
[38150.098615] legion_laptop: Set fancurve
[38150.159992] legion_laptop: Set fancurve
[38150.221250] legion_laptop: Set fancurve
[38150.282609] legion_laptop: Set fancurve
[38150.343827] legion_laptop: Set fancurve
[38150.405072] legion_laptop: Set fancurve
[38150.466317] legion_laptop: Set fancurve
[38150.527654] legion_laptop: Set fancurve
[38150.589093] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 5
[38150.619127] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 5
[38150.649177] legion_laptop: Set fancurve
[38150.710389] legion_laptop: Set fancurve
[38150.771575] legion_laptop: Set fancurve
[38150.832855] legion_laptop: Set fancurve
[38150.894161] legion_laptop: Set fancurve
[38150.955433] legion_laptop: Set fancurve
[38151.016783] legion_laptop: Set fancurve
[38151.078007] legion_laptop: Set fancurve
[38151.139215] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 6
[38151.169303] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 6
[38151.199551] legion_laptop: Set fancurve
[38151.260826] legion_laptop: Set fancurve
[38151.322161] legion_laptop: Set fancurve
[38151.383336] legion_laptop: Set fancurve
[38151.444654] legion_laptop: Set fancurve
[38151.505836] legion_laptop: Set fancurve
[38151.567197] legion_laptop: Set fancurve
[38151.628454] legion_laptop: Set fancurve
[38151.689694] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 7
[38151.719726] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 7
[38151.749809] legion_laptop: Set fancurve
[38151.811010] legion_laptop: Set fancurve
[38151.872210] legion_laptop: Set fancurve
[38151.933414] legion_laptop: Set fancurve
[38151.994804] legion_laptop: Set fancurve
[38152.056182] legion_laptop: Set fancurve
[38152.117437] legion_laptop: Set fancurve
[38152.178684] legion_laptop: Set fancurve
[38152.239918] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8
[38152.270010] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8
[38152.300060] legion_laptop: Set fancurve
[38152.361306] legion_laptop: Set fancurve
[38152.422512] legion_laptop: Set fancurve
[38152.483717] legion_laptop: Set fancurve
[38152.544998] legion_laptop: Set fancurve
[38152.606278] legion_laptop: Set fancurve
[38152.667540] legion_laptop: Set fancurve
[38152.728813] legion_laptop: Set fancurve
[38152.790004] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9
[38152.820121] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9
IMO, Y9000X is the Chinese name.
When I enter the serial number of my laptop on pcsupport.lenovo.com, I get this link, so I think its international name is Legion S7 16IAH7 or Legion Slim 7i Gen 7.
@johnfanv2
Thanks. Tested with
make
, no errors found.Y9000X is it's original name.
Conclusion : "Charge Output Always On", "Fan curve"
Temperatures and Fan Speeds
I tested CPU with
stress --cpu 4 --timeout 60
, then usedpsensor
to monitor the temperature.CPU temp raised, then I heard the sound of the fan. But on
psensor
, the speeds of the fan didn't raise.And then I test with the Lenovo Legion Linux GUI, it shows that the speeds of the fan raised.
GPU temp stay roughly the same.
the 2nd image shows the temp and the fan's speeds when I'm putting load onto the CPU.
Powermode
These are outputs of
sudo cat /sys/kernel/debug/legion/ecmemoryram | hexdump -C
,sudo cat /sys/kernel/debug/legion/ecmemory | hexdump -C
andsudo cat /sys/kernel/debug/legion/fancurve
Then I used the GUI tools to change power mode, it works fine and the LED changed its colour. I also tested it with
powerprofilesctl list
, no problems found.Fn Lock
I used the GUI tools to change Fn Lock, it works as expected.
Win Key
Works.
Touchpad
Works.
Battery Conservation
Works.
Rapid Charging
Works.
*Charge Output Always On
Doesn't work.
Log:
INFO:legion_linux.legion:Click on UI Charge Output from USB always on element for AlwaysOnUSBChargingFeature Error occured Traceback (most recent call last): File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 185, in update_feature_from_view self.feature.set(gui_value) File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 452, in set raise NotImplementedError() NotImplementedError
Display Overdrive
Works.
Keyboard Backlight
*Fan curve
Error.
ERROR:legion_linux.legion:[38003.058552] legion_laptop: Set fancurve [38003.120511] legion_laptop: Set fancurve [38003.182298] legion_laptop: Set fancurve [38003.244527] legion_laptop: Set fancurve [38003.306660] legion_laptop: Set fancurve [38003.368817] legion_laptop: Set fancurve [38003.430410] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8 [38003.460389] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8 [38003.490660] legion_laptop: Set fancurve [38003.551943] legion_laptop: Set fancurve [38003.613297] legion_laptop: Set fancurve [38003.674760] legion_laptop: Set fancurve [38003.736034] legion_laptop: Set fancurve [38003.797313] legion_laptop: Set fancurve [38003.858559] legion_laptop: Set fancurve [38003.919722] legion_laptop: Set fancurve [38003.981033] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9 [38004.011085] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9 [38081.441538] ACPI Error: Aborting method \_SB.GZFD.WMAD due to previous error (AE_AML_BUFFER_LIMIT) (20220331/psparse-529) [38081.441545] legion_laptop: ACPI evaluation error for: 14afd777-106f-4c9b-b334-d388dc7809be:1 Error occured [Errno 22] 无效的参数 Traceback (most recent call last): File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/legion_gui.py", line 205, in update_view_from_feature feature_value = self.feature.get() ^^^^^^^^^^^^^^^^^^ File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 297, in get invalue = self._read_file_int(self.filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 231, in _read_file_int return int(self._read_file_str(file_path)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 228, in _read_file_str raise err File "/home/yisui/LenovoLegionLinux/python/legion_linux/legion_linux/../legion_linux/legion.py", line 222, in _read_file_str out = str(filepointer.read()).strip() ^^^^^^^^^^^^^^^^^^ OSError: [Errno 22] 无效的参数
Dmesg:
[38148.997516] legion_laptop: Set fancurve [38149.058965] legion_laptop: Set fancurve [38149.120227] legion_laptop: Set fancurve [38149.181502] legion_laptop: Set fancurve [38149.242746] legion_laptop: Set fancurve [38149.304167] legion_laptop: Set fancurve [38149.365391] legion_laptop: Set fancurve [38149.426655] legion_laptop: Set fancurve [38149.487865] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 3 [38149.518094] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 3 [38149.548167] legion_laptop: Set fancurve [38149.609493] legion_laptop: Set fancurve [38149.670691] legion_laptop: Set fancurve [38149.732098] legion_laptop: Set fancurve [38149.793410] legion_laptop: Set fancurve [38149.854660] legion_laptop: Set fancurve [38149.915852] legion_laptop: Set fancurve [38149.977085] legion_laptop: Set fancurve [38150.038469] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 4 [38150.068546] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 4 [38150.098615] legion_laptop: Set fancurve [38150.159992] legion_laptop: Set fancurve [38150.221250] legion_laptop: Set fancurve [38150.282609] legion_laptop: Set fancurve [38150.343827] legion_laptop: Set fancurve [38150.405072] legion_laptop: Set fancurve [38150.466317] legion_laptop: Set fancurve [38150.527654] legion_laptop: Set fancurve [38150.589093] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 5 [38150.619127] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 5 [38150.649177] legion_laptop: Set fancurve [38150.710389] legion_laptop: Set fancurve [38150.771575] legion_laptop: Set fancurve [38150.832855] legion_laptop: Set fancurve [38150.894161] legion_laptop: Set fancurve [38150.955433] legion_laptop: Set fancurve [38151.016783] legion_laptop: Set fancurve [38151.078007] legion_laptop: Set fancurve [38151.139215] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 6 [38151.169303] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 6 [38151.199551] legion_laptop: Set fancurve [38151.260826] legion_laptop: Set fancurve [38151.322161] legion_laptop: Set fancurve [38151.383336] legion_laptop: Set fancurve [38151.444654] legion_laptop: Set fancurve [38151.505836] legion_laptop: Set fancurve [38151.567197] legion_laptop: Set fancurve [38151.628454] legion_laptop: Set fancurve [38151.689694] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 7 [38151.719726] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 7 [38151.749809] legion_laptop: Set fancurve [38151.811010] legion_laptop: Set fancurve [38151.872210] legion_laptop: Set fancurve [38151.933414] legion_laptop: Set fancurve [38151.994804] legion_laptop: Set fancurve [38152.056182] legion_laptop: Set fancurve [38152.117437] legion_laptop: Set fancurve [38152.178684] legion_laptop: Set fancurve [38152.239918] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 8 [38152.270010] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 8 [38152.300060] legion_laptop: Set fancurve [38152.361306] legion_laptop: Set fancurve [38152.422512] legion_laptop: Set fancurve [38152.483717] legion_laptop: Set fancurve [38152.544998] legion_laptop: Set fancurve [38152.606278] legion_laptop: Set fancurve [38152.667540] legion_laptop: Set fancurve [38152.728813] legion_laptop: Set fancurve [38152.790004] legion_laptop: Ignoring invalid fancurve value 0 for attribute 9 at point 9 [38152.820121] legion_laptop: Ignoring invalid fancurve value 0 for attribute 10 at point 9
It look you introduce some zeros in the values try read from hardware after fn+q and change for example on value, record to hardware and verify the value apply.
About charge always on. Verify if you have the option in the bios if not, unfortunately your legion is not supported.
For this device, I have uploaded all my info in both linux and windows. Testing new features on 2022 models [looking for testers] #2263193416
I hope it is helpful. Until today, this module doesn't work properly on my Y9000X.
@johnfanv2 Thank you so much.
Model name: Lenovo Legion Y9000X IAH7 CPU model: 12th Gen Intel i7-12700H (20) @ 4.600GHz GPU model: NVIDIA GeForce RTX 3060 Mobile / Max-Q Keyboard backlight: single color with off/medium/bright System: GNU/Linux x86_64, NixOS
By default legion-laptop module will not loaded in this model:
output of
sudo dmidecode -t system
Output of
dmidecode -t bios
:Output of
sudo cat /sys/kernel/debug/legion/fancurve
:Inspecting WMI entries
fwts_wmi.log
Disassembling ACPI tables
acpi_re.zip
Gathering WMI info in Windows
newfile.txt
Originally posted by @YisuiDenghua in https://github.com/johnfanv2/LenovoLegionLinux/issues/46#issuecomment-1635321621