Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
fan control for x62 on linux
fan control for x62 on linux
Hi,
I've reverse engineered the windows utility posted on 51nb so that I could control the fan speed on linux: https://github.com/bitonic/x62-fancontrol . I don't know what the fan speed numbers represent exactly, but it seems to work. It also reads the temperature in the same way that the windows utility does. It seems to be vaguely consistent with the package temperature from coretemp.
I didn't test if the behavior was consistent with windows since I never even ran the windows utility, but it's just setting IO ports so I'd be inclined to think that if it works at all it's doing the right thing.
Using that code it should be trivial to write a daemon that automatically regulates the fan speed based on the temperature in a way that is less fidgety than the default one. The windows utility polls the temp and adjust the fan accordingly every second, so I'll probably write it in the same style once I figure out what the fan speed numbers are.
Francesco
I've reverse engineered the windows utility posted on 51nb so that I could control the fan speed on linux: https://github.com/bitonic/x62-fancontrol . I don't know what the fan speed numbers represent exactly, but it seems to work. It also reads the temperature in the same way that the windows utility does. It seems to be vaguely consistent with the package temperature from coretemp.
I didn't test if the behavior was consistent with windows since I never even ran the windows utility, but it's just setting IO ports so I'd be inclined to think that if it works at all it's doing the right thing.
Using that code it should be trivial to write a daemon that automatically regulates the fan speed based on the temperature in a way that is less fidgety than the default one. The windows utility polls the temp and adjust the fan accordingly every second, so I'll probably write it in the same style once I figure out what the fan speed numbers are.
Francesco
Re: fan control for x62 on linux
ok, i've added a "manager" mode, you can run it with:
This is already _much better_ than the default, the laptop is silent most of the time and the fans are not as jumpy. I can tweak the daemon more to wait a bit between switching levels but this is probably enough for now.
Code: Select all
sudo ./x62-fancontrol manager
Re: fan control for x62 on linux
Great work, thank you!
An idea: On my 3rd batch X62s, the fan is pretty much perfect, but when the temperature is low, sometimes the fan turns on at a high speed for a second or so. After monitoring the temperature for longer periods of time, I think this is due to occasional erroneous temperature readings (up to 255°C, but can be anything from 0 to 255°C). Neither the EC fan control nor the 51nb fan control program seem to be designed to handle wrong readings. To cancel out those non-real temperature spikes, I'd recommend a moving average, e.g. over the last 5-10 temperature readings. Of course, this makes refresh rates faster than 1 per second necessary, thus it would be better to implement it in the EC, but I don't think we'll ever see this.
An idea: On my 3rd batch X62s, the fan is pretty much perfect, but when the temperature is low, sometimes the fan turns on at a high speed for a second or so. After monitoring the temperature for longer periods of time, I think this is due to occasional erroneous temperature readings (up to 255°C, but can be anything from 0 to 255°C). Neither the EC fan control nor the 51nb fan control program seem to be designed to handle wrong readings. To cancel out those non-real temperature spikes, I'd recommend a moving average, e.g. over the last 5-10 temperature readings. Of course, this makes refresh rates faster than 1 per second necessary, thus it would be better to implement it in the EC, but I don't think we'll ever see this.
Sometimes coming over from the German forum...
X62s 3rd batch, [s]T61[/s] T70 14" 4:3 1st batch
X62s 3rd batch, [s]T61[/s] T70 14" 4:3 1st batch
Re: fan control for x62 on linux
that'd be very easy to do, and a good idea. i'm not sure when i'll get around to it, but obviously PRs are welcome. i think we're far from being a performance drag, even once every 250ms would be perfectly fine.NonesensE wrote: ↑Mon Nov 20, 2017 2:52 pmGreat work, thank you!
An idea: On my 3rd batch X62s, the fan is pretty much perfect, but when the temperature is low, sometimes the fan turns on at a high speed for a second or so. After monitoring the temperature for longer periods of time, I think this is due to occasional erroneous temperature readings (up to 255°C, but can be anything from 0 to 255°C). Neither the EC fan control nor the 51nb fan control program seem to be designed to handle wrong readings. To cancel out those non-real temperature spikes, I'd recommend a moving average, e.g. over the last 5-10 temperature readings. Of course, this makes refresh rates faster than 1 per second necessary, thus it would be better to implement it in the EC, but I don't think we'll ever see this.
Re: fan control for x62 on linux
ok, i've written a small script that survives wakeups from suspend -- see readme. the script works great so i doubt i'll update anytime soon, but contributions are welcome!
Re: fan control for x62 on linux
In theory, there is Notebook Fan Control (NBFC) for this purpose (and is available for Win&Linux), no need to re-invent the wheel. But I don't know yet how to condense your code into a NBFC config file
Tried to set a few registers and received surprise hibernation
Tried to set a few registers and received surprise hibernation
Sometimes coming over from the German forum...
X62s 3rd batch, [s]T61[/s] T70 14" 4:3 1st batch
X62s 3rd batch, [s]T61[/s] T70 14" 4:3 1st batch
-
- Posts: 9
- Joined: Sun Nov 06, 2016 7:01 pm
- Location: Langen, Germany
Re: fan control for x62 on linux
I've hacked something together for my board. For me, the fan starts at 50, 100 is the max.
Code: Select all
<?php
function getTemp() {
$temp = exec('./x62-fancontrol temp');
$temp=explode("\n",$temp);
$temp=$temp[count($temp)-1];
$temp=explode(" ",$temp);
$temp=$temp[count($temp)-1];
return $temp;
}
function setLuefter($staerke) {
$temp = exec('./x62-fancontrol set-fan-speed ' . $staerke);
}
$wartezeit=5;
//vorspannen, damit beim start der Luefter eher zu viel dreht
$count_extrem=$wartezeit;
$count_heiss=$wartezeit;
$count_warm=$wartezeit;
while (true) {
$luefter=0;
$temp1=getTemp();
sleep(1);
$temp2=getTemp();
$temp=min($temp1,$temp2);
echo "Temp: $temp\n";
if ($temp>85) {
$count_extrem++;
$count_heiss+=2;
$count_warm+=3;
} else if ($temp>80) {
$count_extrem--;
$count_heiss++;
$count_warm+=2;
} else if ($temp>75) {
$count_extrem--;
$count_heiss--;
$count_warm++;
} else {
$count_extrem--;
$count_heiss--;
$count_warm--;
}
$count_extrem =min($wartezeit*2, $count_extrem);
$count_extrem =max(0, $count_extrem);
$count_heiss =min($wartezeit*2, $count_heiss);
$count_heiss =max(0, $count_heiss);
$count_warm =min($wartezeit*2, $count_warm);
$count_warm =max(0, $count_warm);
if ($count_extrem > $wartezeit) {
echo "extrem\n";
$luefter=85;
} else if ($count_heiss > $wartezeit) {
echo "heiss\n";
$luefter=63;
} else if ($count_warm > $wartezeit) {
echo "warm\n";
$luefter=51;
} else {
echo ("kalt\n");
$luefter=0;
}
setLuefter($luefter);
}
?>
-
- Posts: 13
- Joined: Thu Jul 03, 2014 12:53 am
- Location: Footscray, Australia
Re: fan control for x62 on linux
Is it possible to read the fan speed?
Using your tool on my third batch X62, fan speed 0 is maximum, fan speed 1 is off and fan speeds 2 to 100 are increasing levels with 2 being the minimum and 100 being the maximum. Fan speeds 101-255 are equivalent to fan off.
Using your tool on my third batch X62, fan speed 0 is maximum, fan speed 1 is off and fan speeds 2 to 100 are increasing levels with 2 being the minimum and 100 being the maximum. Fan speeds 101-255 are equivalent to fan off.
Re: fan control for x62 on linux
nope, i just reverse-engineered the windows app -- it was quite clear from the binary what code sets the speed and reads the temperature. sadly the windows application doesn't include anything regarding reading the fan speed.
somebody with more familiarity with how these controllers usually work could probably spot some patterns and make a guess on how to read the fan speed, but i have no clue.
Re: fan control for x62 on linux
Does this 51nb app work for you well?
I can't make it work under Windows. Did nnot try out the Linux version yet.
I can't make it work under Windows. Did nnot try out the Linux version yet.
Too many thinkpads not enough time!
(stable under reduction)
(stable under reduction)
Re: fan control for x62 on linux
yes, it works great. the only problem is that you have to restart it after resume, but the x62-fancontrol-manager.py script i added takes care of that. i have it start up on boot using a simple systemd service.
Re: fan control for x62 on linux
Then I must do something wrong way. I set all the data in ThermalTable, run the .exe file, and it works OK... for a short while (5-10mins). I've set everything to keep my system silent until it reaches 60C, and then pump out the fan with speed that ommits the low-pitch noise.
EDIT: it seems that the application stops working properly when going down with temps. This is my termal table:
00,0,0,0,
49,0,0,0,
60,50,50,0,
73,70,20,0,
82,75,2,0,
255,0,100,0
I've got the app in the "autostart", generally a bit annoying I need to minimize or close the window directly after start, but it is as it is. The fan settings work OK just as long as they are going up - when they are turning back to the state where the fan shoud not spin at all, I've got the noisy, low-speed fan movement that should not occur with such settings at all.
I should move this one to another thread - sorry for hijack
EDIT: it seems that the application stops working properly when going down with temps. This is my termal table:
00,0,0,0,
49,0,0,0,
60,50,50,0,
73,70,20,0,
82,75,2,0,
255,0,100,0
I've got the app in the "autostart", generally a bit annoying I need to minimize or close the window directly after start, but it is as it is. The fan settings work OK just as long as they are going up - when they are turning back to the state where the fan shoud not spin at all, I've got the noisy, low-speed fan movement that should not occur with such settings at all.
I should move this one to another thread - sorry for hijack
Too many thinkpads not enough time!
(stable under reduction)
(stable under reduction)
Re: fan control for x62 on linux
mhm, if i have the time i might take a look at the binary again to see if i spot a bug -- then maybe i can patch the windows binary to fix it .wujstefan wrote: ↑Sat Dec 23, 2017 9:37 amThen I must do something wrong way. I set all the data in ThermalTable, run the .exe file, and it works OK... for a short while (5-10mins). I've set everything to keep my system silent until it reaches 60C, and then pump out the fan with speed that ommits the low-pitch noise.
EDIT: it seems that the application stops working properly when going down with temps. This is my termal table:
00,0,0,0,
49,0,0,0,
60,50,50,0,
73,70,20,0,
82,75,2,0,
255,0,100,0
I've got the app in the "autostart", generally a bit annoying I need to minimize or close the window directly after start, but it is as it is. The fan settings work OK just as long as they are going up - when they are turning back to the state where the fan shoud not spin at all, I've got the noisy, low-speed fan movement that should not occur with such settings at all.
I should move this one to another thread - sorry for hijack
however i'm not sure it's worth putting the time into the proprietary utility since i reproduced its functionality... it should be fairly easy to port the code to windows.
-
- Senior Member
- Posts: 837
- Joined: Wed May 19, 2010 11:21 pm
- Location: Pardubice, Czech Republic
- Contact:
Re: fan control for x62 on linux
Code: Select all
void unknown_communication(void) {
printf("Sending unknown commands\n");
set_0x6C(0x33);
outb(0x06, 0x68);
}
T420 i7 3612QM seabios; T420 i7 3630QM; T400 Q9100 seabios; T61 P9600; T60 libreboot; x62; x60s libreboot, led; x24 xiphmont led
Re: fan control for x62 on linux
nothing, i just replicated what the windows app does. for some parts of the code i can take i guess, but i have no clue what this does, hence the name.jaspen-meyer wrote: ↑Sun Dec 24, 2017 1:23 pmWhat do we know about this function?Code: Select all
void unknown_communication(void) { printf("Sending unknown commands\n"); set_0x6C(0x33); outb(0x06, 0x68); }
Re: fan control for x62 on linux
did anyone managed to come up with a table that eliminates the noise at all?
I have tried different combinations but the noise does come back every time.
I have tried different combinations but the noise does come back every time.
X61 (T9300, 8gb RAM, 120gb SSD, LED SXGA+, integrated webcam, invisible touchpad, modded battery etc.)
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Can I replace my T440p stock fan with a Noctua fan?
by cultOfThinkpad » Wed Jan 10, 2024 2:41 pm » in ThinkPad T430-T490 / T530-T590 Series - 4 Replies
- 1567 Views
-
Last post by keithsketchley
Mon Feb 26, 2024 10:04 am
-
-
-
updating T480 bios without Windows (I use Linux)
by redglow » Fri Nov 03, 2023 3:15 am » in ThinkPad T430-T490 / T530-T590 Series - 25 Replies
- 30492 Views
-
Last post by redglow
Tue Nov 14, 2023 1:00 pm
-
-
-
thinkpad t440p Linux trackpad + trackpoint not working.
by jaggreaney » Thu Nov 09, 2023 2:54 pm » in ThinkPad T430-T490 / T530-T590 Series - 1 Replies
- 2815 Views
-
Last post by RealBlackStuff
Thu Nov 09, 2023 11:48 pm
-
-
- 4 Replies
- 5290 Views
-
Last post by marttt
Mon Jan 15, 2024 2:15 am
Who is online
Users browsing this forum: No registered users and 12 guests