fix for acerfand on AAO with bios 3308

Discussion in 'Linux' started by hillsoft, Dec 6, 2008.

  1. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    I was installing Ubuntu 8.04.1 on my AAO (150GB 6cell XP). Dual booting with XP.

    I updated the firmware on my AAO to 3308 and was installing the scripts for fan control and noticed that the acerfand script wasn't running because it didn't like my BIOS version.

    So I loaded up the acerfand script and went in and made a couple tweaks.

    I added the following line to the list of BIOS's.

    BIOS_VERSION_3308="v0.3308"

    I also changed the check for bios versions from

    "${BIOS_VERSION_3304}" | "${BIOS_VERSION_3305}")

    to

    "${BIOS_VERSION_3304}" | "${BIOS_VERSION_3305}" | "${BIOS_VERSION_3308}")

    Saved it and put both acerfand and acer_ec.pl in /usr/local/bin

    Initially I verified that acer_ec.pl was reporting correct temps and it was. So I knew I just needed to tweak the acerfand script.

    I ran acerfand and now there were no errors in the logs about the bios versions. I ran glgears and let it run for a few minutes and used acer_ec.pl to monitor the temp. Once it hit 70F (46 in hex as reported by acer_ec.pl) the fan kicked on for a minute at most and shut back off. Works great for me.

    So if your using 3308 and want to use acerfand or you haven't used 3308 because of this problem you can try my changes. I will attach the modified acerfand to this message also.

    I don't guarantee this will work for everyone, and you should be very careful that you don't overheat your CPU. I recommend making sure acer_ec.pl works for you first. If your getting correct temp readings from it, then you should be able to use acerfand.

    Just do as I did. Run acerfand and keep doing a

    sudo perl acer_ec.pl ?= 58

    to monitor your cpu temp.

    Then run glgears and keep checking the cpu temp as noted above

    When the value reported hits 46 (which is 70F) the fan should come on shortly.
     
    hillsoft, Dec 6, 2008
    #1
  2. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    The above changes work with 3309 also assuming you do the above but make the changes 3309 instead of 3308 as detailed above.
     
    hillsoft, Dec 22, 2008
    #2
  3. hillsoft

    ndirons

    Joined:
    Dec 28, 2008
    Messages:
    52
    Likes Received:
    0
    Location:
    Australia
    Fix for acerfand on AAO with any bios

    Does anyone know how to fix this for all BIOS versions?
     
    ndirons, Dec 29, 2008
    #3
  4. hillsoft

    rachel

    Joined:
    Aug 10, 2008
    Messages:
    80
    Likes Received:
    0
    i uploaded a version that recognises 3309 a few days ago, to the usual URL (linked to from the howto). It also defaults to a newer bios than before, so should work anyway for new bioses until Acer move the registers again.
     
    rachel, Dec 29, 2008
    #4
  5. hillsoft

    rachel

    Joined:
    Aug 10, 2008
    Messages:
    80
    Likes Received:
    0
    Sorry, that's a lie. Used to be true. New version 0.06 uploaded which checks the bios version before reading /etc/acerfand.conf. This means you can override the detected bios version by putting in /etc/acerfand.conf eg:

    Code:
    BIOS_VERSION=$BIOS_VERSION_DEFAULT
    Or you can give it another known bios version, eg:

    Code:
    BIOS_VERSION=$BIOS_VERSION_3305
    Beforehand, it turns out, BIOS_VERSION_DEFAULT was only being used if your system didn't have dmidecode installed to read the actual bios version.
     
    rachel, Dec 29, 2008
    #5
  6. hillsoft

    Guest Guest

    Guest, Dec 30, 2008
    #6
  7. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    Are all you guys with problems with 3309 running Ubuntu 8.10?

    My system is 8.04.1 and my tweak for bios 3308 and 3309 have worked fine for both.

    Trying to get a handle one this issue regardless.

    Some things to check. Make sure you don't have any extra copies of acer_ec.pl or acerfand lying around. Especially if one is in your PATH and possibly being used instead of the newer ones.

    I have acerfand owned by root and belonging to the root group. Permissions on acerfand is 755. Permissions on acer_ec.pl is 644

    When I go to my /usr/local/bin directory and run the acer_ec perl script I get the following. First line is what I type second line is the output returned. Nothing is stripped from the second lines output. That is the exact formatting.

    Code:
    sudo perl acer_ec.pl ?= 58
    REG[0x58] == 0x25
    
    Can one of you having problems do the same? Make sure the output format of acer_ec.pl is the same as what I am seeing. Obviously you probably won't get 0x25 as your CPU temp, but the formatting and everything else should be the same.

    When checking my /var/log/syslog for log info from acerfand I see the following on startup.

    Code:
    Dec 29 20:47:20 fand: acerfand 0.04 starting  
    Dec 30 12:10:51 acer1 acerfand: Detected bios version v0.3309
    Dec 30 12:10:51 acer1 acerfand: Starting to govern acer fan speed. Interval: 5, fan-off: 60, fan-auto: 70
    Dec 30 12:10:52 acer1 acerfand: Set fan Off
    
    I see some Set fan Auto and Set fan Off at various times when the fan kicks on due to the CPU temp. But this is very infrequent.
     
    hillsoft, Dec 30, 2008
    #7
  8. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    Here is acerfand and acer_ec.pl from my /usr/local/bin directory.

    Edited for 3309.

    Not sure if it will help, but it will verify that there is nothing special about my files compared to what others are using.

    Make sure permissions for these are as I state above. Put them in your /usr/local/bin directory

    [attachment=0:3p1tbomj]acerfand.tgz[/attachment:3p1tbomj]
     
    hillsoft, Dec 30, 2008
    #8
  9. hillsoft

    seeklinux

    Joined:
    Dec 31, 2008
    Messages:
    4
    Likes Received:
    0
    So I just received my AAO yesterday (an SSD only model which came with XP). The first thing I did was flash to 3309. I then installed Ubuntu (Intrepid). When using acerfand, I too get the continually starting and stopping issue when trying to run acerfand. I have verified that the two scripts are exactly the same as posted here. I note that my fan appears to be running at a slow speed always (at least I think it is). I also determined the following:
    • The fan threshold is set to 0[/*:m:17y3mwjd]
    • The raw fan state being returned is 0x02[/*:m:17y3mwjd]
    • The FAN_STATE is continually $FAN_STATE_AUTO based on the raw fan state. This is causing the call to set the fan state to off (since below temp setting to turn to auto)[/*:m:17y3mwjd]
    • The temperature being returned is around 48 to 52 most of the time (when I was checking it anyway)[/*:m:17y3mwjd]
    • The computer temperature monitor applet (avail in Ubuntu) does not work. I guess someone could modify it to work with acer_ec.pl maybe?[/*:m:17y3mwjd]
    So then I tried an experiment. I tried setting in the /etc/acerfand.conf the following:
    INTERVAL=5
    FANOFF=50
    FANAUTO=52
    So this is what appeared to happen:
    • While the temp was less than 50, it did the start/stop every 5 seconds like before[/*:m:17y3mwjd]
    • Once it hit 50 the cycling stopped[/*:m:17y3mwjd]
    • I saw it go above 52 (I saw 57) and it shut the computer off immediately![/*:m:17y3mwjd]

    I might be able to come up with a solution if I had an idea of what the script should be doing. Right now, it seems I am better off not using acerfand. Not sure what is different about the machines having the cycling problem with acerfand. Maybe there is a hardware difference. If there is a real issue, it would seem the thing to do is maybe have a daemon that monitors the temperature and forces a shutdown if it gets above a certain level?
     
    seeklinux, Dec 31, 2008
    #9
  10. hillsoft

    mh-

    Joined:
    Sep 22, 2008
    Messages:
    39
    Likes Received:
    0
    Had the same problem with the fan spinning up every few seconds (3308). Apparently it didn't appreciate the value 0xaf (switch off) in register 0x55 - it got changed to 0xae. This caused the fan to spin up before switching off. It also meant that the current state wasn't recognized by the script, causing it to "switch off" the fan each time it ran (every five seconds by default)...

    Changing 0xaf to 0xae got rid of the spinning-up before switching off, but after a minute or two the system would do an emergency shutdown :p.

    I downgraded to 3305.
     
    mh-, Jan 1, 2009
    #10
  11. hillsoft

    draft

    Joined:
    Jan 1, 2009
    Messages:
    13
    Likes Received:
    0
    I also have this problem with bios 3309 and I tried to change the intervall in my /etc/acerfand.conf to 60 to see what happens:

    INTERVAL=60
    FANOFF=60
    FANAUTO=70

    with the result that my AAO shuts down immediately after ca. 1 min.

    This may be some overheating protection. If a register does not get polled every x seconds and fan is not in standard mode then the AAO shuts down as the temerature could be too high. However, it also could be some kind of bug ;)
     
    draft, Jan 1, 2009
    #11
  12. hillsoft

    Guest Guest

    I had to downgrade also.
     
    Guest, Jan 4, 2009
    #12
  13. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    Anyone with problems with bios 3309 and acerfand who wants to test something for me either drop me a PM or give me a shout and I will PM you a link to a test program.

    I have written my own program that reads the current CPU temp, and can turn the fan on or off. It is a single executable (my own compiled C code, and not using the perl scripts the current acerfand uses) and currently is more for testing and helping us isolate issues with the fan control.

    Currently what the test program does when run is read the CPU temp, displays the temp, turns the fan off. It then waits for you to hit enter and then it turns the fan back on and exits.

    What I am curious about seeing is on a problem system where the fan is on all the time, what happens when my test program is run. Does the fan turn off and stay off? Or does it turn off and come right back on? Also after hitting enter does the fan come back on as the program exits?

    If it works correctly it should display the correct temp, turns off the fan and it should stay off until you hit enter.

    If it does that then I should be able to finish the code so it actively monitors the temperature and controls the fan as needed.

    But a couple volunteers for testing might help us get a handle on this issue.
     
    hillsoft, Jan 5, 2009
    #13
  14. hillsoft

    draft

    Joined:
    Jan 1, 2009
    Messages:
    13
    Likes Received:
    0
    Changing the FAN_CMD_OFF to 3f and RAW_FAN_STATE_OFF to 0x3f, turns off the fan without the hard power off on BIOS version 3309. I have attached the modified acerfand, which works on my AA1.
     
    draft, Jan 16, 2009
    #14
  15. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    I will test these values on my 3309 Acer that worked originally with acerfand. If these values work for me too I will finish up my standalone fan control program (doesn't need acer_ec.pl as it talks to the embedded controller directly).

    If I need to I will put a command line switch in to select between the two sets of commands.

    I am also going to look into doing a Gnome applet too.
     
    hillsoft, Jan 16, 2009
    #15
  16. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    Ok. If your AA1 is running 3309 and acerfand currently works (like mine), don't change to 3f for the off command or state.

    Keep it at af.

    With 3f on my Acer the fan does turn off, but after 10 - 15 seconds the system hard powers down. Which is what happens on systems like draft's when he uses af.

    So unless we can figure out a way to determine which values a system needs, I will probably have to go with a configuration option to let people specify their off command.

    Would be nice if there is a way to detect this. Since we can't go by BIOS version now.
     
    hillsoft, Jan 16, 2009
    #16
  17. hillsoft

    draft

    Joined:
    Jan 1, 2009
    Messages:
    13
    Likes Received:
    0
    Hmm, if you set 0xaf, does it stay, or does the value change to 0xae? On my AA1, it changes to 0xae before the power off. The value 0x30 also works on my system (fan off, but no power off). Can you check this value on your system?
     
    draft, Jan 16, 2009
    #17
  18. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    30 puts my fan in a slow speed mode. Doesn't reset, but doesn't turn it off.

    AF returns AF
     
    hillsoft, Jan 16, 2009
    #18
  19. hillsoft

    mh-

    Joined:
    Sep 22, 2008
    Messages:
    39
    Likes Received:
    0
    Just confirming that using 0x3f rather than 0xaf works for me too.

    Might be possible to detect it by writing 0xaf and reading the result. If it's 0xaf - stick with it. If it got changed to 0xae - 0x3f should be used instead. Not a whole lot of sample data to base this theory on, but at least it's an idea ;).
     
    mh-, Jan 20, 2009
    #19
  20. hillsoft

    hillsoft

    Joined:
    Nov 30, 2008
    Messages:
    89
    Likes Received:
    0
    I haven't forgotten about updating this code. Have been busy with RL and other issues, but I will get back to this soon.

    The plan is to have a single binary that can be run that controls the fan. Should work with 3308 and 3309 and be able to detect the two different 3309 systems we currently have (no guarantees that there are not other variations out there).

    Nice thing is this is a binary that reads and writes the fan control registers directly. No need for perl scripts.

    I may do a GNOME panel version of this too, but that is not planned until after the main program is finished.
     
    hillsoft, Jan 24, 2009
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.