Computer won't wake from suspend to record
Added by Newbie Number1 about 8 years ago
I have just got tvhead to work on a GB-BACE-3000 running Ubuntu Mate with Kodi.
http://www.gigabyte.com.au/products/product-page.aspx?pid=5569#ov
It works and it records a scheduled program BUT only if the computer is on.
It will not wake from suspend to record a scheduled program.
I have tried the command rtcwake using 'mem' sleep and setting a time interval and it wakes properly, so it's not an issue with the computer.
What can I do to get it to wake from suspend to record a program?
Replies (7)
RE: Computer won't wake from suspend to record - Added by Robert Cameron about 8 years ago
You need a script to run before it sleeps to set the wake time. Ultimately, it would be nice if this feature was rolled into Tvheadend proper, so that each time the guide updated and the DVR list was updated, the wake time would be set to the next DVR recording.
MythTV does something similar, where it manages the sleep of the system. So basically it all comes down to what subsystem you are using to manage sleep/wake. Systemd? acpid? Then you can look for the proper hooks to run before the system sleeps, query Tvheadend for the next DVR event, and set your wake time before your sleep subsystem puts your machine to sleep.
RE: Computer won't wake from suspend to record - Added by Newbie Number1 about 8 years ago
Thanks, so does it check for scheduled recordings and add them as wake timers automatically each time you click suspend?
Is it difficult to install this script? I'm a linux newbie.
RE: Computer won't wake from suspend to record - Added by Robert Cameron about 8 years ago
The script is something you write, not something you install.
Everyone's use case is different, hardware/available software varies, &c., therefore such a script is usually tuned to your use case.
However, I seem to remember there was a Kodi addon for managing sleep/wake with TVH, and since you said you're using Kodi, perhaps you can look into that. (I believe the assumption is that Kodi and TVH are running on the same device.)
RE: Computer won't wake from suspend to record - Added by Newbie Number1 about 8 years ago
Thanks, I'll look for it. Using a kodi addon would I need to always start kodi to suspend the computer with the kodi shutdown/exit menu instead of the normal Ubuntu menu?
I'm a newbie but if the computer can wake via a simple rtcwake command, why does it need a custom script written by an expert to wake to record a show?
RE: Computer won't wake from suspend to record - Added by Robert Cameron about 8 years ago
Well, there are several issues to think of.
First when does the computer go to sleep, and how? Are you tracking idle time? Are you using acpid? pm-utils? cronjob?
What determines when the computer sleeps? Is there some measure of activity? Which activities are you tracking, and which do you ignore? Are you basing it solely on Tvheadend? Is it 30 mins of inactivity? 60?
What about other conditions to wake the machine? Setting the BIOS to wake at a certain time is fine for a recording, but what if you want to watch Live TV when the machine is asleep? Are you using magic packets (wake-on-lan)? If so, what it sending the WOL request? What about warmup/bootup time for the machine and tuning?
RE: Computer won't wake from suspend to record - Added by Newbie Number1 about 8 years ago
I'm not sure. The computer is a recent Gigabyte brix (mini Celeron pc).
But I did a search in kodi addons for wake, suspend and sleep and all I found was a wake on lan addon. Do you remember what the addon was called? Does it still exist?