Lx-Soft.com is still alive!

Vink's EPIA Story: Myth TV


Wakeup the PC before a recording

You will need to enable some feature on your kernel (*):

  • # RTC interfaces
  • # Platform RTC drivers

After a reboot, you will have a /sys/class/rtc/rtc0/wakealarm available on your system.

Now, we will have to check the time of the next recording. Luckily, a perl script which is supplied with mythtv (myth_upcoming_recordings.pl) does 99% of the work. I've writem a patch for this script to display only the UNIXTIME of the next recording.

We need to feed this value to the RTC Wakealarm before the system shutdown. The simplest thing is to patch /sbin/shutdown command, thus it will work with any call to shutdown. You have to move /sbin/shutdown to /sbin/shutdown.orig. Use this new /sbin/shutdown command to do what we want:


TIME=<path to myth_upcoming_recordings.pl>/myth_upcoming_recordings.pl --time_text --recordings 1
let WAKE=$TIME-600 echo 0 > /sys/class/rtc/rtc0/wakealarm echo $WAKE > /sys/class/rtc/rtc0/wakealarm /sbin/shutdown.orig $@

(*) kernel 2.6.26 does not support ACPI wake-up (Vanilla kernel). You will need to patch this kernel to correct the issue.