LinuxMCE Forums

General => Feature requests & roadmap => Topic started by: delta_9 on September 30, 2007, 04:38:50 am

Title: hibernation would save a lot of time
Post by: delta_9 on September 30, 2007, 04:38:50 am
a hibernation button labeled fast shut down or something would be a massive time saver.
i have been reading about hibernation and ubuntu and it does look like it has problems finding the hibernation file on boot but like all things it is fixable see below

http://blog.paulbetts.org/index.php/2007/02/11/fixing-software-suspend-hibernate-with-uswsusp-in-ubuntu-feisty-and-edgy/

thanx
Title: Re: hibernation would save a lot of time
Post by: tschak909 on September 30, 2007, 07:01:40 pm
dude, why are you turning your Core/MD off?

-Thom
Title: Re: hibernation would save a lot of time
Post by: MarcoZan on October 09, 2007, 08:29:12 am
Hi Thom

a reason for switching off MD could be power saving. Say that nobody is at home from 8.00 AM to 6.00 PM, wouldn't be a real power waste to keep all your MD on ?

Regards

Marco
Title: Re: hibernation would save a lot of time
Post by: tschak909 on October 09, 2007, 06:15:03 pm
not really, no.

-Thom
Title: Re: hibernation would save a lot of time
Post by: teedge77 on October 09, 2007, 06:41:53 pm
it could be.

-TJ
Title: Re: hibernation would save a lot of time
Post by: MarcoZan on October 09, 2007, 09:25:37 pm
Hi Thom

just to clarify my idea:

keeping a MD on all the time is something that has to do with the importance you give to the services that are hooked to it and the price you agree to pay for it.

By an "energy balance" point of view LMCE is pretty power consuming. You are supposed to have a full blown server running 24x7 and a small energy fingerprint pc for each MD that you want in your environment.

This makes a discrete amount of bucks in energy cost at the end of the year.

In my country electric power is not that cheap and government is promoting a lot of incentives for "low energy home", and as far as I'm concerned I wouldn't mind if I can reduce all power consumption that in my opinion is not strictly required.

In another post there was a discussion about lowering CPU freq of Core/hybrid, in order to decrease power consumption in off-peak hours. I think that also the hybernation topic was already mentioned before. This means that energy saving is somehow an issues that more than one user start to consider, especially now that we have a reasonably stable environment and users are more keen to think about "fine tuning".

In my environment (that may probably differs from yours) the only reason that would suggest me to keep MD on is the "follow me feature". All the rest (lighting control, basically) is hooked to Core. I use MD only as media player and nothing more.

So in principle I need MD switched on only during the time frame when I'm at home.

Actually something that I would like (and as soon as I solve other bigger issue I surely try to get) is something that turns on MD at a given time, and that turns MD off when leaving home.

As I told in the beginning, this is my point of view.

Maybe this is a limited perspective, so if you have different idea share it with us.

Regards
Marco
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on October 11, 2007, 07:40:50 pm
not really, no.

-Thom


Jesus, why would you say something like that?

My core runs at about 100w. My MDs are about the same, give or take a bit (say take off 10w for the HD).

In the UK it costs roughly £160 ($320 US) to keep a 100W device on all year. If I had all my MDs on all the time that would be £640 per year. Which is a pretty decent holiday. So no surprise I turn them off. And yes, I get really annoyed by the agonisingly slow boot times, so I am also interested in suspend. Perhaps to a local disk, or to RAM? (is suspend to NFS currently available?).

Oh, BTW, in case you hadn't realised, if everyone had devices sat around consuming this amount of power 24/7 most parts of the world would look very different in only a few years time.

In a world where there is even a market for devices which turn off mobile phone chargers when not in use to save a watt or so of power (yes, I was surprised anyone woudl bother with this!) how can you think that producing a green product is not important?

Title: Re: hibernation would save a lot of time
Post by: gazlang on October 15, 2007, 02:25:22 pm
In a world where there is even a market for devices which turn off mobile phone chargers when not in use to save a watt or so of power (yes, I was surprised anyone woudl bother with this!) how can you think that producing a green product is not important?

I agree! Its not all about the cost of keeping appliances on needlessly - I pay a fixed rate bill for my electric no matter how much I use - but I would not leave my core on 24/7 simply because I don't want to make a huge carbon footprint.

Hybernation mode would be an ideal balance of reducing long boot-times while still being green
Title: Re: hibernation would save a lot of time
Post by: tkmedia on October 15, 2007, 10:50:51 pm
I would also like to save power and $ while maintaining functionality. As a compromise I have been looking at powertop  http://www.linuxpowertop.org/ (http://www.linuxpowertop.org/) which should work when 7.10 is released this will help us determine what we can shutdown and hopefully get the best power savings for the way each of us use LinuxMce Would be nice if LinuxMce would use the info provided by powertop combined with the hw db and wake the various systems as needed and then return them back to idle when not in use.

Just my .02

Tim
Title: Re: hibernation would save a lot of time
Post by: delta_9 on October 18, 2007, 04:13:43 pm
um sorry i did not come back sooner to check my post
 yeah i wanted to save power and i really do not see the point of running some thing when you do not use it. Like would you or I run my/our car all the time for the 2 or 3 times a day we use it ? nah same with my PC's. Hibernation feature would make it more like normal entertainment systems tv or dvd. i want to use it. i turn it on. 10 seconds later im using that device and it is not chugging down power needlessly while i don't want to use it. less money to pay and the environment will thank us all for powering down.

the planet is taking a good beating with this virus we named human beings we are like a scourge on the earth  with us thinking of more and more ways th choke out the one thing we all came from. im not religious at all but earth = god in every sense of the word.save mother earth one power down at a time lol   
Title: Re: hibernation would save a lot of time
Post by: desmarch on November 30, 2007, 12:22:03 am
This hibernation feature seems essential to me. No reason to waste money and energy if we can do without.
Title: Re: hibernation would save a lot of time
Post by: dragon_788 on December 15, 2007, 09:23:19 am
Have you guys looked at the Fiire PCs advertised as MD? They consume <15w a piece (iirc) when powered on, I agree the load times can be long when booting, but honestly, your TV probably pulls as much power as one of them when its "OFF".
Title: Re: hibernation would save a lot of time
Post by: pnauta on December 15, 2007, 09:57:46 am
Kudos for guys like gaslang, because I started this project to save energy, not spend it.  That's why I equipped my machine with a AMD 2350 processor, it should run at only 60W.  My TV uses only 90W (my old one consumed 130W) and 1W in standby mode.  Other things one could do: use solar panels to power the pc (http://www.tomshardware.com/2007/09/06/technical_foundations_diy_solar_powered_pc/) power down disks, use USB boot disk, underclocking, putting the pc in your living room so the heat is used by people, use onboard video, and numerous others.  That solar power pc project described shows that this LinuxMCE can be a carbon neutral machine (disregarding manufacture) to exploit.  One thing that will improve here: my daugther would leave my old XP 2400+ machine on to just charge her IPod Shuttle :-(

The only thing I'm concerned about: that machine will run DHCP for all machines in the house.  This means that it has to be on, at least when the DHCP lease expires.  I'm not sure that a DHCP broadcast would ever be able to wake a machine up.  Any ideas?  My router has DHCP, but obviously won't help, as we need to offer BOOTP to geet the MD's to boot.  But if I can fix that some other way (only use orbiters on these Windows based machines, use other players to just use shared media on the core) I will probably choose for that.
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 15, 2007, 03:07:48 pm
I think there are two realistic targets we need to move towards:

1. Pressing the power button on an MD either puts it into suspend-to-RAM mode, or suspend-to-disk mode if it is possible with a diskless setup. The solution should allow the PC to be brought back to life by pressing the power button in less than 30 secs. I suspect that suspend-to-RAM is the best bet here.

2. Having a low power mode for the core, whereby it only runs its housekeeping and media scanning tasks every few hours to allow disks to spin down (check out laptop-mode in Ubuntu). Better still, it could only run these tasks when it detects (using the laptop-mode status tool) that the disks are already spun up. If the disk is not spun up then there is no need to check for changes as nothing can have been written recently. To avoid problems a full scan could be done every few hours. Another mode could be that media scanning is only done via a button somewhere in the GUI.


I think that it is not realistic to expect that the core could hibernate. There is no way to have it wake on a DHCP request. You would also not be able to receive phone calls!

Chris
Title: Re: hibernation would save a lot of time
Post by: nite_man on December 17, 2007, 03:42:27 pm
I'm also interested to suspend and wakeup my core/MD. Any chance to have that feature in the coming 0710?
Title: Re: hibernation would save a lot of time
Post by: Matthew on December 17, 2007, 07:32:57 pm
Have you guys looked at the Fiire PCs advertised as MD? They consume <15w a piece (iirc) when powered on, I agree the load times can be long when booting, but honestly, your TV probably pulls as much power as one of them when its "OFF".

Every little bit counts, especially when they're drawing power 24/7/365. One compelling app for LMCE's home automation is actually shutting down power to all appliances, including their "always on" AC/DC adapters.
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 17, 2007, 11:22:05 pm
I have tried to use ACPI S3 sleep but don't think it's going to work with a diskless system. The reason being that it seems you need to unload network driver modules to get sleep to work properly. Obviously this can't be done as if you lose network connectivity your MD is totally dead!

Chris
Title: Re: hibernation would save a lot of time
Post by: Matthew on December 18, 2007, 12:19:52 am
I have tried to use ACPI S3 sleep but don't think it's going to work with a diskless system. The reason being that it seems you need to unload network driver modules to get sleep to work properly. Obviously this can't be done as if you lose network connectivity your MD is totally dead!

Some ethernet chips and motherboards support "Wake on LAN" even while in ACPI S3 (http://www.google.com/search?q=%22ACPI+s3%22+%22wake+on+lan%22).
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 19, 2007, 12:57:22 am
If you unload the net module, then after wake-on-lan how is the machine going to reload it when the root partition is not available?

Chris
Title: Re: hibernation would save a lot of time
Post by: colinjones on December 19, 2007, 06:03:46 am
ACPI S3 is when almost everything is powered down (including CPU) except RAM and its refresh. Core memory is retained, and the OS is still loaded along with any other applications, processes and data. So waking from this is easy even if the network modules are unloaded. The system is still there and ready to run, so as soon as it returns from S3, it just needs to reload the network driver modules and you're away again. You don't have to have the network available to reload these modules, because the system is still running.
Title: Re: hibernation would save a lot of time
Post by: sambuca on December 20, 2007, 11:10:53 am
Hi all

I have been following this thread closely, as I like the idea of suspending the MD. (Personally, I will probably leave the core on all the time, and thus my focus is the MD)

My motivation is twofold:
1) the power saving as others have mentioned,
2) reducing start up time for the MDs (time from no power to lmce started)
Currently my MD network boots in about 2 minutes, perhaps not much, but if I am to convince my wife to use LMCE to play DVDs, it has to start more like a DVD player (in a matter of seconds, not minutes).

So, partly motivated by this thread, I started out, trying to suspend my MD. Currently I can suspend it to RAM (also called S3), and restart it by wake-on-lan or by pressing the power button. (it restarts in  about 3-4 seconds  :D )

Here's how:
On the MD;
Make sure uswsusp is installed (I installed both hibernate and uswsusp)
See http://en.opensuse.org/S2ram (http://en.opensuse.org/S2ram) for more information how to set this up.
If you are using a nVidia card read this; http://en.opensuse.org/NVidia_Suspend_HOWTO (http://en.opensuse.org/NVidia_Suspend_HOWTO) on how to suspend with nvidia. In short, add Option "NvAGP" "1" to the device section of xorg.conf and make sure no *vendor* agp modules are loaded (but agpgart is OK).
Then I run:
    ethtool -s eth0 wol ug
    s2ram -f
and my MD suspends to RAM. The above is what my MD needed, you might not have to use the -f (force) flag on s2ram if your hardware is recognized as supported by s2ram. I needed to enable wake-on-lan with the ethtool command, as it would not wake on lan if not. (probably LMCE sets this up when shutting down).

As always, the whole suspend thing is very dependent on the hardware you have, so you may not be this lucky. Also make sure your BIOS power setting are correctly set up for suspend to ram.
(My hardware is a MSI mainboard with SIS961 chipset, a Realtek 8169 network card and a nvidia Geforce4 MX 440)

My next idea is to try to have the MD suspend to a flash disk ,to keep the MD as silent as possible and reduce the power use even more. But I have to buy a flash disk and CF to IDE adapter first.

What I would like now is to have the suspend options available from within LMCE. The power menu would be a good place to put something like this. But I also like the idea of having the power button on the remote suspend it. After pressing the power button, the user should get a confirmation question and an option to choose which suspend (ram/disk) he/she would like. Unfortunately, I have not got the slightest idea of how to add such a menu option. I hope someone else takes the challenge  ;)

Anyone have any data on the power usage in full-power vs. suspend to ram vs. suspend to disk vs. power-off ?

sambuca
Title: Re: hibernation would save a lot of time
Post by: Matthew on December 20, 2007, 04:33:17 pm
I have been following this thread closely, as I like the idea of suspending the MD. (Personally, I will probably leave the core on all the time, and thus my focus is the MD)
(...)
So, partly motivated by this thread, I started out, trying to suspend my MD. Currently I can suspend it to RAM (also called S3), and restart it by wake-on-lan or by pressing the power button. (it restarts in  about 3-4 seconds  :D )

Here's how:

That's excellent work. Would you update the wiki with the instructions? If you could include a test for each major step in the process, that would be a great HowTo.


My next idea is to try to have the MD suspend to a flash disk ,to keep the MD as silent as possible and reduce the power use even more. But I have to buy a flash disk and CF to IDE adapter first.

Can't you suspend to a USB Flash drive? FWIW, I'd love to see a Flash drive with bootable LMCE installed , so any PC can be booted as an LMCE MD, even across the Internet. Please keep us posted.


What I would like now is to have the suspend options available from within LMCE.

Would you create a feature request in Mantis, pointing at the work you've done getting "under the hood" working? That's the best way to get the LMCE dev team working on it. They'll probably have some time after they get out v0710 (soon enough). And at that time the dev team will probably be open more to the public, so discussions and work like this can come with more access to the project content.
Title: Re: hibernation would save a lot of time
Post by: sambuca on December 20, 2007, 07:05:38 pm
That's excellent work. Would you update the wiki with the instructions? If you could include a test for each major step in the process, that would be a great HowTo.
I added a page http://wiki.linuxmce.org/index.php/Suspend (http://wiki.linuxmce.org/index.php/Suspend) with the how to. I adjusted it a bit to make it more elegant. Now you just have to type hibernate-ram, and wol is automatically set up.

Can't you suspend to a USB Flash drive? FWIW, I'd love to see a Flash drive with bootable LMCE installed , so any PC can be booted as an LMCE MD, even across the Internet. Please keep us posted.
I suppose you could have bootable USB flash version of the LMCE kernel, that loads a suspended image also from the flash disk, but you might run into trouble with IP addresses if you resume the image from a different network or location. I'm not sure though, so it might work.

Would you create a feature request in Mantis, pointing at the work you've done getting "under the hood" working?
I will do that.

Since my last post, I did some research on suspend to disk, using a SATA hard drive installed in the MD. I did not manage to get it to resume after suspending, but I think I know why. The SATA disk requires a driver which is loaded as a module, and at the point where the kernel tries to load the resume image, it hasn't loaded that driver yet. A solution might be to install a IDE disk just for testing, or to rebuild the kernel.

I also found out that there are a few different programs which manages the suspend/resume process, and it seems that the standard LMCE kernel uses the swsusp program. I guess this means that the suspend to disk program used needs to match the one in the kernel.

I'll keep trying..
sambuca
Title: Re: hibernation would save a lot of time
Post by: Matthew on December 20, 2007, 08:20:11 pm
Can't you suspend to a USB Flash drive? FWIW, I'd love to see a Flash drive with bootable LMCE installed , so any PC can be booted as an LMCE MD, even across the Internet. Please keep us posted.
I suppose you could have bootable USB flash version of the LMCE kernel, that loads a suspended image also from the flash disk, but you might run into trouble with IP addresses if you resume the image from a different network or location. I'm not sure though, so it might work.

It's probably about as easy to switch the BIOS to netboot the MD from the core, instead of booting from USB (especially if the USB isn't already higher priority for booting in the BIOS). But I'd like to carry a USB that I could use to boot a local MD for use with my LMCE even across the Internet (bandwidth allowing). Which doesn't really require booting a suspended image, but rather just any bootable image would be OK. OTOH, resuming from suspend on USB would be really fast. A bootloader could quickly update the resumed image by rerunning dhclient and ntp, I believe.

I'll keep trying..

Thanks. Best of luck, and keep us posted.
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 21, 2007, 01:59:10 am
ACPI S3 is when almost everything is powered down (including CPU) except RAM and its refresh. Core memory is retained, and the OS is still loaded along with any other applications, processes and data. So waking from this is easy even if the network modules are unloaded. The system is still there and ready to run, so as soon as it returns from S3, it just needs to reload the network driver modules and you're away again. You don't have to have the network available to reload these modules, because the system is still running.

I'd let you have that.. if you could explain how the network module is going to be loaded without the root partition mounted. The network module is not in memory - you have removed it - so it needs to be loaded from the root partition, which is on the core. In a diskless boot no files are held locally unless they are loaded in memory. Once you remove the network connection from an MD it is totally useless - try it!


Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 21, 2007, 02:16:42 am
After following the wiki instructions I can now suspend my MD without removing the network driver!

Amazing! Thanks!


Title: Re: hibernation would save a lot of time
Post by: colinjones on December 21, 2007, 06:05:07 am
chrisbirkinshaw - actually, I meant to reload it from memory, not from the file system. Wasn't claiming to know how to actually do that! Just pointing out that RAM would still be intact, so if you left the module in memory somehow, you wouldn't need the network/filesystem. Seems you have got it to work now anyway - sounds like it didn't need actually to be unloaded in the first place, so obviously that's an even better solution :)
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 21, 2007, 12:02:46 pm
Yeah, having a suspend to USB as suggested would solve this problem and reduce power use further. btw anyone know what the saving would be compared to suspend to ram?
Title: Re: hibernation would save a lot of time
Post by: sambuca on December 21, 2007, 12:39:43 pm
Yeah, having a suspend to USB as suggested would solve this problem and reduce power use further. btw anyone know what the saving would be compared to suspend to ram?


Happy to see you got suspend working.

When suspending to disk/USB, the system would go into the S4 power state as defined in the ACPI standard, which resembles the normal power-off mode, where only a small amount of power is used to allow various devices to power on the computer (keyboard, network, soft-power button etc..) So the difference between suspend to ram (S3) and to disk would be the power drawn by the memory refresh of S3.

This page has some information about power usage http://michaelbluejay.com/electricity/computers.html (http://michaelbluejay.com/electricity/computers.html) of Dell PCs. Sleep (S3) uses 1-6W and poweroff (or S4) uses from 0.7 to 2.5W.

The ACPI standard and power modes are described here: http://en.wikipedia.org/wiki/ACPI (http://en.wikipedia.org/wiki/ACPI)

sambuca
Title: Re: hibernation would save a lot of time
Post by: Matthew on December 21, 2007, 04:29:10 pm
Yeah, having a suspend to USB as suggested would solve this problem and reduce power use further. btw anyone know what the saving would be compared to suspend to ram?


Happy to see you got suspend working.

When suspending to disk/USB, the system would go into the S4 power state as defined in the ACPI standard, which resembles the normal power-off mode, where only a small amount of power is used to allow various devices to power on the computer (keyboard, network, soft-power button etc..) So the difference between suspend to ram (S3) and to disk would be the power drawn by the memory refresh of S3.

This page has some information about power usage http://michaelbluejay.com/electricity/computers.html (http://michaelbluejay.com/electricity/computers.html) of Dell PCs. Sleep (S3) uses 1-6W and poweroff (or S4) uses from 0.7 to 2.5W.

The ACPI standard and power modes are described here: http://en.wikipedia.org/wiki/ACPI (http://en.wikipedia.org/wiki/ACPI)

sambuca

If MDs can suspend to S4, and consume only &lte;1W, they can comply with the IEA's One Watt Initiative (http://en.wikipedia.org/wiki/One_Watt_Initiative). That global energy conservation programme targets the ~10% of all energy household consumed that's in standby, maybe ~1% of all CO2 generated by humans (about 1/3 of what all air travel generates). In Germany alone, standby is 20TWh:y (4% of total), 14Mt:y CO2. I don't exepct that LMCE MDs will become popular enough to eliminate as much CO2 pollution as removing 18M cars from the OECD countries would, but a man can dream :). Realistically, all that power costs money, every little bit helps, and competing with non-LMCE MDs will make LMCE look great. Especially if it can qualify for the branding of this global "One Watt" performance.

Going even further, what about suspending to USB/Flash, then using home automation to cut power completely? LMCE scenarios should be able to sync the operations, then turn power back on right before sending a Wake on LAN packet, then resuming from Flash. Even appliances like projector TVs that need to "warm up" can be prepowered to accommodate, but not left on all the time. With followme presence detection, that kind of combo (including for appliances not even needing suspend/resume) could make tremendous cuts in energy consumption, with no effort by the users, and usually not even noticing it's going on "behind the scenes".

Since LMCE will make all these appliances more fun, LMCE will be a reason to use them a lot more. So if LMCE can include systems that actually make that increased usage also reduce power consumption from before they were "smart", it would make my conscience (and my environment) a lot clearer.
Title: Re: hibernation would save a lot of time
Post by: dragon_788 on December 21, 2007, 07:01:17 pm
OK, now you guys have me sold, going from 100W+ to 15-20W would be great, but I can't argue that going down to 1W or zero power use would totally rock, especially if LinuxMCE could coordinate the entire house to dynamically power completely off and back on using Follow me. I think the downside would be that would introduce a significant delay when walking into a room with a slightly older projector or TV that needs to warm up, but the power savings would probably be worth it. The other big issue then would be making sure the MD could boot completely in the time it takes the TV to warm up, because the present slow boot is horrendous.
Title: Re: hibernation would save a lot of time
Post by: joesd72 on December 22, 2007, 07:59:43 am
I'm not big on the whole earth worship thing, but I guess lower electric bills would be nice. I skimmed most of the post and was wondering if someone looked into suspend to disk and use a SSD (solid state disk) drives or for a little less $$ you could use a Compaq flash with a CP flash -to- SATA adapter for the HD. It would achieve a huge disk performance and less power consumption without having to have a fast enough USB drive hanging out of your MD. I don't think the HD on a MD need to be that large at all. and it can be used as a primary drive on the core, put the media on a traditional drive or on a NAS that will allow the drives to spin down when not active.

I know other places people are already slipping theses solutions into Laptops to make the batt last longer and the system perform faster. Switching to one of these alone might be a step in the direction you want before even adding the suspend/hibernate option. 
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 22, 2007, 01:53:15 pm
I'm not big on the whole earth worship thing, but I guess lower electric bills would be nice.

If you hadn't got that in there people might have (oh no!!) assumed you thought that saving the Earth's resources and stopping the destruction of millions of species of animals was a worthwhile cause. Imagine that! Phew!

Title: Re: hibernation would save a lot of time
Post by: joesd72 on December 22, 2007, 03:43:22 pm
I'm not big on the whole earth worship thing, but I guess lower electric bills would be nice.

If you hadn't got that in there people might have (oh no!!) assumed you thought that saving the Earth's resources and stopping the destruction of millions of species of animals was a worthwhile cause. Imagine that! Phew!

My bad. I’ll try again.

SSD or a CF flash with a SATA adaptor will be a big step in LMCE and any area of PC development to make them more power conscious and perform better.

That’s the suggestion; let’s discuss that regardless of personal beliefs, faiths, movements were sympathetic to, sexual preferences, political affiliations, or any other divisive factors.

If you can’t handle a tongue and cheek comment from someone who doesn’t accept that mankind are a virus out to destroy the planet; maybe there needs to be a disclaimer that states only conformist allowed.
Title: Re: hibernation would save a lot of time
Post by: sambuca on December 22, 2007, 04:11:53 pm
After playing with suspend to RAM a while, I found two things that needs some tweaking. Anyone else seen any problems ?

First, sometimes when I suspend the MD, it wakes up after only a few seconds. It seemed the network card was waking it up. So I changed the type of communication that would wake it up from "ug" to just "g": ethtool -s eth0 wol g
Now it just wakes up when receiving a magic packet.

The other thing is that the lirc_serial needs reloading after resuming. I added a section about this in the wiki. Not sure if all lirc modules need reloading, but at least the lirc_serial module needs it.

I dont know if the lirc stop and start stuff are the correct LMCE way of doing things wrt. configuration etc. Please let me know if I should do simething different.

I also did some more research on suspend to disk. It might be possible to re-try resuming from a suspended image at a later time in the boot process, when the requried disk drivers has been loaded. However, this means we need to do changes to the initramfs. I havent got that far yet, but I guess I will try it at some point. ("If it ain't broken, fix it till it is"  ;) ) I havent found any good guides on how to do this either..
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on December 22, 2007, 04:17:06 pm
Ok, cool.

Do we still think it's worth going for suspend though, when the saving is in the region of about 1 watt and the resume time will be much longer? (shift 1G RAM in and out of HDD)

BTW I had to create a script which killed and restarted the X server after wake from sleep:

Code: [Select]
#!/bin/sh
/usr/sbin/hibernate-ram
/usr/pluto/bin/Stop_X.sh
/usr/pluto/bin/Start_X.sh


The problem I was seeing was that the orbiter seemed to be working, and typing "screen -r" showed all the usual suspects were running, but I could not get video or tv to start. I could still control lights though. I tried doing a quick reload router, and refresh and regen this orbiter, but the messages never reached the core (not sure if they should actually) and nothing happend. Also quitting out to the launch manager and clicking "Start Orbiter" had no effect. In the orbiter log it registered that it had started ok however!

Title: Re: hibernation would save a lot of time
Post by: Matthew on December 22, 2007, 04:55:19 pm
If you can’t handle a tongue and cheek comment from someone who doesn’t accept that mankind are a virus out to destroy the planet; maybe there needs to be a disclaimer that states only conformist allowed.

That's "tongue in cheek". Proper idioms are politically correct, English nonconformist! ;)

Personally, I think that the prospect of lowering energy consumption by several percent in any scope of operation is good for everyone. Even those superstitious people who believe that electronic devices last forever.
Title: Re: hibernation would save a lot of time
Post by: sambuca on December 23, 2007, 11:57:00 pm
BTW I had to create a script which killed and restarted the X server after wake from sleep:

Code: [Select]
#!/bin/sh
/usr/sbin/hibernate-ram
/usr/pluto/bin/Stop_X.sh
/usr/pluto/bin/Start_X.sh
Hmm, I have not seen this behaviour on my system. How do you suspend? I switch to a console session before suspending, perhaps you suspend from within your X session? Not sure if this should matter, because I think the suspend script switches to a console session before suspending anyway.

Either way, you could create a script like the lirc module loading/unloading to stop and start your X server. This way, it will be taken care of automatically when hibernating. I suppose a LMCE implementation (from a  menu) would just call hibernate-ram or hibernate-disk, based on user choice. So making a script like this will make this transparent from a LMCE integration's point of view.

I also got hibernation (suspend to disk) to work. I'll do a write-up on this after Christmas, I guess the next days will be a bit busy..

Merry Christmas to all!  :)
Title: Re: hibernation would save a lot of time
Post by: sambuca on January 08, 2008, 09:02:58 pm
Hi all,

As promised before Christmas, I would post information about suspend to disk. I currently have a SATA HDD in my MD from before I started using LMCE, so I am using that as a swap partition (for suspend to disk). I plan on buying a CF card and CF/IDE adapter and test this, but I don't see any reason why this should not work as well. As far as I know, this will just be detected in the kernel as a normal IDE disk (or SATA, if you have a CF/SATA adapter).

Please note that I have been trying a few things before I ended up with this solution, so please tell me if something is not working, and I will try to figure out what I missed in the howto.

The information has been added to the wiki http://wiki.linuxmce.org/index.php/Suspend (http://wiki.linuxmce.org/index.php/Suspend).

After using suspend for a while, I discovered some problems with playing music after resuming (did not try video or TV). It might be the same problem as you had, chrisbirkinshaw. I also restarted the X server, and all seemed to work again. Not sure why. Anyway, I suppose we need to inform the core about the MD suspending, so it knows that it needs to wake it if it needs to access the MD. Maybe the problem with audio/video is related to the fact that this happens without the core really knowing, and that it somehow messes things up in the Orbiter or Application server.
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on January 22, 2008, 09:12:22 pm
Well, I'm still actually having problems!

When the MD wakes from sleep the app server is not running. I can't find any clean way to restart it either.

Any ideas?

Cheers,

Chris

Title: Re: hibernation would save a lot of time
Post by: sambuca on January 24, 2008, 09:35:24 am
Chris,

This may well be the same problem I am having, but it appears it sometimes does work when resuming. I have not idea about when it works and when it don't. I was thinking that it may be dependent on the amount of time the MD has been suspended, but this is just a wild idea, I have no knowledge to support it.

Is this consistent with what you see? Or is the AppServer always dead when resuming, no matter how long it was suspended? Or perhaps it is completely random?

I might have time to look into it during the weekend. I will of course post if I discover anything.

sambuca
Title: Re: hibernation would save a lot of time
Post by: Matthew on January 24, 2008, 05:21:18 pm
What would it take to package MD hibernation/wakeup into the MD device itself, so it could be controlled from the Floorplan? And then controlling floorplan devices with presence info.
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on January 26, 2008, 01:29:58 am
Sambuca,

It appears to work fine if I just sleep it for a few minutes when testing. but it's not girlfriend-proof (!). When she turns it on the next day it doesn't work...

So has anyone got wakeup to work reliably? It looks like we may not have cracked this after all. Is waking from suspend to disk any different?

Chris

btw I have another machine which hangs at the unloading modules stage of sleep preparation. Is there a way to debug and find out which module if failing to unload?
Title: Re: hibernation would save a lot of time
Post by: sambuca on January 26, 2008, 12:04:58 pm
Chris,

This seems to be the same behaviour I experience. For me, suspend to disk works the same as suspend to RAM.

So this strengthens my suspicion that the AppServer somehow gets "out of tune" with the core during long periods of sleep. I'll see what I can find out, but I suspect we need to have someone with a better understanding of the AppServer/DCE router stuff to look into it.

Regarding debugging the suspending, I haven't done it myself, but I suggest you read the s2ram article linked from the wiki suspend article. From what I understand, it is often a buggy driver that causes suspend/resume to fail.

Matthew,
I suppose that by "the MD device itself" you mean the LinuxMCE/Orbiter part? (The required software packages are already available in Ubuntu, so its just a matter of installing and configuring them).

As far as integrating it into the floorplan and suspending the MD via the Orbiter (and other similar uses), I suppose one would need to have a DCE command to tell the AppServer to suspend the MD, and to add a suspend button to the Orbiter power menu, and also add a way to suspend a device from the floorplan (I see there is already a power button on the floorplan, what does this do?).

I have no knowledge about the AppServer/Orbiter, so I wouldn't know where to start such an integration, but I am a C++ programmer (rather, I did some C++ a couple of years ago) and I would probably be able to do it, given the right amount of time  ;)

Sambuca
Title: Re: hibernation would save a lot of time
Post by: Matthew on January 26, 2008, 02:08:16 pm
I suppose that by "the MD device itself" you mean the LinuxMCE/Orbiter part? (The required software packages are already available in Ubuntu, so its just a matter of installing and configuring them).

I mean the host PC, as controlled by the LMCE (with maybe a GUI to it in its Orbiter). I'd expect the event to work more like Home Automation, sent by a scenario from the Core under control of an Orbiter or a schedule, or maybe by a presence server detecting where people are in the Floorplan and activating MDs/lights/etc like in Get Smart.


As far as integrating it into the floorplan and suspending the MD via the Orbiter (and other similar uses), I suppose one would need to have a DCE command to tell the AppServer to suspend the MD, and to add a suspend button to the Orbiter power menu, and also add a way to suspend a device from the floorplan (I see there is already a power button on the floorplan, what does this do?).

I have no knowledge about the AppServer/Orbiter, so I wouldn't know where to start such an integration, but I am a C++ programmer (rather, I did some C++ a couple of years ago) and I would probably be able to do it, given the right amount of time  ;)

One item in my task list is to help add events to device status in the Floorplan. When I get to that, I'll look at adding a hibernate/restore command to the MD device. I'll tap you if you can help with the C++. I'm a C++ programmer myself, but there's plenty of the coding to go around.
Title: Re: hibernation would save a lot of time
Post by: diamondcobra on January 26, 2008, 09:08:36 pm
I am all for less cost / less consumption, but my intention with lmce was for a all-in-one solution to manage not only media but my home automation and voip as well.  Since I need those to be always on, is my only option to have my core on all the time and not benefit from this hibernation effort?
Title: Re: hibernation would save a lot of time
Post by: Matthew on January 27, 2008, 02:14:45 am
I am all for less cost / less consumption, but my intention with lmce was for a all-in-one solution to manage not only media but my home automation and voip as well.  Since I need those to be always on, is my only option to have my core on all the time and not benefit from this hibernation effort?

Home automation and VoIP are run out of the Core, which probably has to be always on (though there are other lower-power levels that could probably still service those features offered by the same subsystem that offers hibernation). The MDs could hibernate into low (or zero, with some home automation power management) power mode when not in use. Which, if hibernate/restore were really fast (under 5 seconds, maybe 10), could be managed by presence detection so they'd be on only when someone was nearby to notice.
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on January 27, 2008, 07:35:49 pm
This is the goal for me - to have the MDs switch on at the press of a button in less than 30 secs. Otherwise the system is a lot more annoying than using a normal TV, and my girlfriend won't be happy with it - quite rightly so!
Title: Re: hibernation would save a lot of time
Post by: chrisbirkinshaw on February 03, 2008, 07:10:52 pm

So this strengthens my suspicion that the AppServer somehow gets "out of tune" with the core during long periods of sleep. I'll see what I can find out, but I suspect we need to have someone with a better understanding of the AppServer/DCE router stuff to look into it.


It seems lmce is not properly tracking the state of the app server. When the process dies it does not restart and it is not possible to restart it manually as lmce still thinks it is running and does not allow it to initialise. See here:

http://forum.linuxmce.org/index.php?topic=4156.0

Any ideas (please post to other thread)? The web admin page says the app server is not registered.

Chris