You are not logged in.

#1 2022-11-02 00:12:04

ltsdw
Member
Registered: 2020-04-20
Posts: 76

[Solved] Writing to EC registers to control fans doesn't work

I have this Acer Nitro 5 (AN515-57-530Y) and on Windows there's the NitroSense thing.
Monitoring the registers there I took note of what I found.

coolbost
register: 0x10
enabled: 0x01
disabled: 0x00

manual cpu fan control
resgiter: 0x22
enabled: 0x0c
disabled: 0x04

manual gpu fan control
register: 0x21
enabled: 0x30
disabled: 0x10

Controls cpu fan speed
resgiter: 0x37
values: from 0x00 to 0x64

Controls gpu fan speed
register: 0x3a
values: from 0x00 to 0x64

So on windows if I do something like:

ec-probe.exe write 0x22 0x0c
ec-probe.exe write 0x37 0x32

It will run the cpu fan at 50% speed.

But on linux the fans don't respond.

ec_probe write 0x22 0x0c
ec_probe write 0x37 0x32

or

echo -n -e "\014" | dd of="/sys/kernel/debug/ec/ec0/io" bs=1 seek=34 count=1 conv=notrunc
echo -n -e "\062" | dd of="/sys/kernel/debug/ec/ec0/io" bs=1 seek=55 count=1 conv=notrunc

Does nothing, the fans don't respond.
I can see from monitoring that the values are being write to the resgisters, but nothing happens, different from doing the exact same thing on windows, where the fans behave exactly like using the nitrosense.

Last edited by ltsdw (2024-01-10 13:53:26)

Offline

#2 2023-12-03 21:00:40

JoeCool
Member
Registered: 2019-08-12
Posts: 25

Re: [Solved] Writing to EC registers to control fans doesn't work

I have the AN515-42, it's different but the ec offsets are the same.

This has worked in the past. I even found some saved command lines that did definitely work. They are really similar to yours:

sudo ec-probe write 0x37 80 -v && sudo ec-probe write 0x22 0x0C -v #cpufan 80%
sudo ec-probe write 0x37 50 -v && sudo ec-probe write 0x22 4 -v #cpufan default

They do nothing on kernel: 6.6.1-zen1-1-zen
but I get this notice when loading mod eeprom: kernel: eeprom 6-0050: eeprom driver is deprecated, please use at24 instead
Maybe it is related.

Did you solve this issue?

EDIT: I was just messing with it some more and when I was waking up the dGPU with

sensors

the fans came to life, ran for a while and turned off.
I think the temp needs to be above 35°C and/or the dGPU need to be powered to make the fans turn on at all.

Last edited by JoeCool (2023-12-03 21:14:56)

Offline

#3 2023-12-04 00:10:13

ltsdw
Member
Registered: 2020-04-20
Posts: 76

Re: [Solved] Writing to EC registers to control fans doesn't work

It's weird that just when I decided to check this post again, there is another post from just some minutes ago... the universe is somewhat weird sometimes.

And no, I didn't find any solution yet, but at least now I now that I'm not going crazy.

What weird me out the most is that writing the same thing on Windows, using the native Windows nbfc, it works just fine.

For me at least, the temperature doesn't play an effect if ec-probe works or not, it will always ignore whatever value I write to those registers and will spin the fan at its own will. For example, even when the CPU's temperature goes above 92ºC, the fan will spin at max of 75% speed, which isn't ideal, the poor thing needs some cooling and should use 100% fan speed to cool stuff down.

As for the module eeprom, I don't think it's related, as I don't use this module either on vanilla arch linux kernel or my custom kernel.

But it would be interesting if you could remember the version of the kernel this worked before, so I could try to see if it would work here, maybe we could work from there to find a solution, or at least fill a bug report or something like that.

Offline

#4 2023-12-11 00:13:54

JoeCool
Member
Registered: 2019-08-12
Posts: 25

Re: [Solved] Writing to EC registers to control fans doesn't work

Haha, strange indeed.

My windows install refuses to boot since I upgraded my SSD so I can't check right now. I don't really need it anymore.

Setting the EC registers definitely affects the speed on my laptop. As soon as the temp threshold is reached and it's set for 100% it ramps up full gale. It takes a few seconds to reach the target speed after changing the registers though.

eeprom is probably unrelated I agree. It must have been some older kernel, back when I set the device up. Like 5.4 or even 4.19 but I can't tell you if it was summer and I just didn't notice the cutoff temp.

There could be some other setting to configure the fans, maybe even in NVRAM and not the EC registers. I think R/W Everything under windows does check both.

Offline

#5 2024-01-10 13:52:53

ltsdw
Member
Registered: 2020-04-20
Posts: 76

Re: [Solved] Writing to EC registers to control fans doesn't work

We have it figured out at I'm writing to the right register but still no fan control, besides all the other register 0x21, 0x22, you also have to write values between 0x11 and 0x20 to the register 0x03 to make it work, also if using battery health (which in my case seems to be 0x41) you sum it with 0x11 (0x52), so both works, otherwise it will disable the battery health, the same applies for battery calibration (0x80).

Last edited by ltsdw (2024-01-11 03:44:15)

Offline

#6 2024-01-11 00:43:51

JoeCool
Member
Registered: 2019-08-12
Posts: 25

Re: [Solved] Writing to EC registers to control fans doesn't work

Interesting. Thanks for the info. So mine is actually a little different. Too bad there is not actual documentation about this.
Acer has been helpful with disassembly instructions and touchpad BIOS fixes for Linux. But I think the support people don't know what to ask the firmware people for these kinds of questions.

Offline

#7 2024-01-11 03:43:43

ltsdw
Member
Registered: 2020-04-20
Posts: 76

Re: [Solved] Writing to EC registers to control fans doesn't work

Mhm, agreed, it took me almost 2 years to get this figured out, thanks to the user kensad-ops tinkering and watching the registers closely, if it wasn't for him, I would mostly wait for more years to come lol.

Sadly there's no way around it, I tried seeking help on unofficial acer discord server, at acer forum, linux forums, no luck whatsoever.

Maybe you'll have more luck asking at nbfc-linux or nbfc-revive, maybe someone will appear with a similar problem.

The strange thing is that your model seems to not need any change, based on the configuration files from this model an515-42, it should only be a matter of choosing the configuration file and enabling the nbfc service, really strange it won't work for you. Our models even share the same registers, although thinking better you wouldn't need to change the register 0x03, because it seems it was never required for this model (I don't even know exactly what the 0x03 register does, it seems to besides allowing for manually controlling the fans, also responsible for the health/calibration mode of the battery, and maybe even more stuff).

But I wish you luck, eventually things will get sorted for you too.

Last edited by ltsdw (2024-01-11 03:43:52)

Offline

Board footer

Powered by FluxBB