[SOLVED] Disable sleep / hibernation button / pm-utils

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] Disable sleep / hibernation button / pm-utils

Postby waferhead » Nov 11th, '12, 09:37

Mga3a2 installed on my Itronix Gobook3 (IX260+)

Battery life noticably improved.

Sleep borks regardless
Hibernate works except for NOT doing a wlan reset.
Have yet to figure out what's trapping fn+F3 and triggering suspend, or how to inhibit suspend and replace it with calls to hibernate. (Sleep hotkey should be configurable somewhere, preferably in the PM screens)
wlan isn't getting automagically reset on resume from hibernate. (both the intel internal or the Cisco AM10)

Doesn't seem to be much useful documentation relating to that sort of thing, and it's entirely non-obvious (to me) how the scripts get triggered or relate to each other.

Finally have TunerStudio working on openjvm. :!:

Semtech touchscreen works with the same module (external module build from Duberga+ trivial mod) and udev/evdev/Xorg setup I posted about//got working with mga1 and 2

gpsd works well, roadmap didn't, something missing in the patches for the cauldron build, bug reported, works fine from svn (version 2694 IIRC) with same old mdv path patches. (I built an rpm of it works fine)

Still haven't tried 16550A serial port, has been very slow//loses data with recent kernels changes, even with patched kernel, but both my usb serial adapters seem to be working OK, if at ~half the data rate I USED to get from my 16550A meatspace serial port. (why I keep MDV2012.2 around)

I may finally be able to retire MDV2010.2 as everything I absolutely need... now works.
Last edited by waferhead on Dec 19th, '12, 11:22, edited 1 time in total.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: M3A2 - First Impressions

Postby doktor5000 » Nov 11th, '12, 11:51

waferhead wrote:Doesn't seem to be much useful documentation relating to that sort of thing, and it's entirely non-obvious (to me) how the scripts get triggered or relate to each other.

You might want to take a look at the package pm-utils, it contains the scripts that do the heavy lifting. Essentially it's
Code: Select all
/usr/bin/pm-hibernate
/usr/bin/pm-suspend
/usr/bin/pm-suspend-hybrid


And maybe you want to take a look here: https://wiki.archlinux.org/index.php/Pm-utils
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: M3A2 - First Impressions

Postby waferhead » Nov 11th, '12, 12:20

The "pm-suspend*' have been pointed to /usr/bin/pm-hibernate to no effect, Fn+F3 still puts it in limbo.
Seems to be some shennanigans going on at a lower level.

Thanks for the link!
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: M3A2 - First Impressions

Postby doktor5000 » Nov 11th, '12, 12:37

Which desktop environment are you using?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: M3A2 - First Impressions

Postby waferhead » Nov 12th, '12, 11:21

KDE4.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: M3A2 - First Impressions

Postby doktor5000 » Nov 12th, '12, 19:55

Crap, shouldn't have tried to reproduce it :)
For me it's Fn+F4, and it puts my laptop into standby.
Looking at the logs, this seems like an ACPI call going directly to the kernel:
Code: Select all
[...]
Nov 12 18:30:42 Mageia2 kernel: [84837.499778] ACPI: Preparing to enter system sleep state S3


Keycode, found out via xev, shows:
Code: Select all
KeyRelease event, serial 40, synthetic NO, window 0x4c00001,
    root 0x15d, subw 0x0, time 85463000, (-505,413), root:(596,436),
    state 0x10, keycode 150 (keysym 0x1008ff2f, XF86Sleep), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


From a short glance there are many ways to disable this:

http://askubuntu.com/questions/94754/ho ... ibernation
Check the third answer, just tried it, and works immediately after creating the file (although i named it /etc/polkit-1/localauthority/50-local.d/com.mageia.disable-suspend.pkla :D )
Found this via https://bugs.launchpad.net/ubuntu/+sour ... bug/788415

Some other related links:
http://linuxexpresso.wordpress.com/2010 ... te-ubuntu/
http://askubuntu.com/questions/115333/h ... y-keyboard
http://blog.superofsuper.com/2011/10/di ... -mint.html
https://answers.launchpad.net/ubuntu/+s ... ion/168574
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: M3A2 - First Impressions

Postby waferhead » Nov 13th, '12, 10:36

Thank you for your help!
Looks like I'm not quite alone im my frustration as to the documentation (or ~absolute lack thereof, particularly upstream) of the pm-utils, acpi and freinds, although some folks seem to have much better Google-fu than I.

I'll have to dig in and figure out how to reassign the button to hibernate as it was under Mandriva(forever), as hibernate works fine, as sleep used to a few years back. ( 2007.1 worked peachy out of the box, including fglrx, but we have all slept since then)

Sleep actually DOES work if I could ignore the video being all jacked up (everything is on the screen twice, resolution gets doubled vertically or something and the screen can't deal).

I should probably start another thread re:hibernate and sleep, as I doubt seriously I am the only one with issues.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: M3A2 - First Impressions

Postby waferhead » Nov 13th, '12, 12:32

hmmmph.

Created /etc/polkit-1/localauthority/50-local.d/com.mageia.disable-suspend.pkla with said contents, has zero effect, Fn+F3 still causes sleep, restly is unrecoverable.

Havent tried to trap it from X yet, have to crash.

I may punt and fight and "simply" try to get the video (and wlans) to reset properly.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby doktor5000 » Nov 13th, '12, 18:59

I've split it out into a new thread.


Please post
Code: Select all
lspcidrake -v | grep -iE 'net|vga'
output so that i can see wireless and graphics chipset,
also please provide laptop model or mainboard model if it's no laptop. Basically you need to take care that you apply needed kernel options for some
common ACPI/APIC glitches, maybe some xorg options for graphics driver, and you can define some hooks or commands
for special treatment of some components during shutdown/hibernation. See https://wiki.archlinux.org/index.php/Pm ... _own_hooks

For redefining that key on your box, maybe have a look at the links i've posted above, one explains one possible way to do this under GNOME.
For KDE i'm not quite sure as power settings allows to disable button event handling at all, but i don't think that will have an effect on that special button,
only for the lid and the power button itself.

'Bout the Google-Fu, some say it's a gift, some say it's curse - it depends :|
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby waferhead » Nov 13th, '12, 21:27

Thanks for splitting this off.

Code: Select all
lspcidrake -v | grep -iE 'net|vga'
8139too         : Realtek Semiconductor Co., Ltd.|RTL-8139/8139C/8139C+ [NETWORK_ETHERNET] (vendor:10ec device:8139 subv:103c subd:020b) (rev: 10)
ipw2200         : Intel Corporation|PRO/Wireless 2200BG [Calexico2] Network Connection [NETWORK_OTHER] (vendor:8086 device:4220 subv:8086 subd:2701) (rev: 05)
Card:ATI Radeon HD 4870 and earlier: ATI Technologies Inc|Radeon RV250 [Mobility FireGL 9000] [DISPLAY_VGA] (vendor:1002 device:4c66 subv:14ff subd:0311) (rev: 02)


Laptop is a HP Rugged notebook NR3610, a rebadged Itronix Gobook3 (IX260+) Pentium M 1.8G (Dothan), radeon RV280/9250 M dedicated graphics memory, 64M, 2G RAM on mainboard. i865 chipset, but missing the "centrino" label due to the dedicated ATI graphics. Runnng the HP BIOS as it is the most current and properly allows USB/network booting etc. Semtech resistive touchscreen.(ps/2) Think 3 kilo netbook with thick cast magnesium case.

These are still pretty popular as they are reasonably fast, cheap, and border on indestructable, think Panasonic Toughbook, only moreso. Will run win7 well, but no touchscreen support, works 100% with Linux (save for suspend, hibernate works fine, YMMV)

Tried wide variety of pm-suspend quirks, singly and in combination to no effect.
Some Sony Vaios of that era had ~same chipset, the specified quirks for the Vaios was --quirk-vbe-post --quirk-vbemode-restore

Still trying different things, fixing sleep would be ideal, but replacing it wih hibernate is also an option.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby doktor5000 » Nov 13th, '12, 22:40

waferhead wrote:Semtech resistive touchscreen.

Semtech? Shortly mistaken it for Semtex, which would be a pretty bad choice for a touchscreen :o

I'll have a look for your box.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby waferhead » Nov 13th, '12, 22:51

Found the source of some of my frustration...

Fn-F3 "sleep" still "works" same with pm-utils completely uninstalled (urpme pm-utils) , so i need to concentrate on ACPI/kernel side.
Makes sense as all of the pm-utils config scripts I tried had no effect: it was being bypassed.

Out of time to play for now, work calls.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby doktor5000 » Nov 13th, '12, 23:12

Probably easiest catch would be to install xev as pointed out further above,
and let it write into a log
Code: Select all
xev 2>&1 | tee xev.log
and press Fn-F3 there, then take the keysym from the log and map it to something else via xmodmap
as in https://wiki.archlinux.org/index.php/Extra_Keyboard_Keys_in_Xorg#Step_1:_Create_the_xmodmap_file
(although you want to un-map it or change it to something that does nothing) - could be worth a try.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby waferhead » Nov 14th, '12, 02:26

xev gave up keycode 150, XF86Sleep, but it did me no good, as in the end KDE doesn't seem to really use xprofiles as advertised.
None of the "complex" fixes seem to have any effect on Mga3, seems that the kernel mode parts are all that are active.

OTOH, found sucess in a strange place---exactly where one would logically expect it: :lol:
Right in KDE4s System settings>shortcuts and gestures>

Looks like this can be done a couple different ways...

used
preset actions>add custom>new action [named it hibernate]>global shortcut>command/URL [command=pm-hibernate]

For trigger, selected trigger and hit Fn+F3--- It trapped it, and I confirmed I wanted to reassign the key.

Works.
Strangely, it really does work properly, now...wlan resets ---
The only other change was I uninstalled acpid as it did ~nothing and has been deprecated upstream.

I have a gut feeling acpid may have been stepping on the toes of pm-utils, will try to confirm that.

I still want to get sleep working, but this is a good start.

Next step: Really inhibit suspend (menu item comes from somewhere)
Last edited by waferhead on Nov 14th, '12, 03:15, edited 1 time in total.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby waferhead » Nov 14th, '12, 02:44

Confirmation of acpid causing at least headaches, the "not working" pm-suspend inhibit script set up earlier in the excersise now works with acpid uninstalled. It is not a dependancy for pm-utils.

Annoyingly the suspend menu item still puts it into S3 sleep, but the command pm-suspend is inhibited when run in a shell
(no telling what the menu item is calling yet)

Taking another pass at the video quirks settings with apcid removed.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby waferhead » Dec 19th, '12, 05:13

Had to bail off the tradmill using cauldron, something in an update over last 2 days rendered the machine essentially unusable for it's purpose, may have been java related.

short: Fresh MGA2 install...suspend+hibernate works flawlessly, I can even get my touchscreen back after suspend/hibernate with some minor tweaks to the setup and running /etc/rc.local again on resume.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: Disable sleep / hibernation button / pm-utils troublesho

Postby waferhead » Dec 19th, '12, 11:22

Found/confirmed the ultimate root cause of my graphic corruption on suspend.
I loaded "radeon-firmware",the issue instantly came back.

Still clueless how it hibernated fine, but suspend was borked, and I may lose 3d capability, but it's a radeon 9250M, so no great loss.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest