Bug 114612

Summary: kpowersave doesn't provide current power state
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Lars Müller <lmuelle>
Component: KDEAssignee: Danny Kukawka <dkukawka>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dkukawka
Version: Beta 4   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: tar ball of the info and state content

Description Lars Müller 2005-08-31 23:06:38 UTC
lmuelle@gab:~> acpi
     Battery 1: discharging, 81%, 02:06:30 remaining
gab:~ # rcpowersaved status
Checking for service powersaved                                      running

But kpowersave provides: 1% charged, charging battery, 1197 MHz
Comment 1 Danny Al-Gaaf 2005-08-31 23:36:37 UTC
What say "powersave -B" ? Is HAL and DBUS running?
Comment 2 Forgotten User ZhJd0F0L3x 2005-09-01 00:18:37 UTC
and "powersave -d"
Comment 3 Lars Müller 2005-09-01 11:01:34 UTC
After I unpluged the power I got:

gab:~ # rchal status
Checking for service HAL daemon                                      running
gab:~ # rcdbus status
Checking for service D-BUS daemon                                    running
lmuelle@gab:~> powersave -B
Battery: 50 %
AC is online.
Battery0: 50
lmuelle@gab:~> powersave -d
Battery: 50 % -1 minutes.

Half a minute later I get:
lmuelle@gab:~> powersave -B
Battery: 50 % 57 minutes
Battery0: 50
lmuelle@gab:~> powersave -d
Battery: 50 % 80 minutes.

But yesterday evening it never switched to battery mode.
Comment 4 Holger Macht 2005-09-01 11:20:30 UTC
Please try to cat /proc/acpi/battery/<your battery>/state or
/proc/acpi/battery/<your battery>/info and tell us if the command lasts longer
then usual. We had another machine were it lastet too long.

And if that't the case, please reboot with ec_burst=0 as kernel parameter and
retest.
Comment 5 Lars Müller 2005-09-01 11:54:54 UTC
I've used this script to produce the required data:

declare -i run=0
while [ 1 ]; do
  echo $run
  NUM=$( printf "%03d" $run)
  DATE=$( date)
  echo "date: $DATE" >info-$NUM; echo "date: $DATE" >state-$NUM
  cat /proc/acpi/battery/BAT0/info >>info-$NUM
  cat /proc/acpi/battery/BAT0/state >>state-$NUM
  run=$((run+1))
  sleep 2
done
Comment 6 Lars Müller 2005-09-01 12:06:41 UTC
Created attachment 48445 [details]
tar ball of the info and state content

I've unplugged the power with run=1 and got marked offline with run=10

I replugged the power with run=12 and got marked online with run=23
Comment 7 Forgotten User ZhJd0F0L3x 2005-09-01 12:17:07 UTC
the cpu of the battery needs some time to detect if the battery is charged or
discharged, this could well be normal.

Interesting would be:
- "time cat /proc/acpi/battery/BAT0/state"
- "time cat /proc/acpi/battery/BAT0/info"

if you want to know if you are online or offline, you have to look into
/proc/acpi/ac_adapter/*
Comment 8 Lars Müller 2005-09-01 12:23:34 UTC
gab:~ # time cat /proc/acpi/battery/BAT0/info 
present:                 yes
design capacity:         39960 mWh
last full capacity:      34460 mWh
battery technology:      rechargeable
design voltage:          11100 mV
design capacity warning: 3000 mWh
design capacity low:     1000 mWh
capacity granularity 1:  200 mWh
capacity granularity 2:  200 mWh
model number:            CGA-E/601
serial number:           340
battery type:            LION
OEM info:                Panasonic

real    0m0.126s
user    0m0.004s
sys     0m0.084s
gab:~ # time cat /proc/acpi/battery/BAT0/state 
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            24274 mW
remaining capacity:      33500 mWh
present voltage:         12803 mV

real    0m0.022s
user    0m0.000s
sys     0m0.020s
Comment 9 Lars Müller 2005-10-17 13:06:54 UTC
Is there any more information missiing from me?
Comment 10 Thomas Renninger 2005-10-17 13:25:40 UTC
The values look normal.
IIRC there is a bug in hal/kpowersave. Danny should know more about that.