intel / thermal_daemon

Thermal daemon for IA
GNU General Public License v2.0
551 stars 118 forks source link

How to configure fan? #30

Closed ValdikSS closed 10 years ago

ValdikSS commented 10 years ago

Hello. I'm trying to configure thermald to control fan speed. I have Lenovo Thinkpad X220 and fan could be controlled by writing values to /sys/devices/platform/thinkpad_hwmon/pwm1

I tried to add CoolingDevice and to configure TripPoints, but it doesn't work. https://gist.github.com/ValdikSS/eafc877d9daec8783f6a

Here is debug output of thermald with debug loglevel and without any configuration file https://gist.github.com/ValdikSS/d9237ea80e8a3195eaa8

spandruvada commented 10 years ago

Good test.

I see this error “ I/O warning : failed to load external entity "/etc/thermald/thermal-conf.xml" error: could not parse file /etc/thermald/thermal-conf.xml “ So there is no config file used as you mentioned for log.

Do you see parse errors?

Send me log with the configuration file used.

Thanks, Srinivas

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 9:15 AM To: 01org/thermal_daemon Subject: [thermal_daemon] How to configure fan? (#30)

Hello. I'm trying to configure thermald to control fan speed. I have Lenovo Thinkpad X220 and fan could be controlled by writing values to /sys/devices/platform/thinkpad_hwmon/pwm1

I tried to add CoolingDevice and to configure TripPoints, but it doesn't work. https://gist.github.com/ValdikSS/eafc877d9daec8783f6a

Here is debug output of thermald with debug loglevel and without any configuration file https://gist.github.com/ValdikSS/d9237ea80e8a3195eaa8

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30.

ValdikSS commented 10 years ago

Sure. https://gist.github.com/ValdikSS/232e07dbf3e5f7dd986f

ValdikSS commented 10 years ago

It seems like TripPoints are ignored and I'm not sure what I have misconfigured. If you need, I can share access to my laptop over ssh.

spandruvada commented 10 years ago

Give me some time. Let me look at this. I can’t ssh from my work.

Thanks, Srinivas

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 9:30 AM To: 01org/thermal_daemon Cc: Pandruvada, Srinivas Subject: Re: [thermal_daemon] How to configure fan? (#30)

It seems like TripPoints are ignored and I'm not sure what I have misconfigured. If you need, I can share access to my laptop over ssh.

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30#issuecomment-49057858.

spandruvada commented 10 years ago
Lenovo ThinkPad X220 * QUIET x86_pkg_temp x86_pkg_temp 45000 passive SEQUENTIAL 1 _Fan 100 12 _Fan /sys/devices/platform/thinkpad_hwmon/pwm1 0 30 0 255 5

-->

ValdikSS commented 10 years ago

Your message is corrupted. Please quote tags.

spandruvada commented 10 years ago
Lenovo ThinkPad X220 * QUIET x86_pkg_temp x86_pkg_temp 45000 passive SEQUENTIAL 1 _Fan 100 12 _Fan /sys/devices/platform/thinkpad_hwmon/pwm1 0 30 0 255 5

-->

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 3:49 PM To: 01org/thermal_daemon Cc: Pandruvada, Srinivas Subject: Re: [thermal_daemon] How to configure fan? (#30)

Your message is corrupted. Please quote tags.

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30#issuecomment-49103279.

ValdikSS commented 10 years ago

This works, thanks! I'm not quite understand why it doesn't work with "active" type? I thought "active" is for fans and "passive" is for, well, passive cooling.

spandruvada commented 10 years ago

Yes. Then you need to set your preference to Active. The “Quiet” preference means you want passive controls. You can send a dbus message to change preference. The default preference is passive.

Thanks, Srinivas

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 4:10 PM To: 01org/thermal_daemon Cc: Pandruvada, Srinivas Subject: Re: [thermal_daemon] How to configure fan? (#30)

This works, thanks! I'm not quite understand why it doesn't work with "active" type? I thought "active" is for fans and "passive" is for, well, passive cooling.

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30#issuecomment-49104945.

ValdikSS commented 10 years ago

Aah, I see. Could you please make some more examples and documentation? It would be very useful. Is it possible to add cooling device without modifying trip points?

spandruvada commented 10 years ago

You can add multiple cooling devices for the same trip point. If the type is sequential, then they will be acted one after other (When previous one reaches max state). If parallel they all will be activated simultaneously.

Thanks, Srinivas

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 4:19 PM To: 01org/thermal_daemon Cc: Pandruvada, Srinivas Subject: Re: [thermal_daemon] How to configure fan? (#30)

Aah, I see. Could you please make some more examples and documentation? It would be very useful. Is it possible to add cooling device without modifying trip points?

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30#issuecomment-49105611.

ValdikSS commented 10 years ago

If I add new trip point, are auto-generated trip points are still active? I mean, should I add trip points which I can get from debug output? I'd like thermald to act just as without configuration, but with fan control.

ValdikSS commented 10 years ago

Wow, I crashed it. https://gist.github.com/ValdikSS/37e10c062b5b5d94204f

spandruvada commented 10 years ago

Yes. The default trips are all passive trips. So as long as you keep your preference to “passive” those will be still active.

Thanks, Srinivas

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 4:27 PM To: 01org/thermal_daemon Cc: Pandruvada, Srinivas Subject: Re: [thermal_daemon] How to configure fan? (#30)

If I add new trip point, are auto-generated trip points are still active? I mean, should I add trip points which I can get from debug output? I'd like thermald to act just as without configuration, but with fan control.

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30#issuecomment-49106229.

spandruvada commented 10 years ago

You don’t need to specify multiple trips for same cooling device. Once you hit the lowest trip, the cooling device is activated anyway. If you specify multiple trips, then you should specify multiple cooling devices.

Thanks, Srinivas

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 4:30 PM To: 01org/thermal_daemon Cc: Pandruvada, Srinivas Subject: Re: [thermal_daemon] How to configure fan? (#30)

Wow, I crashed it. https://gist.github.com/ValdikSS/37e10c062b5b5d94204f

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30#issuecomment-49106438.

ValdikSS commented 10 years ago

I see. Thanks a lot!

ValdikSS commented 10 years ago

Is it possible to control the speed of fan? For example, if I create new TripPoint with temperature 50000, is it possible to limit maximum fan speed until another TripPoint is reached?

spandruvada commented 10 years ago

You can. You can define multiple cooling devices for the same sysfs path with a different min and max. Then tie these to different trips. You can call your cooling devices such as _FAN_1, FAN_2 etc, Thanks, Srinivas

From: ValdikSS [mailto:notifications@github.com] Sent: Tuesday, July 15, 2014 4:51 PM To: 01org/thermal_daemon Cc: Pandruvada, Srinivas Subject: Re: [thermal_daemon] How to configure fan? (#30)

Is it possible to control the speed of fan? For example, if I create new TripPoint with temperature 50000, is it possible to limit maximum fan speed until another TripPoint is reached?

— Reply to this email directly or view it on GitHubhttps://github.com/01org/thermal_daemon/issues/30#issuecomment-49107854.

ValdikSS commented 10 years ago

Got it, thanks!

ValdikSS commented 10 years ago

It crashes with multiple trip points https://gist.github.com/ValdikSS/204aad1ccfa73974eda2

I can provide core file if needed.

ValdikSS commented 10 years ago
Sorted trip dump :
index 7071712: type:critical temp:70000 hyst:0 zone id:2 sensor id:1 cdev size:2

Program received signal SIGSEGV, Segmentation fault.
0x00000030048c49a8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
(gdb) bt
#0  0x00000030048c49a8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
#1  0x0000000000427670 in get_cdev_type (this=<optimized out>) at src/thd_cdev.h:161
#2  trip_dump (this=0x6c15f0) at src/thd_trip_point.h:151
#3  cthd_zone::zone_update (this=this@entry=0x6c1890) at src/thd_zone.cpp:164
#4  0x000000000041c245 in cthd_engine_default::read_thermal_zones (this=0x68c000) at src/thd_engine_default.cpp:425
#5  0x0000000000414bb9 in cthd_engine::thd_engine_start (this=this@entry=0x68c000, ignore_cpuid_check=<optimized out>) at src/thd_engine.cpp:198
#6  0x000000000040f3d4 in thd_dbus_server_proc (no_daemon=<optimized out>) at src/main.cpp:306
#7  main (argc=1, argv=0x7fffffffe628) at src/main.cpp:434
spandruvada commented 10 years ago

Please try a fix on development_0 branch: https://github.com/01org/thermal_daemon/commit/add12bc11865ba854849cff907d0babe928dfe2e

ValdikSS commented 10 years ago

Seems to be working fine. Thanks!