After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346542 - give warning when suspend fails
give warning when suspend fails
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
SVN TRUNK
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-07-04 13:30 UTC by William Jon McCann
Modified: 2007-02-01 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description William Jon McCann 2006-07-04 13:30:10 UTC
Scenario:
1. Close lid
2. Put laptop in bag
3. Suspend fails (for whatever reason)
4. Laptop melts

This is one reason why we should not honor inhibitors when closing the lid.  But beyond that we should sound some kind of warning to alert the user that the suspend failed.
Comment 1 Richard Hughes 2006-07-08 09:19:27 UTC
With CVS, we currently beep using the PC speaker, but some machines don't have a PC speaker so I'm at loss what to do. Any ideas?
Comment 2 William Jon McCann 2006-07-28 17:20:17 UTC
I had a suspend failure last night that I was able to reproduce.  There was an error like DBUS timed out... recovering.

We really need to scream like hell if a suspend fails for any reason.
Comment 3 Richard Hughes 2006-07-28 19:12:19 UTC
Did you get the beeping? What did g-p-m do?
Comment 4 William Jon McCann 2006-07-28 19:13:56 UTC
Nope.  Nothing as far as I could tell.
Comment 5 Richard Hughes 2006-07-28 19:58:45 UTC
Bugger. I've just noticed that pcspkr isn't loaded by default on fedora. Dealbreaker!
Comment 6 Richard Hughes 2006-08-07 18:27:38 UTC
Does this commit fix things for you?

2006-07-30  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c:
	Add manager_rescan_buttons() to poll all the buttons every minute.
	This should fix #346082

Richard.
Comment 7 William Jon McCann 2006-08-08 18:56:50 UTC
How does that have anything to do with sounding a warning?
Comment 8 William Jon McCann 2006-08-08 19:09:23 UTC
Also, I can't seem to find the code where we beep when suspend/hibernate fails.  Where is it?
Comment 9 Richard Hughes 2006-08-08 19:23:21 UTC
Well, it stops laptops overheating! :-)

And the beep: gpm-common.c (gpm_warning_beep)

Richard.
Comment 10 William Jon McCann 2006-08-08 19:25:13 UTC
gpm_warning_beep doesn't seem to be used when suspend/hibernate fails.
Comment 11 Richard Hughes 2006-08-15 19:53:05 UTC
Apologies.

2006-08-15  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c:
	Beep to warn if the suspend or hibernate failed. Should fix #346542

Richard.
Comment 12 William Jon McCann 2006-08-15 20:03:14 UTC
Cool.  Thanks.

I wonder if maybe it should beep (in this case) regardless of the gconf beep setting.  FC6 disables beeping by default - most likely because it is used for non-critical warnings.  Also it seems like it only beeps once, right?  It should probably keep beeping until the lid is opened again.  I think this is what windows does.
Comment 13 Richard Hughes 2006-08-19 18:27:25 UTC
Yes, sounds sane. I'll play more with this in the week, this weekend is a bit hectic.
Comment 14 William Jon McCann 2006-09-27 01:31:41 UTC
Happened to me again :(  Hal had crashed and I stuffed my laptop in a bag and it damn near melted.

I don't think we can rely on the PC speaker since Fedora and others are turning it off by default again.  GStreamer would work.  We could even put it out of process by installing a little gpm-sound-alert script or something.

This script could check a gconf key to see if gdk_beep or a .wav file should be used.

Here's an example from gaim:
http://svn.sourceforge.net/viewvc/gaim/trunk/gtk/gtksound.c?revision=17204&view=markup#l_389
Comment 15 Richard Hughes 2006-09-27 07:53:48 UTC
But the volume could just be turned down, and then we wouldn't head anything either. I run my laptop for 99% ofthe time with the volume muted.
Comment 16 Richard Hughes 2006-10-30 22:08:52 UTC
2006-10-30  Richard Hughes <richard@hughsie.com>

	* data/sounds/Makefile.am:
	* data/sounds/gpm-critical-power.wav:
	* data/sounds/gpm-suspend-failure.wav:
	* data/sounds/gpm-unplugged.wav:
	Add some sample sounds done by me.

2006-10-30  Richard Hughes <richard@hughsie.com>

	* configure.in:
	* data/Makefile.am:
	* data/sounds/.cvsignore:
	* data/sounds/Makefile.am:
	* src/gpm-common.c:
	* src/gpm-common.h:
	* src/gpm-manager.c:
	Add really basic support for gpm_event_sound() so we can make a sound
	when critical events happen.

Jon, can you test this and tell me what you think please.