Acpitool: commandline ACPI status program for laptops

Miscellaneous tools
Message
Author
muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

Acpitool: commandline ACPI status program for laptops

#1 Post by muggins »

http://freeunix.dyndns.org:8088/site2/acpitool.shtml
AcpiTool is (yet another) Linux ACPI client. It's a small command-line application, intended to be a replacement for the apm tool. The primary target audience are laptop users, since these people are most interested in stuff like battery status, thermal status and the ability to put their precious laptop to sleep. Most of this does not apply to desktop systems.

Besides "basic" ACPI information like battery status, AC presence, etc . . . , Acpitool also supports various extensions for Toshiba, Asus and IBM Thinkpad laptops, allowing you to change the LCD brightness level, toggle fan on/off, and more.

The program simply accesses the /proc/acpi or /sysfs entries to get/set acpi values. Hence, you need a computer running a Linux kernel from the 2.4.x or 2.6.x series with acpi enabled, to use this program.

Code: Select all

# acpitool --help
 Usage: acpitool [option] . . . 
 Shows ACPI information from the /proc/acpi filesystem, like battery status,
 temperature, or ac power. Can also suspend your machine (if supported).

   -a, --ac_adapter   AC adapter information
   -A, --Asus         show supported Asus ACPI extensions (LCD brightness level, video out routing DSTD/acpi4asus info)
   -b                 battery status, available batteries only
   -c, --cpu          CPU information (type, speed, cache size, frequency scaling, c-states, . . .)
   -B, --battery      battery status, all info on all battery entries
   -e                 show just about everything
   -f, --fan          show fan status
   -F x               force fan on (x=1) or switch back to auto mode (x=0). (Toshiba only)
   -h, --help         show this help screen
   -j                 eject ultrabay device (Thinkpad only)
   -l x               set LCD brightness level to x, where x is 0..7 (Toshiba and Thinkpad only)
   -m x               switch the mail led on (x=1) or off (x=0) (Asus only)
   -n x               switch the wireless led on (x=1) or off (x=0). (Asus only)
   -o x               set LCD on (x=1) or off (x=0). (Asus only)
   -s, --suspend      suspend to memory (sleep state S3), if supported
   -S                 suspend to disk (sleep state S4), if supported
   -t, --thermal      thermal information, including trip_points
   -T, --Toshiba      show supported Toshiba ACPI extensions (LCD brightness level, video out routing, fan status)
   -v                 be more verbose (more detailed error messages, only usefull combined with other options)
   -V, --version      show application version number and release date
   -w, --wakeup       show wakeup capable devices
   -W x               enable/disable wakeup capable device x. The x can be seen when invoking -w first.
   -z x               set Asus LCD brightness level to x, where x is 0..15 (Asus only).

 If invoked without options, acpitool displays information about available batteries,
 AC adapter and thermal information.

 For more info, type man acpitool at the prompt.

 AcpiTool v0.5, released 24-Jul-2008
 Homepage: http://freeunix.dyndns.org:8000/site2/acpitool.shtml
Attachments
acpitool-0.5.1-i486.pet
(29.36 KiB) Downloaded 8823 times
Last edited by muggins on Wed 19 Aug 2009, 00:23, edited 1 time in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#2 Post by jpeps »

Thanks for the tool; now my Dell Latitude suspends correctly. I wasn't able to suspend via the keyboard with a USB mouse. (pointer would disappear...also couldn't restart x)

I noticed that when using ACPI, the CPU runs at max most of the time. When I boot without it, the CPU runs at min most of the time. (I'll run a few times and post the stats.)

ACPI ON:

time_in_state:
997500 80419
731500 18609
total_trans= 957
current frequency: 997500

ACPI=OFF

time_in_state:
997500 1586
731500 11713
total_trans= 21
current frequency: 731500

Edit: I guess the CPU just has more to do with ACPI on. After an hour or so, it's doing much better...using minumum CPU state over 1.5 X max; also doing a good job cooling.

Edit2: After a day just sitting there (not using), with ACPI on it's using max CPU almost 4X as much as min; seems like a real waste of energy compared with APM.

time_in_state:
997500 3834850
731500 998955
total_trans= 39415
current frequency: 997500
Last edited by jpeps on Sun 27 Jul 2008, 05:51, edited 1 time in total.

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#3 Post by aragon »

hi muggins,

yes it's great

Code: Select all

acpitool -s
works for me (too), it's brilliant.

with this and the scaling-governor-tips from

http://www.murga-linux.com/puppy/viewtopic.php?t=28443

it's getting better every day.

now i had to set up my fn-keys with xbindkeys and ... my laptops will be setup'ed quite nice.

cheers
aragon

p.s. ok, after that i had to discover how temp and fan-readout works with my lenovo, but this is a new chapter as i don't need this...

magerlab
Posts: 739
Joined: Sun 08 Jul 2007, 20:08

#4 Post by magerlab »

i just tried to run acpitool -s on my desktop computer
it really turned off
but when i pushed the button i got the desktop i left in just 3 seconds

what is really happening?

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#5 Post by muggins »

Hello Magerlab,

the -s option is for suspend/sleep, which I imagine must be like standby.

User avatar
Monson
Posts: 28
Joined: Sun 25 May 2008, 15:58
Location: Germany
Contact:

#6 Post by Monson »

Hello,

I also installed acpitool on my toshiba laptop, but it is a very old toshiba laptop.

I'd like to know if in the livecd of puppy4, is the vmlinuz-kernel generally acpi-enabled or not because I booted with "acpi=force" and acpitool says I have no acpi-extensions installed, not even Toshiba.

Does a tool exist that allows to enable acpi on laptops that may have a bios bug, being the reason why acpi is not detected by puppy?

Bye,

Monson.
[b]DE[/b]:Wer nicht wa:hlt, hat nichts zu melden/maulen. [b]EN[/b]:Those not voting have nothing to say/moan about.
Puppy 4.21; CD2HDD; AMD64 & X86. Slow: Laptop x86-PI@133MHz-64mb RAM (modded Puppy); Fast:Laptop AMD64X2@2.2GHz-4gb RAM.

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#7 Post by muggins »

Hi Monson,

what about do get from entering the following?

Code: Select all

ls /proc/acpi
ls /proc/acpi/toshiba
Also what model toshiba do you have? Do you know what sort of BIOS it has? Toshiba? Phoenix?

User avatar
peppyy
Posts: 443
Joined: Mon 27 Jun 2005, 23:49
Location: VT USA
Contact:

#8 Post by peppyy »

This is a wonderful tool! Thank you so much. I think with a bit more research thyis is just what I have been looking for.

Interesting, on my T30 Thinkpad the -s suspends the lcd but not the backlight, of course that is done with the lid button but it is really interesting to see the strange patterns when the power is removed from the controller.

I will look into the sensors for these buttons and see if I can get it to work automatically.

I have not had a PupTop that suspended correctly since apm on the old 600e Thinkpads. This is a major step forward in Mobile Puppy. I am running 4.0 full hd.

Edit: I created a script to run the command and a hotkey F4 and that is good. The laptop wakes with the Fn key or when the lid is opened but there is a catch of the backlight staying on. After suspending, the cover switch does ot shut the backlight off.

Still searching but really hopeful :)
Edit2:
terminal in proc/acpi reports the following when the lid switch is pressed and released.

Code: Select all

# cat event
ibm/hotkey HKEY 00000080 00005001
ibm/hotkey HKEY 00000080 00005002

Fn+F4 reports

Code: Select all

ibm/hotkey HKEY 00000080 00001004
Who knows how to translate this information into commands?
If I could use the 5001 which shuts the backlight off and sleep2 then the acpitool -s it would be perfect.
Puppy Linux...
It just works!

joeboy
Posts: 2
Joined: Wed 22 Nov 2006, 02:15
Location: Germany

#9 Post by joeboy »

I've tried it on my Asus eeepc 701. the sleep command acpitool -s works. but the only way to wake it up is with tne powerbutton and the worst is after waking up the display is still dark. Maybe the backlight is off.

does somebody know how to fix it?

regards Joeboy

User avatar
Volsung
Posts: 160
Joined: Fri 28 Sep 2007, 02:39
Location: A house with broken Windows

#10 Post by Volsung »

Might want to check this out:
http://www.thinkwiki.org/wiki/Problems_ ... end-to-ram

One problem that is not listed here: on my eee 701, I find my wireless dead after a resume. A scan reveals that no access points are available regardless of how many times I toggle the wireless card on and off. Anyone else with this problem?
I've tried it on my Asus eeepc 701. the sleep command acpitool -s works. but the only way to wake it up is with tne powerbutton
Just for the record, the default xandros OS does this as well, so I think it is a hardware thing rather than something wrong with this. I actually like that it does this.
[img]http://img385.imageshack.us/img385/3843/magussigbc0.jpg[/img]

User avatar
peppyy
Posts: 443
Joined: Mon 27 Jun 2005, 23:49
Location: VT USA
Contact:

#11 Post by peppyy »

I had not installed the acpitool on my newest laptop with 3.01 and when I ran the suggested test from the thinkwiki

Code: Select all

# echo mem > /sys/power/state
It suspended fine. I forgot that you need to use the Fn key to wake it up so I was a bit nervous for a minute. It still does not shut off the backlight. I have found there is an app called radeontool which does that. I will see if I can get that working next.
Puppy Linux...
It just works!

User avatar
peppyy
Posts: 443
Joined: Mon 27 Jun 2005, 23:49
Location: VT USA
Contact:

#12 Post by peppyy »

Ok I a stuck again. Tere seeme to be very little doccumentation for radeontool.

I was able to find a .deb and undeb it but it reports.

Code: Select all

# radeontool
Radeon hardware not found in lspci output.
I checked with the 3DCC and it reports.

Code: Select all

Your /var/log/Xorg.0.log reports you have this card:

(--) PCI:*(1:0:0) ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500] rev 0, Mem @ 0xe0000000/27, 0xc0100000/16, I/O @ 0x3000/8
lspci reports

Code: Select all

 lspci
00:00.0 Class 0600: 8086:1a30 (rev 04)
00:01.0 Class 0604: 8086:1a31 (rev 04)
00:1d.0 Class 0c03: 8086:2482 (rev 02)
00:1d.1 Class 0c03: 8086:2484 (rev 02)
00:1d.2 Class 0c03: 8086:2487 (rev 02)
00:1e.0 Class 0604: 8086:2448 (rev 42)
00:1f.0 Class 0601: 8086:248c (rev 02)
00:1f.1 Class 0101: 8086:248a (rev 02)
00:1f.3 Class 0c05: 8086:2483 (rev 02)
00:1f.5 Class 0401: 8086:2485 (rev 02)
00:1f.6 Class 0703: 8086:2486 (rev 02)
01:00.0 Class 0300: 1002:4c57
02:00.0 Class 0607: 104c:ac55 (rev 01)
02:00.1 Class 0607: 104c:ac55 (rev 01)
02:02.0 Class 0607: 104c:ac50 (rev 01)
02:08.0 Class 0200: 8086:1031 (rev 42)
03:00.0 Class 0c03: 1033:0035 (rev 43)
03:00.1 Class 0c03: 1033:0035 (rev 43)
03:00.2 Class 0c03: 1033:00e0 (rev 04)
I have read that you can rename the device radeon but I have no idea how to do that.

hardinfo reports a pci device

Code: Select all

Class 0607		: 104c:ac55 
the vendor id,

Code: Select all

oem vendor 1014:0517
bus, device, function  1,0,0
relates to the correct video adapter Radeon 7500 128mb prefetchable, etc.

Perhaps something is being improperly detected. Is there another tool that could give me more information or do I already have more than enough?[/code]
Puppy Linux...
It just works!

peter_jammo
Posts: 20
Joined: Thu 26 Mar 2009, 16:03

#13 Post by peter_jammo »

I've installed acpitool on my Toshiba Tecra 8100 in an attempt to troubleshoot a non running fan.

None of the fan or temperature commands seem to work, and when I try the -T command I get:

Sorry, but no Toshiba ACPI extensions were found on this system.

Edit after remembering how to copy/paste


# acpitool -e
Kernel version : 2.6.25.16 - ACPI version : 20070126
-----------------------------------------------------------
Battery status : <not available>

AC adapter : <info not available or off-line>
Fan : <not available>

CPU type : Pentium III (Coppermine)
CPU speed : 697.433 MHz
Cache size : 256 KB
Bogomips : 1395.89
Function Show_CPU_Info : could not read directory /proc/acpi/processor/
Make sure your kernel has ACPI processor support enabled.

Thermal info : <not available>

wakeup devices : <not available>




Any thoughts?

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#14 Post by muggins »

peter,

if you run lsmod does it show the toshiba_acpi module as being loaded? If not, try adding it to the Bootmanager list of modules to load, reboot, and see whether that makes any diff. (Menu->System->BootManager)

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#15 Post by muggins »

Plus it says here that:
Another important note: This driver does not work on all Toshiba laptops, particularly those models which seem to have a BIOS or other firmware which was not developed by Toshiba itself. New reverse engineering work will have to be done on these machines, or Toshiba will have to disclose the necessary details. (For support of machines with Phoenx BIOS, try the [Omnibook driver].) The error you will see in this case is:

$ modprobe toshiba_acpi
FATAL: Error inserting toshiba_acpi
(.../kernel/drivers/acpi/toshiba_acpi.ko): No such device

peter_jammo
Posts: 20
Joined: Thu 26 Mar 2009, 16:03

#16 Post by peter_jammo »

Thanks for the help.

I added the module as suggested, but the results appear to suggest that my bios doesn't support it - error message as per your second post.

I believe that the bios is Toshiba, and on checking the Toshiba web page, there are several newer versions of the bios, the newest being 2003.

I guess the next step is to update the bios, and then maybe that will either fix the problem or enable me to successfully load the toshiba_acpi module. I've done it before on a different incarnation of the Tecra (now a composite of at least 4 machines), using the diskette version, but I seem to remember that had to be run from dos. Any suggestions for a puppy bios update?

EDIT

After reading the new bios readme, it says "For Linux
or other operating systems, a DOS emulator will be required."

Any suggestions what to use?

Thanks again.

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#17 Post by muggins »

peter,

which toshiba model do you have? What is the output of lsmod? Have you tried?:

Code: Select all

modprobe -r toshiba_acpi
modprobe omnibook

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#18 Post by muggins »

Ignore the last bit, as it looks like the omnibook module isn't in p412. It will need to be compiled...which pupversion are you using?

peter_jammo
Posts: 20
Joined: Thu 26 Mar 2009, 16:03

#19 Post by peter_jammo »

G'day Muggins,
Thanks for your help. I'm running a stand alone full install of 4.1.2 and have also tried a live CD of 4.2 - no difference - still can't load Toshiba_acpi module.

Its a Tecra 8100 (made 1999 - 2001ish I think). Googling suggests that someone running Knoppix has got toshiba_acpi running on his 8100, and that has fixed his fan problem which makes me think that my old bios version may be the issue.

lsmod doesn't want to paste here, but doesn't show toshiba_acpi, nor any acpi modules. This makes me think that as the bios acpi should be turning on the fan, that I may have a hardware fault, but unless I can find a way to manually switch on the fan I guess I wont know for sure.

I tried modprobe and got:

# modprobe toshiba_acpi
FATAL: Error inserting toshiba_acpi (/lib/modules/2.6.25.16/kernel/drivers/acpi/toshiba_acpi.ko): No such device

the file exists in the correct directory and the error message is the same as the one you posted above.

Any more suggestions greatfully received. At the moment my options (based on what I know how to do) are restricted to reloading Win98 so I can flash the bios, but that requires me to make a boot diskette and I'm not sure I can do that whilst running puppy, or as a last resort hard wiring the fan off the PS2 5V pins.
Last edited by peter_jammo on Sun 05 Apr 2009, 11:10, edited 1 time in total.

peter_jammo
Posts: 20
Joined: Thu 26 Mar 2009, 16:03

#20 Post by peter_jammo »

BTW, pretty sure it's a Toshiba bios. Every Phoenix bios I've loked at in google images has a blue background and Phoenix at the top. They all have a similar style too. Mine has no name, only a version number, has a black background and is a very different style. In Windows (Ie Toshiba utilities loaded in Win) there is Toshiba Hardware config tool which changes some of the bios settings, and that also makes me think it's likely to be an in house bios.

I guess that means that the omnibook acpi wouldn't work even if I did have access.

Somewhat suspiciously, Toshiba lists every BIOS version except from mine on their downloads page. It just skips from 1.6 to 1.8. Just that makes me think that 1.7 may be a bit of a problem child anyway.

Post Reply