Software Suspend

From MythTV Official Wiki
Revision as of 01:48, 19 November 2011 by Wagnerrp (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I thought I'd share my experience with using swsusp2 (can be found at http://swsusp.sf.net/ ). Installing swsusp2 is fairly straightforward when you are familiar with kernel compilation, you will probably need vanilla kernel sources for the patches to work. Everything is pretty good explained on the website. btw, enable LZF compression, but do not enable gzip, it will slow down the suspension process remarkably, it is only needed if you have a small swapspace.

Note that depending on what Linux distro you're using, you may have software suspend already installed.

When you suspend the machine it brings down the network connections (eth0, and maybe others), deamons depending on the net will be brought down by the init / rc system. So don't forget to add mythbackend and other deamons you need (sshd?) in the configuration file ( /etc/suspend.conf ). The startup of the deamons after suspension doesn't work on Gentoo, on that distro you can start the command "rc default" from the hibernate script to bring back the system in the default runlevel and thus start all stopped deamons if necessairy.

The stupidity with the MythTV 0.14's powersave feature is that you need to stop mythfrontend before the backend will call the 'halting' scripts. So you basicly can't build a system that will only show the frontend at all time, while also shutting down the machine. Ah well, whouldn't mown, OSS, patch it, etc.

As a rather ugly hack I made a little looping script like this:

#!/bin/bash

while [ 1 ]
do
  mythfrontend
  Xdialog --msgbox "Press PLAY to start the frontend (again)" 12 50
done

And told the other users that they should exit the frontend when not in use ("uh? why doesn't it go into standby automatically?"). When you now "killall xdialog" from the hibernate script, the loop will restart mythfrontend. You could probably make it more clean by saving the Xdialog PID somewhere and killing only that PID.

I couldn't get swsusp2 to resume correctly on another machine, while using the nVidia binary drivers and keeping X running, though YMMV. Other people are using swsusp2 with nVidia cards. Yes, tried all the documented tricks.

Suspension was canceled on my MythTV system a couple of times when I tried. So I am currently not using it. I was told it was probably fixed with a recent patchset. But when it works for you it will save you a couple of valuable seconds ;-) to boot the system, not to mention having the file caches already filled and loaded.

Henk Poley