Posts: 96
Joined: Aug 2010
Reputation:
1
Hi there, i've created an addon that will suspend/wakeup xbmc for tvheadend recordings, and i'm wondering where i should share it... i tried putting it in this post, but there was too many characters... i looked at the wiki, but couldnt immediately figure out how to create a page...
thoughts? or maybe noone is interested?
Nathan
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
if you don't want to do the obvious thing and host it in a scm somewhere, use a pastebin site.
Posts: 2
Joined: Feb 2011
Reputation:
0
2011-02-17, 21:15
Hi Nathan,
Is the addon related to the Python script you wrote?
I tried the script, it was pretty cool and I'd love to test your addon.
Hooman
Posts: 117
Joined: Dec 2006
Reputation:
0
2011-03-02, 06:57
(This post was last modified: 2011-03-02, 09:43 by ads_german.)
Hi Nathan,
I'm going to give this a try tonight - I should be able to figure out where each file needs to go to get it working, but would still appreciate any documentation you may already have...
Cheers,
Adam.
**************
Never mind - just read the readme more closely and it clearly shows where each file needs to live, should be pretty straight forward to test.
Posts: 96
Joined: Aug 2010
Reputation:
1
good luck, let me know if you have any problems... it's been working fine on my ion330, with tvheadend, and harmony remote... I have changed a value in the default.py file to increase the time difference calculation to 60 seconds from 30... sometimes the wakeup is > 30 seconds from what gets set in ACPI..
Let me know how you go...
Cheers,
Nathan
Posts: 117
Joined: Dec 2006
Reputation:
0
Hi Nathan,
Ok, installed it last night, but not quite running right. Few minor issues to get it running (wrong indentation on line 60 - in default.py from memory), had to set tvheadend password as appropriate (is hardcoded in checkRecording function), set write/execute permissions where required to allow upload of files and to create the log file, but nothing too tricky.
However, when the script runs, I just get the message 'Determining recording status....' and the 2 buttons to choose from - return back to XBMC works as expected, but the 'Shutdown XBMC' button gave me the message 'Are you sure you want to shutdown with active recordings' even though I didn't have any recordings active or scheduled.
I tried setting up a recording (both running at the time and one scheduled in a few hours time), but the prompts never changed. If I select the button to go ahead and shutdown xbmc despite an active recording (even if there isn't really an active recording), it just returns me back to xbmc regardless.
Looking in the checkRecording function, none of the messages to indicate that the system is currently recording, or has an upcoming recording ever get written to the logfile, or displayed on screen. The logfile just fills with 'starting the process' 8 times over (I tried clearing it).
I started mucking around last night trying to debug by writing something else to screen or the logfile and see where the script is getting stuck, but I've never played with python before (though I used to code in php years ago as a web develoepr) and I ran out of time to keep playing with it.
Any tips on what to try before I keep fumbling my way through?
Cheers,
Adam.
Posts: 96
Joined: Aug 2010
Reputation:
1
Hi there.... the intended function is sort of like this
Every 20 seconds a timer thread kicks off, and the status is determined from the status.xml
If the script determines that tvheadend is recording, it
* checks to find out when the current recordings will finish,
* writes the currently recording title to the screen
* then starts another 20 second counter thread.
If the script determins that tvheadend is not recording, it
* checks to find out when the next recording is due to start
* runs the shutdown.sh (to set wakeup time etc)
* computer goes into suspend mode
* computer wakes up
* script determines if the computer woke itself up, or was a user command
* if user command, exit the pvruptime (return to xbmc)
* if computer wakeup, start another 20 second counter thread
Theres a bunch of settings (minimum sleep time, time to resume before recording etc)... but thats the basics of it...
The keys are
* run the shutdown.sh script outside of pvruptime addon, to makesure you have the shutdown/wakeup working properly.
* permissions can be a killer, so i added shutdown.sh to sudoers
* mapping the powerdown remote button to the pvrprtime addon, so that instead of shutting down, the pvruptime addon runs, and either keeps the machine awake (to record), or suspends the machine (with a wakeup time set for next recording).
I hope that helps...
Cheers,
Nathan
Posts: 824
Joined: Jun 2005
Reputation:
6
This is something I was looking for. Thanks.
I'm gonna play with it when I have some free time. Does it prevent computer suspend while you are watching a movie or listening a music (or when they're paused atm)?
Posts: 117
Joined: Dec 2006
Reputation:
0
It doesn't automatically suspend your computer - suspend still only happens by pressing the power button on your remote.
But then the script intercepts the process, works out when the next wakeup for recording is due, and writes it to the RTC alarm before suspending (or if you're recording something at the time, it waits until recording is finished before suspending).