Open ferdiu opened 2 years ago
Hey! So it looks like the Katana model has a different battery threshold address. I don't know about the other addresses (since this was the only one I was interested about). I can tell you that cooler boost, for instance, work out of the box. Other things might work as well, who knows.
That said, for the battery address, change the isw.conf
file (bottom of the file, MSI_ADDRESS_DEFAULT), like:
...
[MSI_ADDRESS_DEFAULT]
address_profile = MSI_ADDRESS_DEFAULT
fan_mode_address = 0xf4
cooler_boost_address = 0x98
usb_backlight_address = 0xf7
battery_charging_threshold_address = 0xd7 <---- this is what you need to change (default now is 0xef)
...
Once you've done this and saved the file, you can simply do isw -t 80
to set the battery threshold at 80% (laptop needs to be below 80% when you plug it in for this to work, from my experience).
Hi! Thank you for this info! It is actually the main thing I needed.
Meanwhile I found other addresses and values to share:
cooler_boost_address
is at address 0x98 (default) with values off
0x06 (6) and on
0x86 (134);
usb_backlight_address
is at address 0xf7. Supported values are from 0x80 (off) to 0x83 (brightest).
As you said those controls works out of the box so it was really simple to find them.
Here my diff --color=auto ~/isw/etc/isw.conf /etc/isw.conf
at this time:
1287,1288c1287,1288
< cooler_boost_off = 0
< cooler_boost_on = 128
---
> cooler_boost_off = 6
> cooler_boost_on = 134
1293,1294c1293,1294
< usb_backlight_half = 193
< usb_backlight_full = 129
---
> usb_backlight_half = 129
> usb_backlight_full = 131
1300,1301c1300,1301
< usb_backlight_address = 0xf7
< battery_charging_threshold_address = 0xef
---
> usb_backlight_address = 0xd3
> battery_charging_threshold_address = 0xd7
at this point just fan_mode_address
is left to find.
Note: the isw
script supports only 3 modes for usb_backlight_address
but this model has 4 modes so I set usb_backlight_half
being the least bright (0x81) and usb_backlight_full
being the brightest (0x82) leaving the medium bright out (0x82).
That looks nice. Can I ask you to share how you're proceeding about this? I mean, how are you finding addresses and so on.
For me, I simply "reverse engineered" by switching back and forth from windows to linux and changing battery threshold values.
I think it'd be great to have as much info as possible by anyone who's working on this
I think it'd be great to have as much info as possible by anyone who's working on this
I totally agree with this since it took me a while to get into the process of doing this.
To my understanding there are three ways you can do this:
isw -cp MSI_ADDRESS_DEFAULT
in the process to see what is changing (this is what I did to spot addresses and values for use_backlight
and cooler_boost
;The first method is trivial and really simple. The second and third methods are comparable but, even if it is much more painful and time consuming switching between OSes, I prefer the second because I couldn't find the source code of the suggested software anywhere and I'm not comfortable running such invasive tools without the possibility to look at the code.
Probably the third way should be "the way to go" but only if someone finds, or knows, a Windows alternative to od
and a little bit of knowledge of the Windows system to know where to find the EC to dump it and see it changing while playing around with MSI Center. Unfortunately I don't have the time to take this journey and I'm not interested in understanding Windows systems but I hope I provided enough info to inspire somebody to do so.
I forgot to mention that there might be EC values that wont survive on boot which could leave you only with method 3.
Striked out RWEverything to avoid people blindly follow the link.
I have good updates: I found the tool I was looking for ec-probe.
It will allow you to dump the EC while changing parameters in MSI Center and it is open-source.
Using ec-probe
I found other addresses and values but keep in mind that I didn't test yet on Linux any of the values I'm posting here so use it really carefully and maybe test if they checks out on your Windows too before trying to apply them.
Address: 2E ON value (means camera is on): 0A OFF value (means camera is off): 08
Address: 2C ON value (means microphone is off): 0A OFF value (means microphone is on): 08
Address: D9 ON value (screen is off): 01 OFF value (screen is on): 05
Address: 2D ON value (means Volume off): 0E OFF value (means Volume on): 0C
Seems controlled by software because there are no apparent changes in the dumped EC while switching it on/off.
Address: E8 Normal config: 00 Switched config: 10
Address: D9 OFF value (for instance: need to press Fn to change brightness): 05 ON value (for instance: no need to press Fn to change brightness): 07
Address: BF ON value: 28 OFF value: 08
Unfortunately I'm still confused about this but I took some notes:
User scenario | Settings | D2 | D4 | EB |
---|---|---|---|---|
Extreme Performance | Advanced | C4 | 4D | 00 |
Extreme Performance | Auto | C4 | 0D | 00 |
Balanced | - | C1 | 0D | 00 |
Silent | - | C1 | 1D | 00 |
Super Battery | - | C2 | 0D | 0F |
Last three columns are the addresses that are changing while switching "User scenarios" in MSI Center.
It appears that D2 is somehow related with the performances (C4 = performance, C1 = Balanced, C2 = Power save maybe) and D4 with the fan mode (4D = advanced, 0D = auto, 1D = off or something like that).
Still no idea what EB does but I would bet that it is controlling some other feature (maybe disabling it) to save battery.
Since in D4 the difference between 4D and 0D is exactly 64 (decimal) just like 64 was the difference between the fan modes as shown by this if statements I feel pretty confident about being D4 the Fan mode controller indeed.
This is amazing! Thank you so much for this comment. I think this allows us (and other people) to actually effectively develop windows-like functionality for all models in (kind of) a safe way. If you need any help or want to contact me, I'm sending you an email address with my contacts.
Good job!
So, I have explored a bit with the tool you provided. I can confirm basically what you said about the addresses. However, I still need to understand whether there are things changing because they need to or just due to some other process.
So, I noticed that the (almost) whole row 90 changed between extreme and silent (basically from 90-01
to 90-0E
). I feel this is due to "noise" and not to the actual change made by MSI control center. Can you confirm this? Everything else seems good to me.
I did more testing: there is indeed a changing value I missed in my previous post which is at the address 91 which value is 64 for Performance and Balanced modes and 53 for Silent and Super Battery modes.
I leave here two recordings annotated with what I was changing; this is the result of calling .\ec-probe.exe monitor -i 3
:
(time advances to the right)
As you can se there are no other changes that can be directly related with changing User Scenario.
In the row you cited (9X) I see only the aforementioned 91 plus 9E changing with the latter changing no matter if I was changing User Scenario or not. That seems to be what I would call an output address since the value is changing one unit at a time. It appears to be the measurement of something, maybe.
Here it is the updated table
User scenario | Settings | D2 | D4 | EB | 91 |
---|---|---|---|---|---|
Extreme Performance | Advanced | C4 | 4D | 00 | 64 |
Extreme Performance | Auto | C4 | 0D | 00 | 64 |
Balanced | - | C1 | 0D | 00 | 64 |
Silent | - | C1 | 1D | 00 | 53 |
Super Battery | - | C2 | 0D | 0F | 53 |
do not forget that all values in this table are in hex (64 is 100 decimal and 53 is 83).
A small update with what I tested today under GNU/Linux:
Feature | Confirmed | Address | On | Off | Description |
---|---|---|---|---|---|
WebCam | :heavy_check_mark: | 2E | 0A | 08 | Turn off webcam |
Microphone | :white_check_mark: | 2C | 0A | 08 | Turn on/off microphone excluded LED (doesn't really turn off the microphone) |
Speakers | :white_check_mark: | 2D | 0E | 0C | Turn on/off speakers excluded LED (doesn't really turn off the speakers) |
Screen Off | :heavy_check_mark: | D9 | 01 | 05 | Turn off the screen (don't know how to test the Off value since the screen turns back on as soon as you press any key) |
Fn :left_right_arrow: Win | :heavy_check_mark: | E8 | 10 | 00 | Make Fn key act as Super and viceversa |
Switch Fn mode | :heavy_multiplication_x: | D9 | 07 | 05 | Toggle Fn mode (whether is needed to press Fn to access function keys or not) |
USB Power Share | :heavy_check_mark: | BF | 28 | 08 | Allows to power USB devices while computer is off and |
I will try to keep this table up-to-date.
For now I'm leaving the Fan Mode out of this table since there are still too many ifs.
Switch Fn mode is not working for me when set using isw -s 0xD9 <05|07>
command (but is working out of the box with the shortcut: really strange...).
USB Power Share is working perfectly when set using isw -s 0xBF <8|40>
command but it resets on next boot to 0x28 automatically.
Great job really! super useful. I'll test some stuff as well as soon as I have time
Guess what: the realtime_cpu_fan_rpm_address
es moved too! Now they are at C8-C9 instead of CC-CD:
in /etc/isw.conf
change realtime_cpu_fan_rpm_address
:
[MSI_ADDRESS_DEFAULT]
address_profile = MSI_ADDRESS_DEFAULT
[...]
realtime_cpu_fan_rpm_address = 0xc8 # it was 0xcc
[...]
They probably figured that it was a good idea to respect the order used before in the schema (CPU before GPU).
No big surprise there, I honestly figured that basically everything changed here. One question though: how did you figure this out this time?
Thanks again for your work btw :)
how did you figure this out this time?
Just turning on/off the cooler_boost to make the RPMs goes up and down and of course I was expecting them not to be so different from the GPU on (which I knew was working as shown by isw -r
).
Actually they could have been just C9 and CD (for CPU and GPU respectively) I just assumed that the original schema was right assigning "two addresses" to the RPM addresses since the max values I registered on my laptop were 004D for the CPU and 0051 for the GPU. Those 00 could be just padding, right? I guess it doesn't really matter as long as the software which is reading the value is considering this.
Hi, I have some good updates but since keeping track of all discoveries was getting harder and harder and because I wanted to check if there was some kind of pattern in the design of the EC (for instance something like a "CPU area" and a "battery area") I started drawing a schema inspired by this, I'm just posting here a PNG export of my spreadsheet.
Most noticeable discovery are plugged status, charging status and battery charge.
Note: the text in italic and wrapped inside square brackets means that the feature was either not tested or never actually seen on my computer but can be assumed since is a "well known behavior" for that particular feature (see some value for the Shift Mode for instance).
You probably have to open it in another tab to see it clearly.
PS: I noticed that there are some similarities with this by BeardOverflow; just adding this as reference since I used it to understand what was going on with 0xD2 (Shift Mode) and 0xD4 (Fan Mode) addresses.
Just noticed that there is a typo in Shift Mode for value Turbo: 0xC4 is 196 in decimal (not 195).
Suggestion: do not apply any of the provided values before trying to question it. Please, do not assume blindly that everything I write is perfectly correct.
Amazing job as usual! I'm super busy these months so I don't really have time to check on all the stuff you posted...but sooner or later I'll try it out!
Add support Katana GF66 12UG (EC ver 1583EMS1).
Result of command
isw -cp MSI_ADDRESS_DEFAULT
:Once this is working on my system I plan on starting the development of an
AppIndicator
to controlisw
(see: OpenFreezeCenter by YoCodingmonster as reference for what I have in mind).Additional notes
I think EC updates for this laptop are released within the BIOS updates (but I may be mistaken) so I leave a list of the laptop models with share the same BIOS as listed in the MSI BIOS Release Notes contained in the BIOS update zip file.
MKT Name: