Wakeup the PC before a recording
You will need to enable some feature on your kernel (*):
After a reboot, you will have a /sys/class/rtc/rtc0/wakealarm available on
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
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo $WAKE > /sys/class/rtc/rtc0/wakealarm
(*) kernel 2.6.26 does not support ACPI wake-up (Vanilla kernel).
You will need to patch this kernel to correct the issue.