Created attachment 2293 lshal for the system Hey, as said on -goodies ML, there's no choice for the “hibernate” button in the general tabs, while the hibernate button is correctly reported by hal. lshal is attached.
(In reply to comment #0) > Created an attachment (id=2293) [details] > lshal for the system > > Hey, > > as said on -goodies ML, there's no choice for the “hibernate” button in the > general tabs, while the hibernate button is correctly reported by hal. > > lshal is attached. I was expecting that, your hibernate button doesn't appear anywhere in hal device list, however it seems to send events, i don't know what to say here. you can see clearly in lshal output of your computer that all other buttons have udi with the specific type, but not for the hibernate button. I could probably see if a not mapped button is producing events then enable it, what do you think? Too much work-around for HAL.
(In reply to comment #1) > (In reply to comment #0) > > Created an attachment (id=2293) [details] [details] > > lshal for the system > > > > Hey, > > > > as said on -goodies ML, there's no choice for the “hibernate” button in the > > general tabs, while the hibernate button is correctly reported by hal. > > > > lshal is attached. > Yves, may i close this bug as i see no clean way of fixing this "HAL" bug. BTW: did you try the latest HAL release?
(In reply to comment #2) > Yves, may i close this bug as i see no clean way of fixing this "HAL" bug. My name is Yves-Alexis :) > > BTW: did you try the latest HAL release? Running 0.5.12~git20090406.46dc48-2 atm.
(In reply to comment #3) > (In reply to comment #2) > > Yves, may i close this bug as i see no clean way of fixing this "HAL" bug. > > My name is Yves-Alexis :) > > So Yves-Alexis :), can i close this ?
It seems that the hibernate button is called “suspend” while the suspend button is called “sleep”, which may confuses hal and/or xfpm. Is it supposed to be that way? (when pressing it, it correctly sends the hibernation signal)
(In reply to comment #5) > It seems that the hibernate button is called “suspend” while the suspend button > is called “sleep” Where they are called like that? > which may confuses hal and/or xfpm. Is it supposed to be > that way? (when pressing it, it correctly sends the hibernation signal) I believe not, in X there is only SLEEP, HIBERNATE, POWER_OFF, there is not suspend, same for hal, in the spec they say "sleep" button press is the suspend event. http://people.freedesktop.org/~david/hal-spec/hal-spec.html#device-properties-button
(In reply to comment #6) > (In reply to comment #5) > > It seems that the hibernate button is called “suspend” while the suspend button > > is called “sleep” > > Where they are called like that? In /usr/share/hal/fdi/information/10freedesktop/30-keymap-module-thinkpad-acpi.fdi > > > which may confuses hal and/or xfpm. Is it supposed to be > > that way? (when pressing it, it correctly sends the hibernation signal) > > I believe not, in X there is only SLEEP, HIBERNATE, POWER_OFF, there is not > suspend, same for hal, in the spec they say "sleep" button press is the suspend > event. > > http://people.freedesktop.org/~david/hal-spec/hal-spec.html#device-properties-button Though, when I check for the buttons, I get: corsac@hidalgo: lshal | grep button.type button.type = 'radio' (string) button.type = 'lid' (string) button.type = 'sleep' (string) button.type = 'power' (string) Cheers,
Hmmh, weird. I have a debian user reporting (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542238) that on its R61 he doesn't even have the sleep button working. I tried on a desktop box, and I can't set the action for “hibernate” (quite normal, I don't have any hibernate button on the desktop), but I *can* set an action for “suspend”. Which is weird, since I don't have any sleep button (and lshal doesn't report any button.type = sleep, only power. I still think there are some weirdnesses on this topic :/
(In reply to comment #8) > Hmmh, weird. I have a debian user reporting > (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542238) that on its R61 he > doesn't even have the sleep button working. I meat Maximilian few weeks ago to have a beer in Geneva, he showed me his laptop (i don't remember which model was) and neither sleep or hibernate buttons were working for him, they aren't detected by X neither by HAL, so i bet this is normal, could you ask the guy to post the content of lshal? > > I tried on a desktop box, and I can't set the action for “hibernate” (quite > normal, I don't have any hibernate button on the desktop), but I *can* set an > action for “suspend”. Which is weird, since I don't have any sleep button (and > lshal doesn't report any button.type = sleep, only power. Could be that X is reporting a sleep button?, i just tried on my desktop computer, and seems that X has a Sleep button, but what is weired in my case that X is reporting two addition buttons, brightness_up and down??? You could try to compile with debug-full option and run it, it will print the keycode for you (i started to dislike this idea, i should always have debug options even if xfpm is not compiled with debug-full). > > I still think there are some weirdnesses on this topic :/ Yes, that's weired, but i think part of the problem i that we have two sources, X and HAL.
(In reply to comment #9) > (In reply to comment #8) > > Hmmh, weird. I have a debian user reporting > > (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542238) that on its R61 he > > doesn't even have the sleep button working. > > I meat Maximilian few weeks ago to have a beer in Geneva, he showed me his > laptop (i don't remember which model was) and neither sleep or hibernate > buttons were working for him, they aren't detected by X neither by HAL, so i > bet this is normal, could you ask the guy to post the content of lshal? lshal is at http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=15;filename=lshal.out;att=1;bug=542238 But in fact it's not the same bug. He can see the “sleep” button action in the preferences (but not hibernate), but when he presses it, nothing happens (while right click on the icon and asking for suspend does work. I'll investigate on that with him. > > > > > I tried on a desktop box, and I can't set the action for “hibernate” (quite > > normal, I don't have any hibernate button on the desktop), but I *can* set an > > action for “suspend”. Which is weird, since I don't have any sleep button (and > > lshal doesn't report any button.type = sleep, only power. > > Could be that X is reporting a sleep button?, i just tried on my desktop > computer, and seems that X has a Sleep button, but what is weired in my case > that X is reporting two addition buttons, brightness_up and down??? Hmhm, how do you check that? > > You could try to compile with debug-full option and run it, it will print the > keycode for you (i started to dislike this idea, i should always have debug > options even if xfpm is not compiled with debug-full). Yeah, might be a good idea. Will try that and report back (here or on irc). > > > > > I still think there are some weirdnesses on this topic :/ > > Yes, that's weired, but i think part of the problem i that we have two sources, > X and HAL. Yup. Thanks for your time.
Ok, so the hibernate key absence is because of: (xfce4-power-manager:623): xfce4-power-manager-CRITICAL **: could not map keysym 1008ffa8 to keycode
HMh ok, so from kernel people, it seems that: KEY_SLEEP = Suspend to ram KEY_SUSPEND = Suspend to disk KEY_HIBERNATE = Suspend to disk And that my “sleep” button in hal comes from an input event I'm not sure about: /dev/input/event5 bustype : BUS_HOST vendor : 0x0 product : 0x3 version : 0 name : "Sleep Button" phys : "PNP0C0E/button/input0" bits ev : EV_SYN EV_KEY and I don't have the according “Hibernate Button”. So I needed to use the X way to do things, and for that to work I had to use attached patch.
Created attachment 2510 Correctly detect and handle hibernate
Ok and it seems that there's no such thing as “ACPI Hibernate Button” in the kernel. I can only see the “lid switch”, “power button” and “sleep button”. So I think there's no way for hal to report an “Hibernate button” (don't know about devicekit). So I don't think there's a way to detect if there's an hibernate button or not, you'll only have to listen to the events and do the required action. I don't know how gpm does, though.
(In reply to comment #14) > Ok and it seems that there's no such thing as “ACPI Hibernate Button” in the > kernel. I can only see the “lid switch”, “power button” and “sleep button”. > > So I think there's no way for hal to report an “Hibernate button” (don't know > about devicekit). DeviceKit power has no handling for these buttons, gpm now relies on X to detect them, DeviceKit power has only lid event. > > So I don't think there's a way to detect if there's an hibernate button or not, > you'll only have to listen to the events and do the required action. > I want to fix this by keeping compatibility with when we will move to have only X events, so i would say i can expose sleep suspend and hibernate buttons in the ui if they are detected by X. Sleep : Suspend Suspend : Hibernate Hibernate : Hibernate. But i dunno about if i got Suspend and Hibernate buttons mapped by X what should i do? probably have all of these in the UI. What do you think?
Answer to your mail >Dunno if i should ask the question here, now gpm relies completely on X > to map these buttons, in X there is: > HAVE_XF86XK_SLEEP (Suspend). > HAVE_XF86XK_HIBERNATE > HAVE_XF86XK_SUSPEND > As i understood These two buttons are suspend two disk, okay, so they > should have the same keycode right?, or can they be two different keys? Hmhm, looking at the logs xfpm generates on my thinkpad, no, they seem to be mapped to different keys. I guess it might be possible to show the Hibernate configuration item if either XF86XK_HIBERNATE or XF86XK_SUSPEND gets correctly grabbed. In my case, that would fix the problem since (afair) XF86XK_SUSPEND is grabbed correctly. (and it makes sense since nothing sends KEY_HIBERNATE from the kernel).
(In reply to comment #15) > (In reply to comment #14) > > Ok and it seems that there's no such thing as “ACPI Hibernate Button” in the > > kernel. I can only see the “lid switch”, “power button” and “sleep button”. > > > > So I think there's no way for hal to report an “Hibernate button” (don't know > > about devicekit). > > DeviceKit power has no handling for these buttons, gpm now relies on X to > detect them, DeviceKit power has only lid event. Ok, so I guess it's better to drop buttons support from hal too, and only use X? (that'd work only if the keycode are under 255 though, due to X problems) > > > > > So I don't think there's a way to detect if there's an hibernate button or not, > > you'll only have to listen to the events and do the required action. > > > > I want to fix this by keeping compatibility with when we will move to have only > X events, so i would say i can expose sleep suspend and hibernate buttons in > the ui if they are detected by X. I think we should go the X way directly. Why keeping hal stuff if it doesn't work anyway (for the buttons, not for the rest :) ). > > Sleep : Suspend > Suspend : Hibernate > Hibernate : Hibernate. > > But i dunno about if i got Suspend and Hibernate buttons mapped by X what > should i do? probably have all of these in the UI. > > What do you think? Like above, I guess a simple or will do. If both are mapped, fine, do Hibernate in both cases.
> Ok, so I guess it's better to drop buttons support from hal too, and only use > X? (that'd work only if the keycode are under 255 though, due to X problems) > > I think we should go the X way directly. Why keeping hal stuff if it doesn't > work anyway (for the buttons, not for the rest :) ). Hal is currently used in xfpm as a fallback for the power and sleep button only, will be removed completely soon. > Like above, I guess a simple or will do. If both are mapped, fine, do Hibernate > in both cases. So exposing Hibernate configuration in the UI for both keys, if that what you means then we only need your path to fix it ;).
> So exposing Hibernate configuration in the UI for both keys, if that what you > means then we only need your path to fix it ;). I mean your patch, BTW, it seems that you remove the check for keycode == 0? i think just the critical should be changed to warning, but the check should be kept.
(In reply to comment #19) > > So exposing Hibernate configuration in the UI for both keys, if that what you > > means then we only need your path to fix it ;). > > I mean your patch, BTW, it seems that you remove the check for keycode == 0? i > think just the critical should be changed to warning, but the check should be > kept. Yeah I removed the check because it fails on my box. But if the check if for HIBERNATE and SUSPEND, the SUSPEND will success and the config item will appear, so yeah it can be re-added :) Cheers,
> > Yeah I removed the check because it fails on my box. But if the check if for > HIBERNATE and SUSPEND, the SUSPEND will success and the config item will > appear, so yeah it can be re-added :) > > Cheers, Applied and committed, thanks :).
Cool, will try to test it tonight and report back :)
Works fine, thanks!
What we are now doing is completely wrong. According to XF86keysym.h #define XF86XK_Suspend 0x1008FFA7 /* Sleep to RAM */ #define XF86XK_Hibernate 0x1008FFA8 /* Sleep to disk */ On my system, the settings dialog shows Hibernate button configuration, however i don't have a hibernate button.
(In reply to comment #24) > What we are now doing is completely wrong. > > According to XF86keysym.h > > #define XF86XK_Suspend 0x1008FFA7 /* Sleep to RAM */ > #define XF86XK_Hibernate 0x1008FFA8 /* Sleep to disk */ Hmhm, I will report that to people on the ACPI list to see what they say. > > On my system, the settings dialog shows Hibernate button configuration, however > i don't have a hibernate button. Well, I'm not sure, I think it's because it manages to map the key even if there's none? In any case, I think it's better to have the button even if there's none than the opposite (not being able to configure it if present)
I think you are running newer version of xfpm now, so i'll close this.