Open shadowcomer opened 10 months ago
Awesome work.
Please find:
FN/WIN swap
(I think it 0xBF
because 0xE8 = 00
)super battery
(is it change values other than 0xD2-D4
)advanced cooler control
(I think it on the same page as User Scenario
)User Scenario
page (to verify you found all "shifts")UPD: battery charge max in EC dump has strange value 0x80 which equals 0%, but in dump from RWE it has right value
@shadowcomer Ready for test and review
Download with
git clone -b 1594EMS1 https://github.com/glpnk/msi-ec.git
Make and load
make
sudo make load
Thanks! Good catch on super battery missing some value changes.
I'm staring at the changing numbers a little bit longer. I'll update the main post with the updated data, and track the edits here as I go, so they don't get lost.
These are my findings:
There are some additional GPU overclocking options in the 'Extreme Performance' mode: Core Clock Offset, and VRAM Clock Offset. Do you need me to try those too?
I've also noticed that there might be something wonky going on while in windows:
I'm going to double check the drivers, maybe reinstall them to see if windows messed them up.
Finally, is the battery charge max address you mention 0xD7?
On a side note, I'm having trouble not making mistakes, and I'm finding it very tedious to find which values are changing. I'm not experienced in direct interaction with the hardware, but it seems like the process could be improved to help some more inexperienced users provide data more easily and accurately.
Is there a way in windows to automatically dump the contents of the embeded controller to file, similarly to what RWEverything does? We could collect that data at relatively short intervals over some seconds before and after changing a setting, and easily filter for values that only change once.
I don't know how standard the embedded controller is, so I don't know if this would be useful for any other motherboards.
The "AI" stuff seems to be the MSI Center feature, probably just automatically switches some parameters, so it is out of scope of this driver
Is there a way in windows to automatically dump the contents of the embeded controller to file, similarly to what RWEverything does? We could collect that data at relatively short intervals over some seconds before and after changing a setting, and easily filter for values that only change once.
There's this app, MsiEcRamEditor. It logs values that change so maybe we can contribute to it and add an option to exclude some irrelevant addresses from the log.
In two days I'll receive my A13VE-045XES, so I'll be available to help in any way.
My machine arrived earlier 🙌🏾 , so there are my findings:
# Report
## Function keys
- Quick launch fn keys:
locked:
0xd9 = 0x03
unlocked:
0xd9 = 0x01
- Mute sound:
muted:
0x2d = 0x2e
unmuted:
0x2d = 0x2c
- Volume down
Change to volume 0, gives the same values as for 'mute sound'
- volume up
For a non zero volume, same as for 'mute sound'
- Disable trackpad
no effect
- Mute microphone
muted:
0x2c = 0x0a
unmuted:
0x2c = 0x08
- Enable camera
disabled:
0x2e = 0x09
enabled:
0x2e = 0x0b, requires hardware switch on
- Profiles
super battery:
0xd2 = 0xc2
0xd3 = 0x80
0xd4 = 0x0d
silent:
0xd2 = 0xc1
0xd3 = 0x82
0xd4 = 0x1d
balanced:
0xd2 = 0xc1
0xd3 = 0x82
0xd4 = 0x0d
extreme performance:
0xd2 = 0xc4
0xd3 = 0x82
0xd4 = 0x0d
smart auto ai: probably the auto AI is a software thing
0xd2 = 0xc1
0xd3 = 0x82
0xd4 = 0x0d
- keyboard light
off:
0xd3 = 0x80
hight:
0xd3 = 0x83
medium:
0xd3 = 0x82
low:
0xd3 = 0x81
## Features
- Switch keys:
enabled:
0xe8 = 0x10
disbaled:
0xe8 = 0x00
- USB power share
enabled:
0xbf = 0x28
disabled:
0xbf = 0x08
- keyboard mode:
always on:
0x2c = 0x00
auto mode, off after 10 sec:
0x2c = 0x08
- Battery master
best for mobility:
0xd7 = 0xe4
balanced
0xd7 = 0xd0
best for battery
0xd7 = 0xbc
- Fan speed
Cooler boost:
0x98 = 0x86
Auto:
0x98 = 0x06
## Other things
- Power plug
Plugged:
0x30 = 0x03
0x31 = 0x03
0x3e = 0x80
Plugged via USB-C:
0x30 = 0x07
0x31 = 0x03
0x3e = 0x80
Un-plugged:
0x30 = 0x02
0x31 = 0x05
0x3e = 0xc0
- fan 1 (CPU???) speed:
The address is organized from low to hight temperature, this allows to define a fan profile.
value: is a percentage between 0x0-0x96
address temp 0: 0x72
address temp 1: 0x73
address temp 2: 0x74
address temp 3: 0x75
address temp 4: 0x76
address temp 5: 0x77
- fan 2 (GPU???) speed:
The address is organized from low to hight temperature, this allows to define a fan profile.
value: is a percentage between 0x0-0x96
address temp 0: 0x8a
address temp 1: 0x8b
address temp 2: 0x8c
address temp 3: 0x8d
address temp 4: 0x8e
address temp 5: 0x8f
## Sensors
- CPU:
temperature: 0x68
- GPU:
temperature: 0x80
- fan 1 (CPU) speed:
address: 0x71
value: is a percentage between 0x0-0x96
- fan 2 (GPU) speed:
address: 0x89
value: is a percentage between 0x0-0x96
## Notes
- Ignore for now, they change constantly: 46,47,48,4a,4b,c9,cb,68,9e,f4,dd
I have noticed that some addresses are different from the open PR and the values found by @shadowcomer, how can we confirm the ones that are correct?
@gil0mendes @shadowcomer Thanks for your contribution and documenting extra currently unsupported features. Follow this guide to install version for your laptops.
Fixed:
Please check next values:
0xd4
(fan mode) is {0x0d, 0x1d, 0x8d} = {default, silent, advanced} or different. Advanced is triggered by toggling Extreme performance
profile and setting fan curve
mode.0xEB
on super battery
toggle@teackot I think the rt_fan_speed_base_min
and rt_fan_speed_base_max
must be 0x00
and 0x96
accordingly because:
- fan 1 (CPU) speed: address: 0x71 value: is a percentage between 0x0-0x96
But now values will be mapped from 0-150% to 0-100%
static ssize_t cpu_realtime_fan_speed_show(struct device *device,
struct device_attribute *attr,
char *buf)
{
u8 rdata;
int result;
result = ec_read(conf.cpu.rt_fan_speed_address, &rdata);
if (result < 0)
return result;
if ((rdata < conf.cpu.rt_fan_speed_base_min ||
rdata > conf.cpu.rt_fan_speed_base_max))
return -EINVAL;
return sysfs_emit(buf, "%i\n",
100 * (rdata - conf.cpu.rt_fan_speed_base_min) /
(conf.cpu.rt_fan_speed_base_max -
conf.cpu.rt_fan_speed_base_min));
}
Ok, I got some time to install a temporary Ubuntu; seems like everything it's ok, I just have a doubt on a value, I have marked that with a !
:
# test report
- webcam
physical button off: OK
physical button on: OK
button off: OK
button on: OK
- webcam_block
block on: OK
block off: OK
- fn_key
left: OK
right: OK
- win_key
left: OK
right: OK
- battery_mode
max: OK
medium: OK
min: OK
- cooler_boost
on: OK
off: OK
- available_shift_modes
read: OK (eco comfort turbo)
- shift_mode
eco: OK
comfort: OK
turbo: OK
- available_fan_modes
read: OK (auto silent advanced)
- fan_mode
auto: OK
silent: OK
advanced: OK
- cpu/realtime_temperature
read: OK
- cpu/realtime_fan_speed
read: OK
- cpu/basic_fan_speed
read: ! always returns 0
- gpu/realtime_fan_speed
read: OK
- gpu/realtime_temperature
read: OK
- .../BAT1/charge_controll_start_threshold
read: OK (70)
- .../BAT1/charge_controll_end_threshold
read: OK (80)
- .../leds/platform::mute/brightness
on: OK
off: OK
- .../leds/platform::micmute/brightness
on: OK
off: OK
- .../leds/msiacpi::kbd_backlight/brightness
off: OK
on: OK
half: OK
full: OK
@gil0mendes Thanks for your report
- cpu/basic_fan_speed read: ! always returns 0
It's because it unsupported or undocumented, and not ignored in SysFS. I don't know how it look like and it supported in few models
Hi! Sorry I haven't responded in a while... there's always something else getting in the way. I've finally found some time to dedicate to this, so here are my findings of testing the current version on main (c39fe61), which contains the merge with the changes from @glpnk 's repo.
A summary of the setup I'm using. I wish I had the skills to do this on NixOS or GuixSD so I could simply share the exact configuration. If you need more information, I can query/check.
Setup:
6.5.9-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 26 Oct 2023 00:52:20 +0000 x86_64 GNU/Linux
.The following might be a bunch of unrelated/useless information, but on the off-chance that they hint towards something important/fixable, I'm going to share it here:
I'm not sure how to test these, because they were modified from within the Windows MSI Center. I don't know of any place where Gnome or anything else detects and exposes these features, and I don't know if that's something that this driver is supposed to be doing yet.
The 'lm_sensors' package detects the following sensors:
From 'sensors':
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1: +48.0°C
BAT1-acpi-0
Adapter: ACPI interface
in0: 16.95 V
curr1: 0.00 A
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +44.0°C (high = +100.0°C, crit = +100.0°C)
Core 0: +39.0°C (high = +100.0°C, crit = +100.0°C)
Core 4: +39.0°C (high = +100.0°C, crit = +100.0°C)
Core 8: +37.0°C (high = +100.0°C, crit = +100.0°C)
Core 12: +40.0°C (high = +100.0°C, crit = +100.0°C)
Core 16: +38.0°C (high = +100.0°C, crit = +100.0°C)
Core 20: +39.0°C (high = +100.0°C, crit = +100.0°C)
Core 24: +43.0°C (high = +100.0°C, crit = +100.0°C)
Core 25: +43.0°C (high = +100.0°C, crit = +100.0°C)
Core 26: +44.0°C (high = +100.0°C, crit = +100.0°C)
Core 27: +44.0°C (high = +100.0°C, crit = +100.0°C)
Core 28: +44.0°C (high = +100.0°C, crit = +100.0°C)
Core 29: +45.0°C (high = +100.0°C, crit = +100.0°C)
Core 30: +44.0°C (high = +100.0°C, crit = +100.0°C)
Core 31: +44.0°C (high = +100.0°C, crit = +100.0°C)
nvme-pci-e100
Adapter: PCI adapter
Composite: +47.9°C (low = -0.1°C, high = +79.8°C)
(crit = +81.8°C)
Sensor 1: +47.9°C (low = -273.1°C, high = +65261.8°C)
acpitz-acpi-0
Adapter: ACPI interface
temp1: +47.0°C (crit = +100.0°C)
From 'nvidia-smi':
Sun Oct 29 11:49:49 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.113.01 Driver Version: 535.113.01 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 4050 ... Off | 00000000:01:00.0 Off | N/A |
| N/A 39C P8 2W / 35W | 9MiB / 6141MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 1689 G /usr/lib/Xorg 4MiB |
+---------------------------------------------------------------------------------------+
I believe the kernel should be exposing relevant sensors through /sys/
. How can I find those that are relevant, or which ones should I be looking at?
The following are notes that I've taken while performing the tests, and which might contain important details for troubleshooting.
ACPI: battery: [Firmware Bug]: (dis)charge rate invalid
.Unknown key pressed
and Unknown key released
messages. This might be more related to gnome's support of the 'Fn' key.segfault
s, "likely" on different CPU cores. Maybe more of a Gnome issue.ACPI Warning: Time parameter 250 us > 100 us violating ACPI spec, please fix the firmware. (20230331/exsystem-141)
. Again power related, so there's something going on there.lsmod
. There might be clues as to what is available and what is missing for things to work.The basic keys seem to be working well, but I haven't found a way to test the feature set and would appreciate some guidance.
From when we started 2 months ago until now, at least the laptop is functional, which is already a big step, so thank you very much to everyone involved: you're the best!
Laptop model
MSI Prestige 16 Studio A13VE
EC firmware version
BIOS E1594IMS.111, EC 1594EMS1.10907062023 16:01:02
EC memory dump
GPU
Nvidia
Is your keyboard RGB?
No (single color)
Additional context
Thanks for all of your hard work, I'd be pulling my hair out (more) without everything you've already done.
I've followed the instructions in the wiki as closely as I could. Following is the original EC state from RWEverything:
I've tried all of the key functions, hardware switches, and features as possible. I may have missed some of them, although I've tried to really go through each one multiple times. Following I describe the changes observed when changing functions. They follow the format:
I still have Windows 11 installed, so I am able to investigate, test, or write code if necessary. However, I might need some guidance, as I'm not experienced with firmware.
Thanks for all of your help!