Mythtv and ACPI wakeup on Opensuse 10.2

Today I got acpi wakeup working on my opensuse 10.2 based mythtv box ;-))

As I wrote in a lengthy earlier post, I am pretty much happy about my mythtv setup now. It has been running quite well for some time now.

But one thing has been bothering me: I had not managed to configure the box to turn itself off, and back  on, so I let it run 24/ 7, which ofcourse is fine from a purely stability point of view, after all this is linux which unlike windows is fine to run for years without reboot.

But from a power consumption point of view, this has been annoying me and today I set out to fix it.

So today I set out to find out why I could not get mythtv to do this right. I remember that last time I looked at this (which is a long time ago) I tested acpi wakeup from a term, and was encouraged to find that it worked. But it did not work when mythtv shut down the box, and I did not have time to pursue the problem back then.

Until now.

I found out that my script to set the ACPI alarm (by writing to the virtual file /proc/ACPI/alarm) was not getting called correctly from mythbackend.

The error was actually quite trivial, as I had mythtv call my script with $time, in time_t format and stated like this: $($TIME) + 300).

First I saw on the terminal as the “shutting down” messages were whizzing by, that this was literally sent as: “2007/10/10 09:27 +300” which made the script which was supposed to convert the time in local time format to UTC before writing it to /proc/acpi/alarm.

I then changed the format in mythtv from time_t (I am not sure how to get the 300 seconds extra bootup time originally intended) to YYYY/MM/DD HH:MM, and now the box shuts down and boots up as needed to record the shows I have scheduled.

I think I took my script (with trivial modifications) from an example on this page:  here but they have a different script now. I haven’t tried the new script, but it looks ok as far as I can see, and will work with “old kernels” like the 2.6.18-5 I am using for this box, as well as the 2.6.22+ kernels which have changed the way acpi wakeup works. Do try it out, and let me know if that works for you. I don’t know when I will upgrade my mythtv box, as with this little annoyance fixed, I am actually quite happy with my mythtv box.

But one of these days, I have to find out why the remote does not work (it did once, but I reinstalled and upgraded from 10.1 to 10.2 since then, and probably changed some configuration somewhere, but that is a task for another day).


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: