Bug 4399 - wmlaptop - ACPI and APM isn't working
Summary: wmlaptop - ACPI and APM isn't working
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 4430
  Show dependency treegraph
 
Reported: 2012-02-03 16:14 CET by Kamil Rytarowski
Modified: 2012-02-17 10:02 CET (History)
2 users (show)

See Also:
Source RPM: wmlaptop
CVE:
Status comment:


Attachments
wrong values shown (3.03 KB, image/png)
2012-02-13 20:17 CET, Kamil Rytarowski
Details

Description Kamil Rytarowski 2012-02-03 16:14:53 CET
Description of problem:
wmlaptop - ACPI and APM isn't working

------------------------

$ wmlaptop 
Cannot support ACPI (the file /proc/acpi/info don't exists)
Switching to APM..
Cannot support APM (the file /proc/apm don't exists)
.. and now ?.. i must die

-------------------------
$ ls /proc/acpi/ -R
/proc/acpi/:
button/  event  fixed_events  wakeup

/proc/acpi/button:
lid/

/proc/acpi/button/lid:
LID0/

/proc/acpi/button/lid/LID0:
state

------------------------
$ apm
No APM support in kernel
------------------------

Version-Release number of selected component (if applicable):
$ rpm -qa|grep -E "apm|acpi|kernel"
kernel-desktop-3.2.2-1.mga2-1-1.mga2
kernel-desktop-devel-3.2.2-1.mga2-1-1.mga2
kernel-desktop-latest-3.2.2-1.mga2
virtualbox-kernel-3.2.2-desktop-1.mga2-4.1.8-8.mga2
kernel-firmware-20111229-1.mga2
fglrx-kernel-desktop-latest-8.920-9.mga2.nonfree
fglrx-kernel-3.2.2-desktop-1.mga2-8.920-9.mga2.nonfree
kernel-userspace-headers-3.2.2-1.mga2
kernel-desktop-devel-latest-3.2.2-1.mga2
apmd-3.2.2-26.mga1
acpid-2.0.14-2.mga2
virtualbox-kernel-desktop-latest-4.1.8-8.mga2
acpi-1.5-2.mga1
lib64apm1-3.2.2-26.mga1


Linux localhost.localdomain 3.2.2-desktop-1.mga2 #1 SMP Thu Jan 26 10:18:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux



How reproducible:
Always

Steps to Reproduce:
1. urpmi wmlaptop
2. $laptop
3.
Kamil Rytarowski 2012-02-03 16:15:46 CET

CC: (none) => dirteat

Kamil Rytarowski 2012-02-03 16:15:56 CET

CC: (none) => tmb

Comment 1 Kamil Rytarowski 2012-02-03 16:16:43 CET
I'm adding to CC the maintainer and the kernel maintainer.
Comment 2 Chris Denice 2012-02-03 17:31:37 CET
Yep, because /proc/acpi/stuff disappeared with newest kernels.

I am currently fixing it, namely rewriting some codes.

Cheers.
Comment 3 Kamil Rytarowski 2012-02-03 17:36:29 CET
Hi, and what about APM support in kernels? Is this a bug in the package or in the kernel?
Comment 4 Chris Denice 2012-02-04 12:50:01 CET
According to Master TMB, just sitting nearby me at FOSDEM, this is application bug :) I am fixing...

Cheers,
Chris.
Kamil Rytarowski 2012-02-07 19:17:32 CET

Blocks: (none) => 4430

Comment 5 Chris Denice 2012-02-09 02:10:12 CET
I have tried to replace all calls to /proc/acpi by /sys/class/power_supply stuff. Please, try wmlaptop-1.4-2.mga2 if it works for you.

Cheers,
Chris.
Comment 6 Kamil Rytarowski 2012-02-09 02:17:22 CET
$ wmlaptop 
The uevent file (/sys/class/power_supply/ADP1/uevent) has not 
'CHARGE_FULL_DESIGN' and not event 'CHARGE_FULL' tag
wmlaptop will ignore this battery. If you don't want to see
this message, use '-q' option as argument.

The uevent file (/sys/class/power_supply/BAT0/uevent) has not 
'CHARGE_FULL_DESIGN' and not event 'CHARGE_FULL' tag
wmlaptop will ignore this battery. If you don't want to see
this message, use '-q' option as argument.

Found 2 battery's entry
Enable autoShutdown at 1% battery state
Use a shutdown delay of 1 minutes
The real poweroff will run at 1% battery state + 1 minutes
It seems that you do not have 'cpufreq_userspace' module loaded in your kernel
I try to call "/sbin/modprobe cpufreq_userspace"
FATAL: Module cpufreq_userspace not found.
you should do it by yourself (maybe you need to recompile kernel ?)
Error reading the info file (/sys/class/power_supply/ADP1/status):
No such file or directory
Comment 7 Chris Denice 2012-02-09 02:50:40 CET
Please, give me the output of

ls /sys/class/power_supply

and

cat /sys/class/power_supply/BAT0

cat /sys/class/power_supply/ADP1

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors


chris
Comment 8 Kamil Rytarowski 2012-02-09 02:55:49 CET
$ ls /sys/class/power_supply
ADP1@  BAT0@

$ env LC_ALL=C cat /sys/class/power_supply/BAT0/
cat: /sys/class/power_supply/BAT0/: Is a directory

$ env LC_ALL=C ls /sys/class/power_supply/BAT0/
alarm	     energy_full_design  power		status	    uevent
cycle_count  energy_now		 power_now	subsystem   voltage_min_design
device	     manufacturer	 present	technology  voltage_now
energy_full  model_name		 serial_number	type

$ env LC_ALL=C ls /sys/class/power_supply/ADP1/
device	online	power  subsystem  type	uevent

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
ondemand conservative powersave userspace performance
Comment 9 Chris Denice 2012-02-09 08:56:43 CET
Sorry for BAT0 I typoed, what gives:


cat /sys/class/power_supply/BAT0/uevent

thanks.
Comment 10 Kamil Rytarowski 2012-02-09 13:30:22 CET
$ cat /sys/class/power_supply/BAT0/uevent 
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
POWER_SUPPLY_VOLTAGE_NOW=12468000
POWER_SUPPLY_POWER_NOW=1000
POWER_SUPPLY_ENERGY_FULL_DESIGN=5200000
POWER_SUPPLY_ENERGY_FULL=4430000
POWER_SUPPLY_ENERGY_NOW=4430000
POWER_SUPPLY_MODEL_NAME=Dell
POWER_SUPPLY_MANUFACTURER=SDI
POWER_SUPPLY_SERIAL_NUMBER=40134

$ cat /sys/class/power_supply/ADP1/uevent 
POWER_SUPPLY_NAME=ADP1
POWER_SUPPLY_ONLINE=1
Chris Denice 2012-02-09 15:56:40 CET

Status: NEW => ASSIGNED

Comment 11 Chris Denice 2012-02-11 19:22:20 CET
Round 2.

Try wmlaptop-1.4-3.mga2 and let me know.

Cheers,
Chris.
Comment 12 Kamil Rytarowski 2012-02-13 19:06:05 CET
$ wmlaptop 
'FULL_DESIGN' in </sys/class/power_supply/BAT0/uevent>
is different from 'FULL' tag:
If you want to use it pass '--lfc=1' (1 is the number of this battery)
If you don't want this message to be displayed anymore pass '-q'

Found 1 battery's entry
Enable autoShutdown at 1% battery state
Use a shutdown delay of 1 minutes
The real poweroff will run at 1% battery state + 1 minutes
It seems that 'userspace' governor is not set
wmlaptop may not control CPU frequency
Unable to write </sys/devices/system/cpu/cpu0/cpufreq/scaling_governor>

-----------
Ok it's running now but there are stil these warnings.
Comment 13 Chris Denice 2012-02-13 19:28:03 CET
Yes, fantastic!

So the warnings are actually the expected behaviour of wmlaptop :)

1) It checks if you're battery is charged to its genuine design, if not your battery gets old. If you want to use the full design instead of last full, play with --lfc

2) It is an active cpufreq daemon in itself, provided the governor is set to userspace (hence the warnings). If on userspace, you'll certainly need to sudo or can write into freq to allow it to change freq.

3) If not userspace, it just display the current frequency with this warning.

So, I am closing the bug. Reopen if it crashes again.

Chris.

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED

Comment 14 Kamil Rytarowski 2012-02-13 20:17:00 CET
I'm reopening, it's showing wrong values.

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 15 Kamil Rytarowski 2012-02-13 20:17:49 CET
Created attachment 1552 [details]
wrong values shown
Comment 16 Chris Denice 2012-02-13 20:50:01 CET
Then, it does not :)
Your battery only holds 85% of the design capacity when fully charged.

Hence the --lfc option. Uses --lfc=1 if you still want to have 100% when the battery is fully charged.

chris.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 17 Kamil Rytarowski 2012-02-13 21:01:10 CET
Thanks! It's working now.
Comment 18 Kamil Rytarowski 2012-02-17 01:59:49 CET
Please push your patch upstream http://repo.or.cz/w/dockapps.git
This is a special repo for old and unmaintained dockapps.
Comment 19 Chris Denice 2012-02-17 10:02:37 CET
Thanks for the link, I'll upload the patch. I working on another one to make it support multicores too.

Cheers,
Chris.

Note You need to log in before you can comment on or make changes to this bug.