View Full Version : Automatic soft padding running on the TiVo
sanderton
10-08-2003, 06:36 PM
This thread and the software posted in it are now deprecated. The current version of EndPad and support for it are now handled by maxwells_daemon in this thread (http://www.tivocommunity.com/tivo-vb/showthread.php?t=286631).
EndPad is a program which runs in the background on the TiVo and extends the recording time of shows (start and end) by the amount you specify if, and only if, that would not cause a clash with another recording. This means that you need no longer juggle SPs with extra recording time which cause other SPs to be missed.
A particular bugbear in the UK is BBC 2, which frequently runs 2 mins late, but also has a lot of shows you might wish to record running back to back. Keeping track of which of these shows was the last one, which needed padding, and which was an earlier one, which didn't, was a nightmare, especially as the shows on BBC 2 usually have different season durations, so it keeps changing! EndPad sorts BBC 2 (and ITV 1) out for you.
I took LJ's noreddot as my inspiration - rather than try to get everything done in advance, this program only actually adds the end padding to the programme being recorded 5 minutes before the end of the recording, and adds start padding just 1 minute before it is due.
This "just in time" automated approach has many advantages:
The recordings remain part of their SP with all other settings completely intact.
New recordings and new SPS do not trigger clashes with padding, because the padding is not there until almost the end of the recording
Suggestions get padded too (something many have asked for)
It can run from rc.sysinit.author, so is completely automated with no user input needed
In fact, it's as close to TiVo implemented soft padding as I think you are going to get until we get v5 in the UK :)!
If the full amount of padding cannot be added, EndPad will add as much as it can. End padding on a show has priority over start padding on the next one. Padding you set manually or in a SP has priority over both (although EndPad will try and increase the user set padding to the soft level if it can).
If you want to see what it is up to, you can view the logs (which are I hope reasonably intelligible) through the Logs module of TiVoWeb.
Note 1: By default, when EndPad looks at the next recording it takes suggestions as being disposable and deletes them to accommodate end padding if needed. If two back to back suggestions are scheduled, EndPad pads the first one and deletes the second. You can use the -sugeq switch to turn off the deletion of suggestions
Note 2: if you try and add a recording as it is actually starting and get the clash warning because of EndPad's padding of the previous show, manually stop the current recording before adding the new one. TiVo's built in conflict resolution can result in the whole prior programme being deleted in some circumstances.
Note 3: EndPad has the ability to alter the recording quality of any suggestions, allowing you to, say record suggestions at Medium while leaving the default at Best, making setting up SPs faster. Use the optional -sugqual switch with values of 0 (Basic), 40 (Medium), 75 (High) or 100 (Best)
To get the best out of it, your SPs should not set any hard padding themselves. That way TiVo will be able to operate with the lowest number of clashes. The PC based utility I wrote (http://www.tivocommunity.com/tivo-vb/showthread.php?s=&threadid=135029) has an option to remove all padding from SPs if you have a lot to go through.
It will work on all TiVos on both sides of the pond, but will not be fully optimal on DirecTivos as it does not attempt to use the second tuner for extending shows. falconx has produced a version which works with dual tuners - unfortunately forum rules mean I can link to it as it's on the database of deals. The thread id is /forum/showthread.php?t=31854
Copy to the TiVo using binary mode FTP then:
chmod 755 endpad.tcl
Run with:
./endpad.tcl -s x -e y -sugqual z -sugeq
where:
x is the number of minutes of start padding to add
y is the number of end padding to add
z is the recording quality to change suggestions to (0/40/75/100) (Optional)
the optional sugeq parameter prevents EndPad cancelling a suggestion by padding another one
Stop with:
./endpad.tcl -stop
Run from rc.sysinit.author with the -auto flag:
/var/hack/endpad.tcl -s x -e y -sugqual z -sugeq -auto >> /dev/null &
This post will always contain the most up to date version and instructions.
EndPad is entirely free to use, but next time its saves you a verbal beating thanks to a caught ending that would otherwise be missed, please consider an appropriate donation to Cancer Research through this link:
http://www.justgiving.com/brigid
Please put "EndPad" in the comment.
Please not that there are restrictions on distribution - read the readme.
cwaring
10-08-2003, 06:46 PM
Just wanted to say, nice one, Stuart. Pity I can't use it :D Then again, I haven't really needed it so far. Of course, you know what'll happen now, don't you ;) :p :eek: :rolleyes:
sanderton
10-08-2003, 06:59 PM
You don't need TurboNet to run it Carl, a serial cable will work fine.
groovyclam
10-09-2003, 12:32 AM
Can you go even further and add soft padding to the start of a recording ?
Ideally I would set all my SP's to start/end at scheduled times to avoid overlaps from hard padding *but* have your super utility add 1 minute of soft padding to the start of my SPs and 5 minutes soft padding at the end.
Well done for doing what you have done so far.
tivo_boj
10-09-2003, 02:50 AM
This is superb if it works. Just the thing we have been looking for. All we need now is a simalar programme which checks x minutes before a programme starts to see if any thing else is recording, if not start the sceduled recording early. Combined we would have as close as possible soft padding.
Have just loaded it up and await tonight to see the outcome. I will post my findings.
Dibblah
10-09-2003, 03:26 AM
Wow. Very nice!
Cheers,
Allan.
pahunt
10-09-2003, 03:28 AM
Thanks very much for all your hard work, it's much appreciated :D
sanderton
10-09-2003, 03:47 AM
Originally posted by tivo_boj
All we need now is a simalar programme which checks x minutes before a programme starts to see if any thing else is recording, if not start the sceduled recording early. Combined we would have as close as possible soft padding.
Easy to do, and will be in a future version, but I want to be sure this one is running and stable first.
My main concern with it as it stands is long term stability - I know from other stuff I run that sometimes these things just stop and need restarting.
gregh
10-09-2003, 03:52 AM
>> I know from other stuff I run that sometimes these things just stop and need restarting.
I've seen this done on other unix boxes where you check for a process running and if it's not there start it!
That should keep the other half and my son happy !
Can't wait to try it
Can I go home from work now - oh - its only just gone 9am damm!
Thanks
MAS
groovyclam
10-09-2003, 04:31 AM
I'm trying to get a bash via serial on my TiVo
I have the right lead for a serial connection and manage to get the prompt to put in the "factory" password.
I then get to the menu where I enter "B" to boot but then I get no bash - just nothing. Hitting return causes nothing to happen ( the TiVo *has* booted all the way )
Is there no bash run in the default UK version init scripts - or do I have to rip the harddrive out and put it in my PC to put a bash in the init script first ?
If I have to rip the disk out I will cry! ( Although I suppose my TiVo is due for a backup )
sanderton
10-09-2003, 04:34 AM
Originally posted by gregh
>> I know from other stuff I run that sometimes these things just stop and need restarting.
I've seen this done on other unix boxes where you check for a process running and if it's not there start it!
Yes, that was the conclusion I was coming to as a safety net - a cron job every couple of hours looking for the process ID and running it if it's not there.
sanderton
10-09-2003, 04:35 AM
Originally posted by groovyclam
I'm trying to get a bash via serial on my TiVo
I have the right lead for a serial connection and manage to get the prompt to put in the "factory" password.
I then get to the menu where I enter "B" to boot but then I get no bash - just nothing. Hitting return causes nothing to happen ( the TiVo *has* booted all the way )
Is there no bash run in the default UK version init scripts - or do I have to rip the harddrive out and put it in my PC to put a bash in the init script first ?
If I have to rip the disk out I will cry! ( Although I suppose my TiVo is due for a backup )
I think you have to pull the disk - they took out the ability to get a bash prompt on an unmodded TiVo with 2.5.5. Mr Tickle is the bash over serial in the the UK guru. Have you checked the link in his sig?
groovyclam
10-09-2003, 04:58 AM
I think you have to pull the disk - they took out the ability to get a bash prompt on an unmodded TiVo with 2.5.5.
Oh that was really useful of them wasn't it! Well done TiVo.
In that case I will wait until you have perfected your super script and rip my disk out then.
You realise you have made something that is worth all the hassle of opening my TiVo again!
leejordan
10-09-2003, 05:35 AM
Originally posted by groovyclam
Can you go even further and add soft padding to the start of a recording ?
This sounds absolutely fantastic! I can't wait to get home and try it out.
I agree with the above quote about adding some front end padding as well. This might help those of us with NTL/Telewest cable boxes that have trouble changing channels sometimes exactly on the hour.
Lee.
Adder
10-09-2003, 06:07 AM
Well done Stuart!
I've had this running overnight and it added 2 minutes of much needed padding to thr World Rally Championship Omnibus on Channel 4!
I run some consecutive recordings each morning and they all seem to be fine as well!
I'd like to support also the request for front padding as well.
It's top stuff! :D
burriko
10-09-2003, 07:50 AM
nice work sanderton!
one quick question though before i try it. what does this do to recordings that already have hard padding set? say i have this program running with soft padding set to 2 minutes, and then i schedule a recording and set tivo to pad the end by 5 mins. would this prog remove the 5 mins that i added and set it 2 mins, or would it add 2 mins to the 5 mins that is already set.
cheers.
sanderton
10-09-2003, 08:00 AM
As it stands it will remove the 5 mins and insert 2 mins. Which is a good point!
groovyclam
10-09-2003, 08:18 AM
Another question:
If I am recording something which finishes at ( for example ) 2pm and your super util soft pads it for 5 mins -> 2:05
BUT...
TiVo has a suggestion to record starting at 2pm what will happen:
1) Your softpad takes priority and my scheduled recording runs until 2:05 and the suggestion is discarded or...
2) TiVo stops recording my scheduled recording at 2pm exactly and changes channel to record the suggestion ( which itself will then be padded )
I would prefer it if TiVo did option [1]
Dapper Dan
10-09-2003, 08:35 AM
Sounds much better than softpad. I look forward to trying this out, and startpad when it's ready.
:up:
burriko
10-09-2003, 08:40 AM
Originally posted by groovyclam
Another question:
If I am recording something which finishes at ( for example ) 2pm and your super util soft pads it for 5 mins -> 2:05
BUT...
TiVo has a suggestion to record starting at 2pm what will happen:
1) Your softpad takes priority and my scheduled recording runs until 2:05 and the suggestion is discarded or...
2) TiVo stops recording my scheduled recording at 2pm exactly and changes channel to record the suggestion ( which itself will then be padded )
I would prefer it if TiVo did option [1]
from reading through the script it appears to discard suggestions if they get in the way. so option [1].
i could be wrong though.
sanderton
10-09-2003, 09:26 AM
You are correct, it will cancel any suggestion which would block padding. At least it is supposed to, but looking at that code again there's a typo in it which means it actually won't. Say what you like about VB but at least it doesn't let you key in a variable name wrong! :) I'll post an update when I've had a chance to check it.
I'll make it not reduce any pre-existing padding while I'm at it.
tivo_boj
10-09-2003, 12:32 PM
I'll make it not reduce any pre-existing padding while I'm at it. .
I would rather have it set hard padding to zero and then put in the softpad. This way I know where I am. I know you cant please all the people all the time, so I will just happy which ever way you go.
It might be worth in a later version to have this selectable (or two versions).
Keep up the very good work:D :D :D
doogie
10-09-2003, 12:48 PM
I started it running this morning, but have had a check and it's not running anymore.... how often should I expect it to require re-run and does it write to any logs when it dies?
Fabulous idea by the way! :D
Cheers
tivo_boj
10-09-2003, 12:48 PM
Sorry for being thick, I did know once but have never used it - where should i place
rc.sysinit.author.
Also has anyone got a copy I could use as a template.
I think it worth using now we have "softpad"
sanderton
10-09-2003, 01:00 PM
I suggest you read through this:
http://tivo.stevejenkins.com/network.html#_Toc43127463
sanderton
10-09-2003, 01:05 PM
Originally posted by doogie
I started it running this morning, but have had a check and it's not running anymore.... how often should I expect it to require re-run and does it write to any logs when it dies?
The next iteration writes a log file!
The two copies on my TiVos were up for 18hrs each until I replaced them with an updated copy a few mins ago, so they CAN stay up for a while.
leejordan
10-09-2003, 04:44 PM
Sorry to be dim :confused:
I've installed endpad.tcl in /var/hack and done a chmod 755 endpad.tcl, but when I try to run it I get the message
": no such file or directory (including the leading quote and colon)
Any ideas please?
Thanks.
Lee
tivo_boj
10-09-2003, 05:05 PM
Move to the hack directory
/var/hack
then run endpad
endpad.tcl 5
THAT SEEMED TO WORK FOR ME
BUT THERE AGAIN I'AM ALSO A BIT DIM....SO MAYBE I WAS LUCKY.
leejordan
10-09-2003, 05:08 PM
Originally posted by tivo_boj
Move to the hack directory
/var/hack
then run endpad
endpad.tcl 5
THAT SEEMED TO WORK FOR ME
BUT THERE AGAIN I'AM ALSO A BIT DIM....SO MAYBE I WAS LUCKY.
Thanks but I still get the same message.
Lee.
mike0151
10-09-2003, 05:09 PM
depends if /var/hack is in the PATH
If not, from /var/hack run ./endpad.tcl
or run /var/hack/endpad.tcl
HTH
leejordan
10-09-2003, 05:35 PM
Originally posted by mike0151
depends if /var/hack is in the PATH
If not, from /var/hack run ./endpad.tcl
or run /var/hack/endpad.tcl
HTH
/var/hack is in my PATH and I get the same result which ever way I run it.
Told you I was dim :)
sanderton
10-09-2003, 05:56 PM
Did you transer the file in ASCII mode, or open it and save it in a Windows text editor before transferring it?
Try FTPing it again making sure you are in binary mode.
leejordan
10-09-2003, 06:05 PM
Originally posted by sanderton
Did you transer the file in ASCII mode, or open it and save it in a Windows text editor before transferring it?
Try FTPing it again making sure you are in binary mode.
Thanks Sanderton, that did the trick :D
I had opened it in Wordpad before I ftp'd it.
Thanks again!
Lee.
sanderton
10-09-2003, 06:29 PM
New version in top post:
Couple of bug fixes (suggestions now work as they were supposed to, pre-existing end padding is respected). Plus now saves a log file which could give some clues if it falls over!
Fozzie
10-09-2003, 07:35 PM
Truly great work :cool:
Installed and working fine so far. (Just had a look in the log. Am i correct in saying that although it says local time, it is in fact GMT?)
Thanks again for this great app.
Originally posted by sanderton
My main concern with it as it stands is long term stability - I know from other stuff I run that sometimes these things just stop and need restarting. At the cost of an extra bash process, you should be able to do this by changing the rc.sysinit.author to something like the following: (sleep 120 && while ! /var/hack/endpad.tcl n -run 2>>/var/hack/endpad.err) & Basically, bash then runs endpad.tcl over and over until it exits normally (or, looking at it the other way, it re-runs endpad.tcl if it exits abnormally).
Note: The line above appends to the log file instead of replacing it.
Also, is there a reason to put the log file is in /var/hack instead of /var/log?
Originally posted by tivo_boj
I would rather have it set hard padding to zero and then put in the softpad. This way I know where I am. What would be the usefulness of unconditionally wiping out the hard padding? Soft padding does not remove the need to hard pad sometimes (e.g., sports events that habitually run long—with only soft padding, no padding might occur, missing the ends of games in order to record another programme).
Dibblah
10-09-2003, 11:31 PM
Files in transit - Passworded to stop forking :)
Cheers,
Allan.
It looks like the current script is an all-or-nothing padding and also simply replaces existing hard padding if the soft pad amount is greater.
The code below changes behavior so that soft padding adds to the existing (hard) padding and less soft padding will be used if necessary. First, change endtime to be at the end of the hard-padding.
# Time this recording ends, including hard-padding.
set endtime [expr "$recstartdate * 86400 + $recstarttime" + $duration + existingpadding] Then, change the block where padding is set to # Check if padding can be added
if {$endtime < $nextstart || $nselectiontype == 6} {
RetryTransaction {
# Alter the database record to add the padding
set rec [db $db openid $recfsid]
if {$newstoptime <= $nextstart} {
# Extend with maximum soft padding.
dbobj $rec set EndPadding [expr "$existingpadding + $padding * 60"]
puts $logchan "[clock format [clock seconds]] : Added $padding minutes padding"
} else {
# Soft pad until start of next recording.
set shortpad [expr "$nextstart - $endtime + $existingpadding"]
dbobj $rec set EndPadding $shortpad
puts $logchan "[clock format [clock seconds]] : Added $shortpad seconds padding"
}
}
} else { Warnings: The above was coded blind and hasn't been tested!
All existing padding is treated as hard padding. If the script dies repeatedly, then the current recording can get padded repeatedly (i.e., soft padding is treated as hard padding once the script exits, so it can then get padded further). If stability proves to be a problem, state files can be written to preserve padding information between runs of the script so that recordings do not get re-padded.
The code for setting $nextrec needs to be changed to a loop that searches for the next non-suggestion. Currently, it's always the next recording, even if the next recording is a suggestion.
With my changes suggested above, this bug results in suggestions being able to prevent or limit soft padding.
With the code as is, this bug can result in “soft” padding preventing the next non-suggestion from recording if a sufficiently large soft padding setting was specified.
sanderton
10-10-2003, 05:27 AM
Thanks Dibblah and ccwf, I will look at incorporating your improvements in the code tonight.
ccwf, I'm happy with its existing behaviour with hard padding, ie if it's been set it stays as set (unless it's less than the softpadding amount). The logic being that if someone is using this utility then they will have removed all hard padding from their programmes, except in instances where they have a particular reason for setting an amount. In such circumstances I think the code should respect their judgment about how much padding they want.
Fozzie
10-10-2003, 05:40 AM
Originally posted by ccwf
What would be the usefulness of unconditionally wiping out the hard padding? Soft padding does not remove the need to hard pad sometimes (e.g., sports events that habitually run long—with only soft padding, no padding might occur, missing the ends of games in order to record another programme).
I'm with you on this one. Hard padding should not be removed before applying any soft padding,
Originally posted by ccwf
It looks like the current script is an all-or-nothing padding and also simply replaces existing hard padding if the soft pad amount is greater.
The code below changes behavior so that soft padding adds to the existing (hard) padding
I think I prefer the first method - e.g. If hard padding of 3 mins has been set up in the SP and soft padding is configured to add 5 mins, I would expect a grand total of 5 min of padding to be added to the recording (which you could think of as the original 3 mins of hard padding and 2 mins of soft padding)
Originally posted by ccwf
The code below changes behavior so that soft padding adds to the existing (hard) padding and less soft padding will be used if necessary.
I'm not sure what you mean by this. Please could you (or Sanderton) clarify. In the original softpad PC based app, I thought that the amount of soft padding applied to a recording could be reduced automatically, if the full amount would have caused a clash with the next scheduled recording. Isn't that what endpad.tcl does currently? Is that what you are proposing?
Many thanks.
Edit: I agree entirely with Sanderton's approach/methodology for dealing with hard vs. soft padding.
sanderton
10-10-2003, 05:46 AM
Originally posted by Fozzie
I'm not sure what you mean by this. Please could you clarify. In the original softpad PC based app, I thought that the amount of soft padding applied to a recording could be reduced automatically, if the full amount would have caused a clash with the next scheduled recording. Isn't that what endpad.tcl does currently? Is that what you are proposing?
Many thanks.
I was going to implement it that way in the first instance, but I need to do some more checking about the way TiVo actually does some of the start/stop calculations.
It appears if you look at the top-level data that the stop and start times of adjacent recordings are "on the minute", but then you look more closely at some of the other timing parameters, and TiVo does give itself a few seconds to make the change. I didn't want to code for all available padding to be set if that then messed up the time TiVo needs to make the change, and I haven't yet has the chance to test the various options for how to handle that.
Fozzie
10-10-2003, 05:58 AM
Ok, thanks Sanderton. I understand.
Actually, thinking about it a bit more, the chances of needing to reduce the amount of soft padding occuring are extremely low. I use 5 minutes of soft padding so it's pretty unlikely that the next scheduled recording is at an odd number of minutes i.e. 1,2,3, or 4 minutes later! Have you done any testing with end to start gaps equal to the amount of soft padding and confimed that both the padding is applied and the next recording does start ok? I can give it a thrash later.
So, having said all that, I probably don't really need endpad to automatically reduce the amount of soft padding :)
(I guess things do get interesting if/when start padding comes into play. Again, I can't really see myself using that one and so would hope that it's implementation is not detrimental to the way that end padding currently works. As at a lot of people have said before, I would much rather miss the start of a programme than the end.)
Originally posted by sanderton
It appears if you look at the top-level data that the stop and start times of adjacent recordings are "on the minute", but then you look more closely at some of the other timing parameters, and TiVo does give itself a few seconds to make the change. I didn't want to code for all available padding to be set if that then messed up the time TiVo needs to make the change, and I haven't yet has the chance to test the various options for how to handle that. Definitely needs investigation. Worst case, it might be necessary to cut the soft-padding short a few seconds in the case where soft-padding all the way to the next recording.
sanderton
10-10-2003, 06:04 AM
Originally posted by Fozzie
(I guess things do get interesting if/when start padding comes into play. Again, I can't really see myself using that one and so would hope that it's implementation has not detrimental to the way that end padding works. As at a lot of people have said before, I would much rather miss the start of a programme than the end.)
Yes, I'm wrrestling with the logic of that one at the moment! The easiest thing to do is to add the start padding to the next programme at teh same time as you add the end padding to the current one. However that goes against the "just in time " philosphy which minimises the possibilities of soft padding causing a clash.
I'm thinking at the moment that if the next programme starts within say 15 mins of the end of the current recording then it will get on and do it, othewise it will wait until just before the next one. I need to test how late I can leave it and TiVo will still respond!
Soft end padding will take priority of over soft start padding, but hard start padding will override both.
Originally posted by Fozzie
I use 5 minutes of soft padding so it's pretty unlikely that the next scheduled recording is at an odd number of minutes i.e. 1,2,3, or 4 minutes later! Here in the U.S., a small number of widely watched programmes have guide data starting or ending on odd-minute boundaries (late night talk shows, NBC's most popular primetime shows), so odd minute recordings can definitely occur. I don't know how common such situations are in the UK. (I guess things do get interesting if/when start padding comes into play. Again, I can't really see myself using that one and so would hope that it's implementation is not detrimental to the way that end padding currently works. As at a lot of people have said before, I would much rather miss the start of a programme than the end.) Agreed that missing the starts of programmes is less important than missing the ends, but enough programmes start a bit early that soft-padding the starts would be useful for many.
Fozzie
10-10-2003, 06:28 AM
Crikey, you guys have it tough - consistently late starting programmes, odd minute boundaries, early starting programmes..... etc etc. Poor TiVo. Do you ever get to watch a complete programme from start to finish? :(
sanderton
10-10-2003, 06:32 AM
In the UK we have odd numbered starts and finishes - they just give Tribune the round-numbered version!
Of course when Tribune in the US started using the odd-numbered figures for some shows, it caused chaos as the extra couple of minutes caused a load of unexpected SP clashes. You can't win (unless brodacsters agrre to stick to nice round numbers).
iankb
10-10-2003, 06:39 AM
Originally posted by sanderton
You can't win (unless brodacsters agrre to stick to nice round numbers).
And that would never work on non-commercial channels, since nobody would want to watch 2 or 3 minutes of BBC promotions or interludes (remember those?) after each episode of the Simpsons.
Ian.
Fozzie
10-10-2003, 06:45 AM
I've been having a think about how to handle start padding so how's this for a starter for 10:
e.g. Scheduled recording for 1030, start padding of 5 mins set up.
1. Startpad checks at 1025 to see if TiVo is recording anything.
2. If it isn't, start recording programme (5 mins early).
3. If it is, don't do anything (and so scheduled recording starts at 1030).
Sounds too simple and so therefore can't be!
Keeping with the just-in-time philosphy is definitely worth sticking with.
sanderton
10-10-2003, 06:57 AM
Originally posted by Fozzie
[B]
Sounds too simple and so therefore can't be!
B]
Nothing is quite that simple :)
Code-wise the main complication with that approach would be if you have start padding set to be over 5 mins - that would mean the code would have to wake up before it had run in the first place!
Fozzie
10-10-2003, 07:08 AM
Originally posted by sanderton
Nothing is quite that simple :)
Code-wise the main complication with that approach would be if you have start padding set to be over 5 mins - that would mean the code would have to wake up before it had run in the first place!
Sorry, I didn't quite mean that. I meant to say that the app does the check at whatever the start padding time is set to. e.g if start padding is set for 7 minutes, then it checks 7 minutes before the start of each recording, if it's set to 3 minutes, then it checks 3 minutes before each recording etc.
sanderton
10-10-2003, 07:14 AM
Yes, but as it only looks up the start time of the next recording 5 mins before the end of the current recording, that time could already be in the past!
Not exactly insuperable I'll grant you, but trying to think through all the possibilities is what slows the coding down!
Fozzie
10-10-2003, 07:21 AM
I guess I was thinking of startpad (hey, it's got a name already) as a completely seperate process, without any dependencies on endpad. Therefore 'all' it needs to do is makes a 'simple' decision at the user defined time (the start padding interval) before each recording, whether to start recording or not. This decision being based on whether it is currently recording or not - if it is currently recording, don't do anything; if it isn't currently recording, start the next scheduled recording.
Anyway, it was just a thought. I bow to your greater experience with these things :)
sanderton
10-10-2003, 07:25 AM
Originally posted by Fozzie
I guess I was thinking of startpad (hey, it's got a name already) as a completely seperate process, without any dependencies on endpad.
I started down that road, but the run times of startpad and endpad would have to be co-ordinated, as once soft padding is added it cannot be told apart from padding added manually, so if the start pad got added first then it would take priority ove an overlapping start pad.
Fozzie
10-10-2003, 07:32 AM
hmmm, I can't see how start padding could be added before any end padding using my decison process. If a programme is currently being recorded when it checks to see if it can start the next one early, it won't do anything. It doesn't matter if the current programme is being recorded because of a 'real' end time, a hard padded end time or a soft padded end time. What matters is that it is being recorded and so shouldn't be stopped.
If however, nothing it is being recorded when it checks, then it should be ok to start the next recording (early)?
sanderton
10-10-2003, 07:46 AM
Yes, but you're logic has the starpad programme checking 5 mins before if 5 mins can be added - and I think you have to give the TiVo a chance to react to the changed padding settings - i'm not sure if it's event driven or ssome kind of timed check.
It's all fun and games!
Anyway, I'm sure it can be made to work.
bobnick
10-10-2003, 08:09 AM
If there's two suggestions scheduled back to back, or a regular programme followed immediately by a suggestion, will the first show be soft padded?
sanderton
10-10-2003, 08:36 AM
Yes
tivo_boj
10-10-2003, 08:43 AM
When using endpad thewvideo has frozen twice, and have needed change channels to unfreeze. This seems to have happened once while recording , once when not. As this did not happen before I can only put it down to endpad.
I also had startrd.tcl running at the same time, could this be causing a clash and thus the video freeze?
tivo_boj
10-10-2003, 08:50 AM
Originally posted by bobnick
If there's two suggestions scheduled back to back, or a regular programme followed immediately by a suggestion, will the first show be soft padded?
I think this is how we want it to work I would rather have a padded regular programme and miss the suggestion.
If its two suggestions back to back, again is it best to to get one full suggested programme than two suggestion with missed endings? Can't make up my mind on this, no doubt as author sanderton will make the decsion on which is easiest(and most stable).
sanderton
10-10-2003, 08:57 AM
I think it's very unlikely that endpad could interfere with the video in that way; especially not when there is no recording going on.
When there is no recording it is simply polling to see if a text file exists every minute - hard to see how that could freeze the video.
It won't clash with the red dot remover even if they were timed to go off at the same time; they only make one call to the same bit of data, and both use TiVo's built-in locking mechanism to avoid a clash.
The red dot remover is more likley to cause a problem as it simulates sending IR signals to the TiVo, and also capures the keypress events from a received IR signal, both things that could, I guess, cause issues if there was a problem.
I've been running endpad and noredot on one of my two TiVos with no issues (yet!).
Fozzie
10-10-2003, 09:00 AM
Originally posted by tivo_boj
If its two suggestions back to back, again is it best to to get one full suggested programme than two suggestion with missed endings? Can't make up my mind on this, no doubt as author sanderton will make the decsion on which is easiest(and most stable).
I'm not sure that the assumption that endings are 'normally' missed is right. I would prefer to have both suggestions recorded and run the risk of an ending being missed. After all, if I was that interested in the programme I would have set up an explicit recording. If only the first suggestion was recorded (because of padding), the second (now cancelled) suggestion may have actually been a programme that better matched my viewing habits (or was more interested in). After all, we know how random TiVo's suggestions can be ;)
All good healthy debate :)
Fozzie
10-10-2003, 09:08 AM
Originally posted by sanderton
Yes, but you're logic has the starpad programme checking 5 mins before if 5 mins can be added - and I think you have to give the TiVo a chance to react to the changed padding settings - i'm not sure if it's event driven or ssome kind of timed check.
If time was needed then perhaps you could check at 'padding duration' + 'n' seconds or check at 'padding time' and then start recording at 'padding time' - 'n' seconds?
tivo_boj
10-10-2003, 09:26 AM
Originally posted by sanderton
I think it's very unlikely that endpad could interfere with the video in that way; especially not when there is no recording going on.......
(cut)
...I've been running endpad and noredot on one of my two TiVos with no issues (yet!).
Thanks,
I will have a play to see if i can re-create, or maybe it was just a "blip" on my system
Originally posted by sanderton
I started down that road, but the run times of startpad and endpad would have to be co-ordinated, as once soft padding is added it cannot be told apart from padding added manually It really needs to be one script to handle the end padding, start padding, and possibly negative padding. Trying to coordinate multiple scripts in a safe fashion seems much harder than using a single script.
As for distinguishing between soft padding and the original hard padding, just save (in a variable outside the main loop and, eventually, also to a state file on disk) the ID and original end padding of the current recording (if any) and the ID and original start padding of the next non-suggestion recording. This information can be used between runs of the padding script to know what is soft padding and what is not. It can also be used within the script when this knowledge is necessary.
sanderton
10-10-2003, 11:43 AM
Originally posted by ccwf
It really needs to be one script to handle the end padding, start padding, and possibly negative padding. Trying to coordinate multiple scripts in a safe fashion seems much harder than using a single script.
As for distinguishing between soft padding and the original hard padding, just save (in a variable outside the main loop and, eventually, also to a state file on disk) the ID and original end padding of the current recording (if any) and the ID and original start padding of the next non-suggestion recording. This information can be used between runs of the padding script to know what is soft padding and what is not. It can also be used within the script when this knowledge is necessary.
I agree, it will be a single app.
I'm aiming to make it so that it simply doesn't need to know about what is soft and what is hard. (Insert own Carry On joke here..)
As long as you don't care about reducing the soft padding of a recording in progress in the case where someone kills and then restarts endpad with a smaller amount of padding (and I wouldn't), that should be possible.
bobnick
10-10-2003, 12:03 PM
OK, I'm having trouble getting the script to run. The tcl script is ideal for me, as I'm an airnet user and have dodgy reception!
I've downloaded the zip, and unzipped it using winzip. I've then transferred it using cuteftp to my tivo (ascii transfer) without opening the file. I've then telneted into tivo, gone into the hack directory and set the file permissions.
No matter whether or not I use ./endpad.tcl 3 or /var/hack/endpad.tcl 3 I get the error message ": no such file or directory
I've pulled the script back on to my PC, and it looks fine in notepad. I've also downloaded it again, and uploaded it using the dos ftp program - but always have the same problem.
Can anyone see what I'm doing wrong? I've run plenty of scripts ok in the past...
sanderton
10-10-2003, 12:06 PM
Try as a binary transfer; it's a text file but its a Unix text file; maybe your FTP client garbles the CR/LF. This doesn't seem to matter for TCL files that are not executable, eg TiVoWeb modules, but breaks executable ones.
sanderton
10-10-2003, 12:07 PM
Originally posted by ccwf
As long as you don't care about reducing the soft padding of a recording in progress in the case where someone kills and then restarts endpad with a smaller amount of padding (and I wouldn't), that should be possible.
As it only runs 5 mins from the end of the recording, they'd have to be trying quite hard to do that. :)
Yes, it's an unlikely case and not really worth the bother. :)
Fozzie
10-10-2003, 01:05 PM
Have just checked my log and there seems to be a few instances for the first few hours or so of starting endpad, where padding wasn't added but I can't see why:
e.g.
Thu Oct 09 23:55:00 localtime 2003 : Recording in progress
Thu Oct 09 23:55:00 localtime 2003 : Channel: UKST1
Thu Oct 09 23:55:00 localtime 2003 : Programme: {Garden Rivals}
Thu Oct 09 23:55:00 localtime 2003 : Scheduled End Time: Thu Oct 09 23:59:58 localtime 2003
Thu Oct 09 23:55:00 localtime 2003 : Next Channel: DISC1
Thu Oct 09 23:55:00 localtime 2003 : Next Programme: {Trauma: Life in the ER}
Thu Oct 09 23:55:00 localtime 2003 : Next Scheduled Start Time: Fri Oct 10 00:30:00 localtime 2003
Thu Oct 09 23:55:00 localtime 2003 : Can't add padding
Thu Oct 09 23:55:00 localtime 2003 : Sleep until Fri Oct 10 00:55:00 localtime 2003
Any idea why? It's several hours before it starts adding padding and behaving as expected.
I've attached the logfile.
pahunt
10-10-2003, 01:15 PM
I've just installed 1.01 but when I run
/var/hack/endpad.tcl 5
I get the following error
wrong # args: should be "while test command"
while compiling
"while {$wait} { ..."
("while" body line 118)
while compiling
"while {$test} { ..."
(file "/var/hack/endpad.tcl" line 99)
sanderton
10-10-2003, 06:20 PM
Looks like the file got corrupted there Paul, try uploading it to the TiVo again.
sanderton
10-10-2003, 06:28 PM
Originally posted by Fozzie
Have just checked my log and there seems to be a few instances for the first few hours or so of starting endpad, where padding wasn't added but I can't see why:
e.g.
Thu Oct 09 23:55:00 localtime 2003 : Recording in progress
Thu Oct 09 23:55:00 localtime 2003 : Channel: UKST1
Thu Oct 09 23:55:00 localtime 2003 : Programme: {Garden Rivals}
Thu Oct 09 23:55:00 localtime 2003 : Scheduled End Time: Thu Oct 09 23:59:58 localtime 2003
Thu Oct 09 23:55:00 localtime 2003 : Next Channel: DISC1
Thu Oct 09 23:55:00 localtime 2003 : Next Programme: {Trauma: Life in the ER}
Thu Oct 09 23:55:00 localtime 2003 : Next Scheduled Start Time: Fri Oct 10 00:30:00 localtime 2003
Thu Oct 09 23:55:00 localtime 2003 : Can't add padding
Thu Oct 09 23:55:00 localtime 2003 : Sleep until Fri Oct 10 00:55:00 localtime 2003
Any idea why? It's several hours before it starts adding padding and behaving as expected.
I've attached the logfile.
Could that programme already have hard padding on it?. It's the only thing I can think of as the releavny if statement is:
if {($newstoptime < $nextstart || $nselectiontype == 6) && $padding > $existingpadding}
and the log has printed the values of newstoptime and nextstart so the first bit is definitely TRUE; the only possibility is that the other part ($padding > $existingpadding) was FALSE.
pahunt
10-11-2003, 03:07 AM
Originally posted by sanderton
Looks like the file got corrupted there Paul, try uploading it to the TiVo again.
That did the trick. Thanks very much
sanderton
10-11-2003, 04:22 AM
Has anyone got any stability issues with their TiVos running EndPad?
pahunt
10-11-2003, 05:15 AM
Originally posted by sanderton
Has anyone got any stability issues with their TiVos running EndPad?
Not on mine. I had version 1 running for about 24 hours without a hitch and there must have been about a dozen recordings done during that time as well. I've only had 1.01 installed for a couple of hours now but no problems so far.
Originally posted by sanderton
I'm aiming to make it so that it simply doesn't need to know about what is soft and what is hard. (Insert own Carry On joke here..)
Nice module Stuart! ;) :D
Maybe you could code the original padding into the recalculated figure. Looks like there are 8 possible values for padding: 1, 2, 5, 15, 30, 60, 90 and 180 minutes (unless you're MrTickle and have hacked the database ;) ). They're stored in the database in seconds, so you've got all the values inbetween that will never be used by the UI. You could add the index into that array to the padding value so you could decode which one was originally used. e.g. to encode:
set ui_padding_values { 0, 60, 120, 300, 900, 1800, 3600, 5400, 10800 }
set padding_in_db [defaultval 0 [dbobj $rec get EndPadding]]
set new_padding [lsearch -exact $ui_padding_values $padding_in_db]
if { $new_padding > -1 } {
incr new_padding $default_soft_padding_value
} else {
puts "Hello MrTickle!"
}
To decode:
set flag [expr $current_padding_from_db % 10]
set original_padding [lindex $ui_padding_values $flag]
pahunt
10-11-2003, 06:37 AM
Just spotted one thing that might be a problem but it might just be how it's supposed to work.
I had a suggestion that was scheduled from 10:20am to 10:50am this morning and then Friends started recording at 10.55am. I have got it set to use 5 minutes of soft padding but none was used on the suggestion. As it actually had exactly 5 minutes inbetween recordings I would have expected it to pad it.
Fozzie
10-11-2003, 10:26 AM
Originally posted by sanderton
Could that programme already have hard padding on it?
I thought that and checked but it doesn't!?! In fact, none of my SPs do because I removed it all when I used softpad. I'll keep a check on the logs and see if it happens again.
I did have another question about something that happened last night though. A suggestion (I think) was scheduled to start straight after an explicit recording. From your answer earlier in this thread, a suggestion will get cancelled in order to soft pad a regular recording. That appears to have happened below:
Sat Oct 11 04:54:01 localtime 2003 : Waiting a minute before checking for kill
Sat Oct 11 04:55:00 localtime 2003 : Recording in progressSat Oct 11 04:55:00 localtime 2003 : Channel: ITV2
Sat Oct 11 04:55:00 localtime 2003 : Programme: Rugby
Sat Oct 11 04:55:00 localtime 2003 : Scheduled End Time: Sat Oct 11 04:59:58 localtime 2003
Sat Oct 11 04:55:00 localtime 2003 : Next Channel: DISCOV
Sat Oct 11 04:55:00 localtime 2003 : Next Programme: {Cleopatra's Palace: In Search of a Legend}
Sat Oct 11 04:55:00 localtime 2003 : Next Scheduled Start Time: Sat Oct 11 05:00:00 localtime 2003
Sat Oct 11 04:55:00 localtime 2003 : Added 5 minutes padding
Sat Oct 11 04:55:00 localtime 2003 : Sleep until Sat Oct 11 05:55:00 localtime 2003
Sat Oct 11 04:55:00 localtime 2003 : Waiting a minute before checking for kill
Sat Oct 11 05:54:00 localtime 2003 : Waiting a minute before checking for kill
Sat Oct 11 05:55:00 localtime 2003 : No recording in progress
Sat Oct 11 05:55:00 localtime 2003 : Next recording starts: Sat Oct 11 06:00:00 localtime 2003
Sat Oct 11 05:55:00 localtime 2003 : Next Channel: UKBRID
Sat Oct 11 05:55:00 localtime 2003 : Next Programme: {Garden ER}
Sat Oct 11 05:55:00 localtime 2003 : Next Scheduled Start Time: Sat Oct 11 06:00:00 localtime 2003
Sat Oct 11 05:55:00 localtime 2003 : Sleep until Sat Oct 11 06:25:00 localtime 2003
Sat Oct 11 05:55:00 localtime 2003 : Waiting a minute before checking for kill
Once the padding was added it then says 'Sleep until Sat Oct 11 05:55:00' which is presumeably when the now cancelled suggestion {Cleopatra's Palace: In Search of a Legend} was due to finish. What happens if as a result of the suggestion being cancelled, a recording is scheduled for the now empty slot 05:05:00 to 06:00:00? Will Endpad pick it up or does it do nothing until the end of the sleep period? If not, what about when there is say 6 hours between recordings - will Endpad sleep until the end of the recording that starts in 6 hours time and/or will it still pick up recordings subsequently scheduled?
Many thanks. Oh yeah, it has been stable so far - a day and half :)
Well, cancelling a suggestion should only enable TiVo to record replacement suggestions.
For your other question, from the source it looks like it sleeps until the next time it thinks it's needed. You are right, there should be a cap on the amount of time endpad sleeps between checks so that it can detect changes to the To Do list, in particular from cancelling the current recording and choosing to record something else.
sanderton
10-11-2003, 02:38 PM
Originally posted by Fozzie
Once the padding was added it then says 'Sleep until Sat Oct 11 05:55:00' which is presumeably when the now cancelled suggestion {Cleopatra's Palace: In Search of a Legend} was due to finish. What happens if as a result of the suggestion being cancelled, a recording is scheduled for the now empty slot 05:05:00 to 06:00:00? Will Endpad pick it up or does it do nothing until the end of the sleep period? If not, what about when there is say 6 hours between recordings - will Endpad sleep until the end of the recording that starts in 6 hours time and/or will it still pick up recordings subsequently scheduled?
Many thanks. Oh yeah, it has been stable so far - a day and half :)
What will happen in this case it that it will wake up 5 mins before the now cancelled suggestion was due to finish. If another suggestion has taken its place, it will pad that. If not, back to sleep it goes until the next recording.
It does not poll for a recording when running, it relies on the TDL. I'm trying to keep the overhead for running the script to the minimum.
BTW, the reason I haven't posted a version wth Dibblah and ccwf's amendments in yet is that I've decided the next version will have start padding, and my blasted social life is interfering with my TiVo hacking!
A start padding enabled version is running now on my TiVos, and I will post when I think it probably works. :)
sanderton
10-11-2003, 02:44 PM
Originally posted by ccwf
You are right, there should be a cap on the amount of time endpad sleeps between checks so that it can detect changes to the To Do list, in particular from cancelling the current recording and choosing to record something else.
3 hours?
Originally posted by sanderton
I'm trying to keep the overhead for running the script to the minimum. Which is certainly a good thing.
If you keep in memory the ID of the last show that's been padded, then you should be able to check very quickly whether or not the that recording is still current, in which case it can skip the rest of the logic and just go back to sleep.
As for the cap on the sleep interval, I would suggest a half hour to an hour. Or just make it another command line option or argument.
Fozzie
10-11-2003, 03:46 PM
Originally posted by sanderton
It does not poll for a recording when running, it relies on the TDL. I'm trying to keep the overhead for running the script to the minimum.
Thanks sanderton, I think I have it - endpad bases it's time to wake up on the TDL as it stands at the point 5 mins before the end of the current recording. If the TDL changes between that point and when it has decided to wake up, those new programmes will not get padded. I guess the TDL could change for a couple reasons:
a. The next recording (a suggestion) gets cancelled because endpad has just padded the current recording. This could cause a different suggestion to be recorded. This would only get padded if it happened to end at or after the cancelled recording. If it ended before that, it would get missed by endpad. I don't see this as a drama because it's 'only' a suggestion. (Initially, I thought it might be but having typed through the logic I don't think it is!).
b. If there was a large time gap between the current recording and the next scheduled one, there is more potential for either a user initiated recording to be scheduled or perhaps as a result of new guide data being loaded. This seems to be where there is most potential for endpad to accidentally miss something.
I've no idea what the performance overhead would be and whether it's feasible, but would have thought 1/2 hour for checking the TDL would capture most changes, if not all.
Keep up the excellent work. endpad has already saved me an ending :)
Chris T
10-11-2003, 05:35 PM
Just found that Endpad fell over at 7.55pm, 55 minuets into recording an hour-long suggestion, and exactly 2 hours after it had been last started.
The error was:
syntax error in expression "1065898798 + * 60"
while executing
"expr "$endtime + $padding * 60""
(file "/var/hack/endpad.tcl" line 158)
Line 158: set newstoptime [expr "$endtime + $padding * 60"]
sanderton
10-11-2003, 05:44 PM
Thanks Chris, by co-incidence I just fixed that bug!
I hope to post the new version tomorrow.
There is definitely a problem when there is a gap between programs, it just happened to me....
Prog 1 records at 1pm next sceduled prog is for 11pm
after prog 1 is recorded next pad check is sceduled for within the program at 11pm and sleeps (checking kill file) until the 11pm program.
If you then request a recording at 8pm this program does not have any padding added.
When in sleep mode (checking for kill) it needs to recheck to see if there is an earlier program sceduled. every 5 mins ? dont know...
Great Utility... Hope this helps.
Mas
sanderton
10-11-2003, 06:05 PM
Originally posted by ccwf
If you keep in memory the ID of the last show that's been padded, then you should be able to check very quickly whether or not the that recording is still current, in which case it can skip the rest of the logic and just go back to sleep.
It's not quite that simple, as it is possible for endpad to wake up up to three times during a single recording, and it will have logic to process each time.
But every 30 mins doesn't seem a huge overhead, I'll set it to that.
Originally posted by sanderton
It's not quite that simple, as it is possible for endpad to wake up up to three times during a single recording, and it will have logic to process each time. Are you saying that the recording database ID check wouldn't work (does the ID change?), or is the overhead for just waking up and checking the current recording's ID still significant?
sanderton
10-11-2003, 06:39 PM
Originally posted by ccwf
Are you saying that the recording database ID check wouldn't work (does the ID change?), or is the overhead for just waking up and checking the current recording's ID still significant?
There are circumstances (esp. now I'm adding start padding) when endpad can wake up more than once during a recording and do different things each time, so a simple "x is still recording so go straight back to sleep" won't work. Nor can I assume that all the retrieved data stays the same (eg, someone is recording the grand prix, discovers there's been a restart so comes in and adds 30 mins end padding. If endpad just assumed everything was the same as the first time it checked the db, that padding would get wiped 5 mins from the end!)
However the overhead for a 30 minute check is so low that it will be fine. My first draft has the script not look ahead and just check every minute, but I was nervous about that, especially as I already run one (LJ's red dot) which does pretty much the same thing..
bobnick
10-11-2003, 08:03 PM
Originally posted by sanderton
Has anyone got any stability issues with their TiVos running EndPad?
The Binary transfer worked a treat, and I've finally found out to track down and kill the FTP process on Tivo, so I don't need to restart the unit when FTP hangs! However.... Endpad crashed on me this evening. It's also a bugger to restart, as you have to delete the PID file (which said 1793).
The error code was
error writing "file1": I/O error
while executing
"puts "retrying after $errorCode ...""
(procedure "RetryTransaction" line 12)
invoked from within
"RetryTransaction {
set currec [mfs scan "/Recording/Active" -start "3:" -count 1]
}"
(file "./end.tcl" line 128)
Was this down to the fact I'd renamed the tcl file? (I'd had to use http_get to get the binary to my Tivo as FTP crashed after the ascii transfer)
The error log:
Sat Oct 11 16:36:00 localtime 2003 : Next Channel: ITV1LON
Sat Oct 11 16:36:00 localtime 2003 : Next Programme: {Pop Idol}
Sat Oct 11 16:36:00 localtime 2003 : Next Scheduled Start Time: Sat Oct 11 18:05:00 localtime 2003
Sat Oct 11 16:36:00 localtime 2003 : Added 3 minutes padding
Sat Oct 11 16:36:00 localtime 2003 : Sleep until Sat Oct 11 19:00:00 localtime 2003
-NB Isn't this GMT rather than localtime?
Then...
Sat Oct 11 16:36:00 localtime 2003 : Waiting a minute before checking for kill
repeated every minute until
Sat Oct 11 18:59:01 localtime 2003 : Waiting a minute before checking for kill
I'd cancelled the pending Pop Idol recording @ 6.03pm to record WWI on Channel 4, by pressing record on live TV and going to options and chosing record new portion (high quality)
And as for waking endpad up every 30 minutes, might it be an idea to wake it every 29 minutes, so the overhead is spread throughout the hour, just in case it regularly clashes with other things?
Fozzie
10-11-2003, 09:06 PM
Ok, there's something really strange going on here.
If I start endpad from rc.sysinit.author then TiVo tries to dial up to get its' guide data instead of using Turbonet. Take the endpad entry out, reboot and it's back to using the ethernet port. Put endpad back in, reboot and it tries to dial again!
My rc.sysinit.author:
#!/bin/bash
/var/hack/tivoweb-tcl/tivoweb
/var/hack/endpad.tcl 5 -auto
TivoWeb runs fine with or without the endpad entry. Confused :confused:
(As an aside, what does -auto switch do?)
Auto tries to kill an existing endpad.tcl process (if it exists) and then waits two minutes for boot-up to complete.
sanderton
10-12-2003, 07:39 AM
Originally posted by bobnick
Endpad crashed on me this evening. It's also a bugger to restart, as you have to delete the PID file (which said 1793).
The error code was
[PHP]error writing "file1": I/O error
while executing
"puts "retrying after $errorCode ...""
That is an error generated by a TiVo internal routine not my code, so I have to say I'm not quite sure what's happening there. Normally that routine's messages (it was just trying to say the database was locked and would retry in a moment) just get sent to the console so disappear into the ether for a bacgrounded app with no console. However it seems to be trying to write them to "file1". I have no idea at all what that means. Anyone?
sanderton
10-12-2003, 12:22 PM
Originally posted by Fozzie
Ok, there's something really strange going on here.
If I start endpad from rc.sysinit.author then TiVo tries to dial up to get its' guide data instead of using Turbonet. Take the endpad entry out, reboot and it's back to using the ethernet port. Put endpad back in, reboot and it tries to dial again!
My rc.sysinit.author:
#!/bin/bash
/var/hack/tivoweb-tcl/tivoweb
/var/hack/endpad.tcl 5 -auto
TivoWeb runs fine with or without the endpad entry. Confused :confused:
(As an aside, what does -auto switch do?)
Sorry, had to think about that for a minute!
My mistake. The line should be:
/var/hack/endpad.tcl 5 -auto >> /dev/null &
I had thought rc.sysinit.author ran last of all on startup, but rc.net runs after it. endpad had a two minute pause in it, which it seems is long enough to bggr up the code in rc.net which configures TiVo to use the internet for guide data.
Apologies.
Fozzie
10-12-2003, 01:00 PM
Cheers Stuart. That's fixed it. I thought I was going mad :)
Lysander
10-12-2003, 02:01 PM
Stuart,
Great little app, well done. ;)
James
sanderton
10-12-2003, 02:07 PM
Originally posted by bobnick
It's also a bugger to restart, as you have to delete the PID file (which said 1793).
Dibblah has kindly given me a bit of code which will deal with that in the next version.
In case you overlooked it, I also posted a one-line bash script up above which should immediately relaunch endpad.tcl if it ever exits abnormally (based on script exit value), ignoring the presence or absence of the PID file. With that script, the PID file is used only to cause a normal exit.
The one-liner could be put into a separate launcher script to make it more convenient to run from the command-line or integrated into endpad.tcl itself.
dd400005
10-12-2003, 04:26 PM
Fascinated by this thread. I can't wait to see how it ends up.
Will I be able to run it, when it's finished, on my unhacked UK TiVo running 2.5.5? I have a serial cable but haven't done anything with it yet. I assume the only issue is whether you can get one of those bash prompts (whatever they are :))
sanderton
10-12-2003, 04:30 PM
Originally posted by ccwf
In case you overlooked it, I also posted a one-line bash script up above which should immediately relaunch endpad.tcl if it ever exits abnormally (based on script exit value), ignoring the presence or absence of the PID file. With that script, the PID file is used only to cause a normal exit.
The one-liner could be put into a separate launcher script to make it more convenient to run from the command-line or integrated into endpad.tcl itself.
Yes I saw it. Many thanks for your suggestions. I hope to get it stable enough not to need it, but we'll see! :)
sanderton
10-12-2003, 04:36 PM
Originally posted by dd400005
Fascinated by this thread. I can't wait to see how it ends up.
Will I be able to run it, when it's finished, on my unhacked UK TiVo running 2.5.5? I have a serial cable but haven't done anything with it yet. I assume the only issue is whether you can get one of those bash prompts (whatever they are :))
It will run fine via the serial cable, but you will need to get your hard disk out and into a PC to set up the ability to access the legendary bash prompt.
sanderton
10-12-2003, 07:28 PM
Originally posted by bobnick
The error code was
[PHP]error writing "file1": I/O error
while executing
"puts "retrying after $errorCode ...""
OK, I think I've figured this one out, and the fix will be in the next version.
Which is coming along, but putting start padding into the equations adds a lot of complications - once it's negotiated a day full of CBeebies tomorrow I'll be much happier that it works OK.
dd400005
10-13-2003, 03:05 AM
quote:
--------------------------------------------------------------------------------
Originally posted by sanderton
It will run fine via the serial cable, but you will need to get your hard disk out and into a PC to set up the ability to access the legendary bash prompt.
--------------------------------------------------------------------------------
Great. I expect that's a one-time only occurrence to install/enable the bash prompt and copy your script over. Then I'll be able to get a bash prompt and start your script via a terminal emulator window over the serial cable.
Fozzie
10-13-2003, 03:50 AM
Stuart,
As mentioned in a previous post, any chance you could put endpad's log in/var/log as it would be really useful to be able to view it from TivoWeb. That way, I can remotely see what it's doing and, if necessary, reschedule any recordings.
Ta.
sanderton
10-13-2003, 04:42 AM
That's in the new version.
sanderton
10-13-2003, 04:43 AM
Originally posted by dd400005
quote:
--------------------------------------------------------------------------------
Originally posted by sanderton
It will run fine via the serial cable, but you will need to get your hard disk out and into a PC to set up the ability to access the legendary bash prompt.
--------------------------------------------------------------------------------
Great. I expect that's a one-time only occurrence to install/enable the bash prompt and copy your script over. Then I'll be able to get a bash prompt and start your script via a terminal emulator window over the serial cable.
Well it'll be by a telnet session over a serial PPP link, but yes.
tivo_boj
10-13-2003, 01:04 PM
Stuart,
just to let you know I have been running Endpad for over 24hours with no issues. Seems to be padding when it should, and not when it shouldn't. Saved me missing an ending already.
One question - is there a limit on the size of the log files as it is getting bigger by the minute. Do we need to manually delete this if it gets too big?
Other than this - this is the biggest step forward (especially when you put start padding in) since the last officail upgrade to 2.5.5 ( you know the one that did not give us soft padding!)
Keep up the very good work
Lysander
10-13-2003, 01:22 PM
No problems here either, saved missing the end of Silent Witness which in turn saved my life. My wife thinks you are lovely...:D :D :D :D
sanderton
10-13-2003, 02:22 PM
I have updated the first post with version 1.2.
Main changes:
- All posted bugs fixed (I hope)
- Start padding added
- Logs now viewable with the TiVoWeb logs module
- Handles restarts better (thanks Dibblah)
- Will add the max possible padding if it can't add the full amount
- Checks every 30 mins for new recordings being added to the TDL
- Code revamped and tidied
Cheers to all above, esp. Dibblah and ccwf for assistance and suggestions.
Post your new bugs below.... :)
sanderton
10-13-2003, 02:28 PM
Originally posted by tivo_boj
One question - is there a limit on the size of the log files as it is getting bigger by the minute. Do we need to manually delete this if it gets too big?
I've made them less verbose, and while I'm not sure how big the /var partition is, if you fill it then your TiVo is just far too stable!
Fozzie
10-13-2003, 02:39 PM
Originally posted by sanderton
I have updated the first post with version 1.2.
Very nice work Stuart. :cool:
Downloaded, installed and never worry about missed beginnings and ends again............hopefully ;)
Small request - any chance of having the times in the log as local time?
Stuart, since I haven't looked through the code, yet, and for the benefit of the non-programmers, perhaps you could explain what you chose to do when soft start-padding conflicts with soft end-padding? Do you just split the difference, or what?
Originally posted by Fozzie
Small request - any chance of having the times in the log as local time? This is actually harder to do right than you might think—TiVo Web doesn't handle it 100% correctly, for example. It would also make the timestamps for this hack different from all the other timestamps TiVo logs.
It would be nice, though, to add the ability to TiVo Web to view log files with times converted into local time.
Fozzie
10-13-2003, 03:03 PM
Originally posted by ccwf
This is actually harder to do right than you might think........
I thought it might be, otherwise he'd have done it right? :)
Looking at the new blurb in the first post, Stuart says that end padding has priority over start padding so I'm guessing that potential start padding will not prevent the full end padding from being added.
Stuart - another quickie. The log now has the padding added in seconds. Just wondering why it has changed from being in minutes before? Is it because end padding can now be automatically scaled down from the max, in seconds?
sanderton
10-13-2003, 03:18 PM
Local time is hard work, and anyway local time will be GMT in a few days, at least over here. :)
TiVo does everything in seconds, even dates (v. big numbers!). Sometimes I convert back to minutes, sometimes life is just too short...
End padding takes priority, which just reflects the way I prefer to work. In practice, unless you set very large amounts of padding, it's rare to have an overlap. In fact I had to run endpad with 15 mins start and 15 mins end to force some to test the code!
tivo_boj
10-13-2003, 03:22 PM
Originally posted by sanderton
I've made them less verbose, and while I'm not sure how big the /var partition is, if you fill it then your TiVo is just far too stable!
yes , much better, but if I do delete the log file (now in Var/Logs)will endpad start a new one ( just in case I ever need to).
I also take it that end padding takes preference to start padding in that it checks for a to see if a start of a programme clashes with required end padding and if not adds the pad. It then checks the start of the next programme 1 minute plus the start pad setting time before the start of that programme. If that now clashes with the programme plus end pad ( ie the total record time), it does not pad the start.
is this correct, if so might be worth adding such an explaination to the first post.
Thanks ....1.2 now loaded and awaiting my first start and end pads!!!!
sanderton
10-13-2003, 03:30 PM
I'd stop endpad first, then delete the log. Don't know how happy it will be to have a file it open deleted while it is using it! It starts a new one each time you run it.
If there is a 5 minute gap between programmes and you have start padding for 5 mins and end padding of 5 mins, you will get 5 mins of end padding and 0 mins of start padding.
If there is a 5 min gap and you set 4 mins of end padding and 4 mins of start padding you will get 4 mins of end paddinga nd 1 min of start padding.
I hope....
Fozzie
10-13-2003, 03:34 PM
Originally posted by sanderton
Local time is hard work, and anyway local time will be GMT in a few days, at least over here. :)
Good point :)
TiVo does everything in seconds, even dates (v. big numbers!). Sometimes I convert back to minutes, sometimes life is just too short...
Understood.
End padding takes priority, which just reflects the way I prefer to work.
That approach suits me too.
Oh yeah, first successful end pad and a start pad. Great stuff. :cool:
Originally posted by sanderton
I'd stop endpad first, then delete the log. Don't know how happy it will be to have a file it open deleted while it is using it! In Linux/Unix systems, deleting an in-use file deletes it from the directory it is in but not from the disk. Files are not really deleted until all references to them are removed; so as long as endpad keeps a reference to it (even via redirection, but not always with network mounts if you install a network filesystem on your TiVo), it will remain even though invisible when trying to list files using ls.
This behavior is very different from the DOS/Windows way of doing things.
tivo_boj
10-13-2003, 03:45 PM
Originally posted by sanderton
If there is a 5 minute gap between programmes and you have start padding for 5 mins and end padding of 5 mins, you will get 5 mins of end padding and 0 mins of start padding.
If there is a 5 min gap and you set 4 mins of end padding and 4 mins of start padding you will get 4 mins of end paddinga nd 1 min of start padding.
I hope....
Thats better than I expected, I think I will now increase the start pad, I did have 1 minute start, 4 minute end , think will move both to 4 minutes.
sanderton
10-13-2003, 03:52 PM
Originally posted by ccwf
In Linux/Unix systems, deleting an in-use file deletes it from the directory it is in but not from the disk. Files are not really deleted until all references to them are removed; so as long as endpad keeps a reference to it (even via redirection, but not always with network mounts if you install a network filesystem on your TiVo), it will remain even though invisible when trying to list files using ls.
This behavior is very different from the DOS/Windows way of doing things.
You learn something every day. :)
Originally posted by sanderton
End padding takes priority, which just reflects the way I prefer to work. In practice, unless you set very large amounts of padding, it's rare to have an overlap. In fact I had to run endpad with 15 mins start and 15 mins end to force some to test the code! I'm happy with that for now, too. (Even though mentioned splitting the difference above as an example, I actually don't think that would be a good idea.)
However, as a future enhancement, it might be nice to give priority to a half minute or less of start padding in case of a conflict because, at least in the U.S., there are a number of programmes that do start a few seconds early (needing just a tiny amount of start padding and not even a full minute).
As you wrote, the start/end-padding conflict situation shouldn't come up that often for most people, so this is just something to think about for the future.
Dapper Dan
10-13-2003, 04:05 PM
Originally posted by sanderton
...I had thought rc.sysinit.author ran last of all on startup, but rc.net runs after it. endpad had a two minute pause in it, which it seems is long enough to bggr up the code in rc.net which configures TiVo to use the internet for guide data.
Apologies.
Is there any reason why you shouldn't change your rc.sysinit file so that the rc.sysinit.author line is at the very end ?
Originally posted by ccwf
[low-level stuff about how deletion works] The effect of in this situation is that it doesn't matter if you delete the file first and then stop endpad.tcl or vice versa.
Actually, since endpad.tcl is logging in append mode, I would just truncate the log file and leave endpad.tcl running instead of deleting the log file and stopping endpad.tcl. (You truncate by overwriting with a zero-length file. /dev/null is typically used for this purpose.)
sanderton
10-13-2003, 04:11 PM
Why whenever you decide something is ready, does a really obvious bug crop up 2 mins later?
Version 1.2.1 is now on the front page.
Fozzie
10-13-2003, 04:18 PM
Originally posted by sanderton
Why whenever you decide something is ready, does a really obvious bug crop up 2 mins later?
Doh! Which was?
The setting of nextrec still needs to loop until a non-suggestion is found. I know this scenario is unlikely (e.g., unwisely large end padding setting with a film short or “Making Of …” show as a suggestion), but I think it's important to fix because it can actually result in endpad.tcl cancelling a real recording.
sanderton
10-13-2003, 04:31 PM
Originally posted by Fozzie
Doh! Which was?
TiVo doesn't store the end time of a recording, so you have to calculate it from various other settings, and there was one particular circumstance where I got the sum wrong, which meant that the start padding could back into the programme being recorded, making it the second recording fail.
I just watched it happen, and the mistake was so obvious I don't know how it sat there all this time.
Such is life.
sanderton
10-13-2003, 04:34 PM
Originally posted by ccwf
The setting of nextrec still needs to loop until a non-suggestion is found. I know this scenario is unlikely (e.g., unwisely large end padding setting with a film short or “Making Of …” show as a suggestion), but I think it's important to fix because it can actually result in endpad.tcl cancelling a real recording.
It's still on my things to do list (as is a whole bunch of other stuff) but it's so unlikely to happen in practice (you would have to have so much end padding set that it would be longer than the entire suggestion) and the code is made quite a lot more complex by it, that I decided to leave it until this version is completely stable and bug free before changing it.
I don't envisage people typically having more than 5 mins soft end padding set ( my settings are 1 min start and 2 mins end) - if I'm misjudging that perhaps people could set me straight?
Fozzie
10-13-2003, 04:47 PM
I use 1 min start and 4 mins end.
Sticking with your opening post about 'in for a penny, in for a pound' how about a Tivo Web module to remotely stop it and remotely start it; with configurable paramaters of course ;)
(I'm just flapping about my one month trip away to SA at Xmas, checking endpad's log and finding it had stopped and then having no way of re-starting it!)
sanderton
10-13-2003, 04:50 PM
ccwf posted a command that will automatically restart endpad should it crash earlier in the thread.
alunj
10-13-2003, 05:06 PM
1 min start 5 end here . So far so good!
It also got the end of silent witness so my SO is happy too!
dosnt like being killed tho, whish I had readthe file and discovered the
-stop option !! :-0
Originally posted by sanderton
It's still on my things to do list (as is a whole bunch of other stuff) but it's so unlikely to happen in practice (you would have to have so much end padding set that it would be longer than the entire suggestion) This is true, but it's worth at least a warning in the first post to tell people not to use very large values for the padding.
I'll post some sample code for the logic in a few minutes, but it could be way off since I'm not as familiar with the idiosyncrasies of the database.
Adder
10-13-2003, 05:24 PM
Originally posted by sanderton
It's still on my things to do list (as is a whole bunch of other stuff) but it's so unlikely to happen in practice (you would have to have so much end padding set that it would be longer than the entire suggestion) and the code is made quite a lot more complex by it, that I decided to leave it until this version is completely stable and bug free before changing it.
I don't envisage people typically having more than 5 mins soft end padding set ( my settings are 1 min start and 2 mins end) - if I'm misjudging that perhaps people could set me straight?
How about having 15 minutes of end padding say on a program that finishes at 7pm
A suggestion that is 5 mins long at 7.05pm and a real program at 7.10pm for an hour?
You would lose the 7.10pm program would you not?
Also would end padding on a suggestion override start padding on a real recording?
Questions, questions... :)
Here's some untested modified code that also tries to find the next non-suggestion: RetryTransaction {
set currec [mfs scan "/Recording/Active" -start "3:" -count 1]
set nextrec [mfs scan "/Recording/Active" -start "4:" -count 1]
set realrec 4
while { 1 } {
set nextrealrec [mfs scan "/Recording/Active" -start "${realrec}:" -count 1]
scan [lindex [lindex $nextrealrec 0] 1] "%d:%d:%d:%d"\
nextrealrectype nextrealrecstartdate\
nextrealrecstarttime nextrealrecfsid
if {[dbobj [db $db openid $nextrealrecfsid] get SelectionType] != 6} {
break
}
incr realrec
}
}The padding calculations would be switched to using the nextrealrec-based variables. The wake-up calculation would continue to use the nextrec-based variables.
Easier said than done, of course, and certainly less important than stability as stated above. :)
sanderton
10-13-2003, 05:41 PM
And you'd lose the padding of suggestions, which is an often requested feature.
I'll have more of a think about it.
sanderton
10-13-2003, 05:43 PM
Originally posted by alunj
1 min start 5 end here . So far so good!
It also got the end of silent witness so my SO is happy too!
dosnt like being killed tho, whish I had readthe file and discovered the
-stop option !! :-0
No, its a tivosh process and they get very upset when you kill them. Nice animation though isn't it? :)
Originally posted by sanderton
And you'd lose the padding of suggestions, which is an often requested feature.
I'll have more of a think about it. It shouldn't lose padding for suggestions, but you should indeed think about it before implementing.
cinnamon_oil
10-13-2003, 07:20 PM
Just tried 1.2 out - wowsa! It works! Found one little bug though; although it should (if I read the blurb right) allow values of 30 seconds and 90 seconds (i.e. endpad 0.5 1.5) it doesn't work; it appears to silently die if I try those values. According to the log it goes through one cycle and then dies before it starts the "polling every minute" bit.
Still haven't quite worked out what happens under certain circumstances though! Am I right in thinking that, with start and end padding, it would be
scheduled:suggestion -> suggestion gets dropped
scheduled:scheduled -> no padding, change on time
suggestion:scheduled -> suggestion gets dropped
If so, would it be possible to have a couple of options to set the behaviour in those circumstances? An option for suggestions, do that instead of dropping the suggestions the start time is pushed forward or the end time is pushed back (--preserve-suggestions?), and an option for scheduled so that the channel change time is pushed forward (--always-pad?). Personally I think the latter isn't a good choice, but I know some people have asked for it.
Actually, a third option just came to mind; if a scheduled recording follows a scheduled one then the padding is applied to the one that has priority in the SP list? With those options I reckon everyone can have the options that suit them.
Anyway - it works pretty darn good already in my opinion! Kudos all round!
Another option with the logfile could be to rotate it to 'Oendpad.log' once a day like the other logs. Something along these lines would rotate on the first run after midnight each day. It keeps the current log file if endpad is restarted:
### Add this definition
set Ologfile "/var/log/Oendpad.log"
### Change the "Open logfile" section to:
set logdate [clock format [file mtime "$logfile"] -format "%j"]
set logchan [open $logfile "a"]
puts $logchan "[clock format [clock seconds] -format $datestamp] : endpad.tcl log file, starting up"
### Add this to the main loop
if {$logdate != [clock format [clock seconds] -format "%j"] } {
flush $logchan
close $logchan
catch {file copy -force $logfile $Ologfile}
set logchan [open $logfile "a"]
puts $logchan "[clock format [clock seconds] -format $datestamp] : endpad.tcl log file, log rotated"
set logdate [clock format [clock seconds] -format "%j"]
}
sanderton
10-14-2003, 04:59 AM
Originally posted by cinnamon_oil
Am I right in thinking that, with start and end padding, it would be
scheduled:suggestion -> suggestion gets dropped
scheduled:scheduled -> no padding, change on time
suggestion:scheduled -> suggestion gets dropped
Yes that's what it's supposed to do, but I need to tidy up the code which handles dealing with adjacent suggestions - you can't schedule suggestions so the testing has been quite limited so far, and I want to add more code to make absolutely certain it is doing what I want.
Originally posted by cinnamon_oil
If so, would it be possible to have a couple of options to set the behaviour in those circumstances? An option for suggestions, do that instead of dropping the suggestions the start time is pushed forward or the end time is pushed back (--preserve-suggestions?), and an option for scheduled so that the channel change time is pushed forward (--always-pad?). Personally I think the latter isn't a good choice, but I know some people have asked for it.
Actually, a third option just came to mind; if a scheduled recording follows a scheduled one then the padding is applied to the one that has priority in the SP list? With those options I reckon everyone can have the options that suit them.
Options to force negative start padding to guarantee end padding (which is what I think you mean) are on the drawing board.
sanderton
10-14-2003, 05:01 AM
Originally posted by LJ
Another option with the logfile could be to rotate it to 'Oendpad.log' once a day like the other logs. Something along these lines would rotate on the first run after midnight each day.
Ta, I'll add that in.
Edwards_sj
10-14-2003, 06:57 AM
Jut trying out version 1.2.1 and I saw this in the log...
Tuesday 09:57:00 : Woken up
Tuesday 09:57:00 : Recording {Come Outside} on CBEEB now
Tuesday 09:57:00 : Recording Scheduled End Time: 09:59
Tuesday 09:57:00 : Next recording is Angel on SKYONE at 10:00
Tuesday 09:57:00 : Next end padding setting due 10:55
Tuesday 09:57:00 : Added 120 seconds start padding to Angel
Tuesday 09:57:00 : Next start padding setting due 10:55
Tuesday 09:57:00 : Next wake up will be 10:27
Both were suggestions.
It seems to have added 2 minutes to the beginning of Angel even though there wasn't room... the result was that angel didn't record...
Endpad was running with 2 minutes start and end padding.
Is this right?
Cheers
Steve
sanderton
10-14-2003, 07:05 AM
No, it's not. I realised this morning that the code for adjacent suggestions needs changing as TiVo's default behaviour when there's a clash is the opposite way round to what I thought it was.
I will tidy it up and post a fix tonight.
Edwards_sj
10-14-2003, 07:24 AM
Originally posted by sanderton
No, it's not. I realised this morning that the code for adjacent suggestions...
If it's just a problem with suggestions then I'll leave it running for now...
I will tidy it up and post a fix tonight.
Thanks for that...
Cheers
Steve
sanderton
10-14-2003, 07:36 AM
It might cancel a real recording if there is an suggestion immediately prior to it. Enc. is the fixed code, but I'm not near a TiVo at the moment so I can't test it. I'll post a tested version in the first post later.
Edit: first post now updated
pwarnes
10-14-2003, 08:39 AM
Hi,
This sounds really cool. I haven't been allowed to open the box yet, or make the serial connection, but I suspect that this will get me permission from SWMBO :-)
I have read and reread the whole thread ( I think).
Could someone summarise for me exactly what this does, as it seems that people have been suggesting changes and they have been put in along the way.
Isn't documentation a drag :-)
Edwards_sj
10-14-2003, 08:51 AM
Originally posted by sanderton
It might cancel a real recording if there is an suggestion immediately prior to it. Enc. is the fixed code, but I'm not near a TiVo at the moment so I can't test it. I'll post a tested version in the first post later.
Well I would install it but I've managed to crash my Tivo telnet session, I'll need to reboot the Tivo when I get home :(
Cheers
Steve
sanderton
10-14-2003, 09:10 AM
Originally posted by pwarnes
Hi,
This sounds really cool. I haven't been allowed to open the box yet, or make the serial connection, but I suspect that this will get me permission from SWMBO :-)
I have read and reread the whole thread ( I think).
Could someone summarise for me exactly what this does, as it seems that people have been suggesting changes and they have been put in along the way.
Isn't documentation a drag :-)
The first post is kept up to date with the latest version (and instructions).
sanderton
10-14-2003, 09:13 AM
Originally posted by Edwards_sj
Well I would install it but I've managed to crash my Tivo telnet session, I'll need to reboot the Tivo when I get home :(
Cheers
Steve
Perhaps I should explain, I don't think there's a problem (except with two back to back suggestions), but it did occur to me that I'm assuming that when my code generates a clash between a suggestion and a scheduled recording that the scheduled recording will win, just like it would if you did it by hand. However I hadn't actually tried it to see as my machine has very few Suggestions scheduled as it's full. The amended code just forces the deletion to make double sure.
sanderton
10-14-2003, 03:49 PM
1.2.2 is now in the first post. Fixed a couple of potential bugs, and made the timing elements more robust.
I've taken a saftety first approach and if a suggestion is followed immediately by a scheduled recording I've not added start padding. This is until I can confirm that it is the suggestion that gets deleted, not the scheduled recording in those circumstances. Suggestions that follow a scheduled recording and clash with the padding are now expressly deleted instead of relying on the clash to do it.
Fozzie
10-14-2003, 04:27 PM
Thanks Stuart.
One thing I'm not sure on. I remember you saying that end padding has priority over start padding. Is this regardless of whether the current recording is a suggestion or not? In other words if there is a suggestion followed by a scheduled (with say a 5 minute gap in between) and padding was set for 5 & 5. Would the suggestion get the end padding?
(I was thinking in the car on the way home, about how most of the the questions are about suggestions. I think I watch about 1 per week - I wouldn't mind betting this is the same for a lot of other people. If the programme was that important, then I'd set up an explicit recording! So to put things into perspective (for me anyway) this really is ultra-fine tuning.)
tivo_boj
10-14-2003, 04:32 PM
I agree that a sceduled recording should take preference over any suggestion so I am glad stuart has put "safety first". I too would specifically record a programme if I really wanted it not rely on suggestion to record it.
cinnamon_oil
10-14-2003, 04:52 PM
Originally posted by sanderton
Suggestions that follow a scheduled recording and clash with the padding are now expressly deleted instead of relying on the clash to do it.
Cool... installing 1.2.2 now. Any thoughts as to if the alternative I suggested might be possible as an option? (That is, instead of deleting the suggestion instead the start time of the suggestion is changed to avoid the clash?)
And yes, I know that if the program is important I should record it, but I only regard a few programs as important and quite like flicking through the suggestions of an evening. ;-)
Originally posted by cinnamon_oil
Any thoughts as to if the alternative I suggested might be possible as an option? (That is, instead of deleting the suggestion instead the start time of the suggestion is changed to avoid the clash?) As mentioned above, once Stuart implements negative padding, that should do most of what you want, especially if there were indepedent padding settings for suggestions and normal recordings (which actually isn't that hard to add for positive padding, but I don't know how negative padding will complicate things).
cinnamon_oil
10-14-2003, 05:00 PM
endpad.tcl 0.5 1.5 still isn't working for me in 1.2.2 - I am right in thinking that should work, amn't I?
(I'm easily confused!)
cinnamon_oil
10-14-2003, 05:04 PM
Originally posted by ccwf
As mentioned above, once Stuart implements negative padding, that should do most of what you want, especially if there were indepedent padding settings for suggestions and normal recordings (which actually isn't that hard to add for positive padding, but I don't know how negative padding will complicate things).
I have to admit... I never actually quote got my noggin around what "negative padding" meant in this context, so I sort of glossed over that part in my head and thought about fluffy bunnies instead...
Someone want to take a shot at explaining? ;-)
Normal padding makes programmes start recording earlier and stop recording later. Negative padding does the reverse.
cinnamon_oil
10-14-2003, 05:19 PM
Originally posted by ccwf
Normal padding makes programmes start recording earlier and stop recording later. Negative padding does the reverse.
That much I'd figured... but I wasn't quite sure how that would be used to implement what I'd suggested (moving suggestion start times if the padding on the scheduled program in front would otherwise result in the suggestion being deleted). Although having seperate start and end padding for scheduled and suggestions would sort of do that (2 mins end padding for scheduled, -2 start padding for suggestions) it would result in suggestions always having 2 minutes less, even if there's no reason for the start time to alter. I think what I'm suggesting is different, and perhaps more useful?
Or am I missing a fundamental point... as per normal!
Fozzie
10-14-2003, 05:23 PM
Originally posted by cinnamon_oil
And yes, I know that if the program is important I should record it, but I only regard a few programs as important and quite like flicking through the suggestions of an evening. ;-)
But if endpad cancelled the recording of a suggestion because of a (potential) clash with the end padding of a scheduled recording, you'd be none the wiser because you probably didn't know that it was going to be recorded in the first place :)
It's not like a whole bucket load of suggestions is going to get cancelled because of end padding of a scheduled recording - I would expect the odd one or two perhaps, per day. I was surprised when I looked in my recording history earlier, to see dozens of things not recorded today for various reasons - endpad cancelled suggestions would be a drop in the ocean comparatively speaking :)
My preference is for any padding for scheduled recordings to have priority over any padding for suggestions (in fact, priority over suggestions full stop) and, end padding to have priority over start padding. This may be where we are, or not - Stuart? All I know is that I've got the ends of some progs that I would have missed without endpad (and a smattering of start padding thrown in for good measure) :)
I don't know if I would have a use for different settings for suggestions & scheduled?
Originally posted by cinnamon_oil
[Negative padding] would result in suggestions always having 2 minutes less, even if there's no reason for the start time to alter. Well, if the negative padding were “hard” (meaning, it's always applied, like TiVo's normal padding), this would indeed be the case. Soft negative padding, on the other hand, would be applied only if necessary.
Fozzie
10-14-2003, 05:39 PM
Originally posted by ccwf
Soft negative padding, on the other hand, would be applied only if necessary.
hehe, which is the opposite of soft positive padding which is always applied in full, if it can be!
cinnamon_oil
10-14-2003, 05:53 PM
Originally posted by ccwf
Well, if the negative padding were “hard” (meaning, it's always applied, like TiVo's normal padding), this would indeed be the case. Soft negative padding, on the other hand, would be applied only if necessary.
Oh, now I get it... it's not so much padding, it's more a case of (if it was start padding of "-2") "allow this programme to start up to two minutes late if needed to prevent a clash"
Having said that - basically, that's what I was suggesting, isn't it? ;-)
sanderton
10-14-2003, 06:02 PM
As things stand in 1.2.2, a suggestion could get end padded stopping a real recording getting start padded. That will change once I am sure I know how to kill an in-progress suggestion. (TiVoWeb doesn't do that so there's no code I can pinch. :))
I just got to the page in my Idiots Guide to TCL on data types in TCL, so I now understand the problem with 0.5 and I can fix it.
bobnick
10-14-2003, 06:18 PM
Might it be possible to set postive and negative padding when running the program, so shows can be shortend or lengthened as appropriate?
Fozzie
10-14-2003, 06:25 PM
Originally posted by bobnick
Might it be possible to set postive and negative padding when running the program, so shows can be shortend or lengthened as appropriate?
Hard positive end padding can be adjusted during recording from the main TiVo interface so perhaps it could be done from endpad?
tivo_boj
10-14-2003, 06:30 PM
Think I may have found a problem
Recorded Crouches (see below)
Tuesday 21:32:01 : Next start padding setting due 22:00
Tuesday 21:32:01 : Next wake up will be 22:00
Sleeping, checking every minute for kill signal.............................
Tuesday 22:00:00 : Woken up
Tuesday 22:00:00 : Recording Crouches on BBC1SE now
Tuesday 22:00:00 : Recording Scheduled End Time: 22:05
Tuesday 22:00:00 : Next recording is {The Farewell} on BBC4 at 23:10
Tuesday 22:00:00 : Added 240 seconds end padding to Crouches
Tuesday 22:00:00 : Next end padding setting due 00:35
Tuesday 22:00:00 : Not time to add start padding yet
Tuesday 22:00:00 : Next start padding setting due 23:07
Tuesday 22:00:00 : Next wake up will be 22:30
Sleeping, checking every minute for kill signal.......................
Then after "men behaving badly"(which followed direcly) had been on for 10 mins pressed the record bustton and chose "record at best".
Now find no sign of Crouches on Now playing, in recording history or in deleted programmes. What happened to it it seems to ahve vanished, but as the log shows above it was recording.
However this looks as if the crouches it was a suggestion....so is the reason?
sanderton
10-14-2003, 06:49 PM
Suggestions are delicate things. You will find the To Do list stuffed with them, but most fall over at the slightest provocation and never even start recording. Cancel one mid recording and it vanishes. This is probably - and I'm guessing mind you - to do with the way the 240 seconds padding on the the suggestion meant it overlapped with MBB. As Suggestions never have padding, the TiVo code probably just sees that as a clash with a user scheduled recording and kills the suggestion, even though its finished.
You might find a trace of it by using TiVowWeb too look in MFS in the Recording/Active directory. Have a look through the last few entries which start with "1".
sanderton
10-14-2003, 06:54 PM
Originally posted by bobnick
Might it be possible to set postive and negative padding when running the program, so shows can be shortend or lengthened as appropriate?
Can't see why you would choose to have blanket negative pad? What I do intent to implement is a switch to force the inclusion of the end padding in all circumstances, starting any subsequent programme late if need be.
Blanket negative start padding probably works right now, but I haven't tried it.
bobnick
10-14-2003, 07:04 PM
I was concentrating on the *soft* element of negative padding; if only one show was going to be recorded, it'd be nice to have it start a minute early. If two programmes were on, overlapping by 5 minutes, it'd be nice to have the first one recorded in its entirety, and have the second programme recorded too (apart from the first overlapped 5 minutes)
Fozzie
10-14-2003, 08:08 PM
Originally posted by bobnick
If two programmes were on, overlapping by 5 minutes, it'd be nice to have the first one recorded in its entirety, and have the second programme recorded too (apart from the first overlapped 5 minutes)
Would this even be possible? One of the two shows (the lowest priority) will not even be in the TDL (because of the overlap) so endpad would not know of it's existence?
Won't negative soft padding add an unecessary level of complexity? How do you decide whether to pad the end of the current recording & start late the next recording or pad the end of the current recording and don't record the next recording or even partially pad the end of the current recording and start the next recording on time? Beyond me. (Aren't positive and negative soft padding mutually exclusive and so you would have to decide on a global basis whether you want programmes to be possibly started early or, possibly started late? I know which one I'd go for).
Sanity check - isn't the purpose of endpad to, where possible, start recordings early and delay the ends of recordings to ensure that beginnings and endings are not missed. If you then start using negative padding you could end up with a whole load of recordings that either miss the beginning or miss the end and so we're back to where we started?!?!
Ok, so I'm unconvinced about the benefits of globally set, automatic, negative, soft padding :confused:
Fozzie
10-14-2003, 08:27 PM
Originally posted by sanderton
This is probably - and I'm guessing mind you - to do with the way the 240 seconds padding on the the suggestion meant it overlapped with MBB. As Suggestions never have padding, the TiVo code probably just sees that as a clash with a user scheduled recording and kills the suggestion, even though its finished.
Or it possibly got trashed at the time of pressing the record button. There would have been 4 minutes of MBB as part of the previous suggestion but also still in the Live Buffer. Perhaps pressing record claimed back that 4 minutes since it was part of MBB, causing the suggestion to be trashed?
tivo_boj - did the MBB recording that you manually instigate start at the beginning of the programme or 4 minutes into it?
dd400005
10-15-2003, 01:43 AM
Aren't we getting a little over-complicated now?
In my opinion, the amount of end or start padding defined should be a maximum, rather than a fixed amount. If you specify 5 mins of soft end-padding, then the script should try and add as much as possible without interrupting the next scheduled program (SP or Suggestion). Maybe it's only 1 minute, maybe 4 minutes. If there's no clashes then the full 5 minutes.
I maybe oversimplifying things, and having never written a TCL script or even hacked my TiVo that's certainly possible, but don't we just want something as simple as this below?
1. Wakeup 5 mins before end of program. I don't know how you do that, but clearly you already are.
2. Add as much soft padding as possible (up to selected amount) so long as it doesn't affect the next scheduled SP or Suggestion.
3. Determine next scheduled recording and set a wakeup time of a few minutes before that, or every half hour.
4. At wakeup time, if not currently recording, and a recording is due to start shortly, add as much soft start-padding as possible (up to selected amount). If no recording scheduled, set wake up in half an hour again.
I think the regular half hourly wake-ups would catch things being added to the to do list that you might normally miss because 5 mins before the end of the previous program you specified the wakeup time 5 mins before the start of the next program. By specifying the wakeup time for start padding checking as either 5 mins before the next prog, or every half hour (whichever is nearer) then you would manage to soft-start-pad new items added to the list.
Waking up x mins before a scheduled start gives you time to add the soft start padding if not currently recording. If that prevents the user from being able to record a current show, or recording that show would cause a clash because the next one is scheduled to start y mins early, tough! TiVo will let you know about it. Likewise, if adding the soft end padding prevents the user from adding another show at the end interactively, or hitting record to the current show while in the end padding, tough!
I think the smallish problems you'd encounter by keeping the script simpler would be trivial. The simpler it is, the easier it is to understand the logic of how it's thinking. If you can summarize it in just a few lines of pseudo code, then the TiVo user will know exactly what it will do in the current circumstances just by looking at their todo list. There'll be no mystery, and that's worth a lot. Wondering what it might do because it's a complex beast isn't good IMHO.
I personally would specify 2 mins of soft start padding and 5 mins of soft end padding. I'd be happily looking in my To Do list and know "I'll get both there, I'll get only end there, I'll get only start there" etc etc.
Fozzie
10-15-2003, 03:01 AM
Originally posted by dd400005
In my opinion, the amount of end or start padding defined should be a maximum, rather than a fixed amount. If you specify 5 mins of soft end-padding, then the script should try and add as much as possible without interrupting the next scheduled program (SP or Suggestion). Maybe it's only 1 minute, maybe 4 minutes. If there's no clashes then the full 5 minutes.
I maybe oversimplifying things, and having never written a TCL script or even hacked my TiVo that's certainly possible, but don't we just want something as simple as this below?
1. Wakeup 5 mins before end of program. I don't know how you do that, but clearly you already are.
2. Add as much soft padding as possible (up to selected amount) so long as it doesn't affect the next scheduled SP or Suggestion.
3. Determine next scheduled recording and set a wakeup time of a few minutes before that, or every half hour.
4. At wakeup time, if not currently recording, and a recording is due to start shortly, add as much soft start-padding as possible (up to selected amount). If no recording scheduled, set wake up in half an hour again.
That is basically what we current have. TiVo wakes up just before the max endpadding time of the current recording and will add (up to) the max end padding it can, without causing a clash with the next scheduled recording. It then look sat the next recording and is set to wake up just before the max start padding interval. It will then add (up to) the max start padding without causing a clash with the current recording. It then goes to sleep until either a - just before the max start padding time of the next recording or b - 30 minutes, whichever is the earlier.
I'm with you on not overcomplicating things. For me, things seem to be pretty much working perfectly. There's some very minor tweaking to be done with the handling off suggestions but the app's philosophy is spot on. 1 - add as much end padding as possible. 2 - add as much start padding as possible.
Things will get unweildy as soon as you start going down the line of " if...then....but not if.....however.....then...... but only if.......unless......." etc.
I want to guarantee the ends of recordings and if possible start a bit early - that's all. (You've heard of the KISS philosphy? Keep It Simple, Stupid!)
All IMHO of course.
pahunt
10-15-2003, 03:41 AM
I installed 1.2.2 last night and I think I may have a problem.
I recorded Life of Grime and it quite correctly put 5 minutes of extra padding on the end. However when it got to the end of the 2nd Father Ted on E4 it put 10 minutes on the end. I haven't recorded anything else since so I don't know if this was a one off and I won't be able to check anymore until I get home this evening but I thought I'd raise the question anyway.
Originally posted by sanderton
1.2.2 is now in the first post. Fixed a couple of potential bugs, and made the timing elements more robust.
I've taken a saftety first approach and if a suggestion is followed immediately by a scheduled recording I've not added start padding. This is until I can confirm that it is the suggestion that gets deleted, not the scheduled recording in those circumstances.
If it helps, I can confirm that with 1.2.1, the scheduled recording can get deleted, since it happened to me last night.
Tivo suggestion "The Others" on Ch5 immediately followed by "Ever wondered about food" on BBC2.
Endpad set to start=2, end=4.
"The others" was correctly recorded with 2 mintes start pad, no end pad.
"Ever wondered about food" not recorded - endpad log shows that it tried to add 2 minutes start padding to this as well.
I can send/post logs if that will be helpful?
Many thanks for your work on this - it's already nearly a great utility, and I'm sure it soon will be!
Roj
Fozzie
10-15-2003, 05:49 AM
Originally posted by sanderton
I've taken a saftety first approach and if a suggestion is followed immediately by a scheduled recording I've not added start padding.
Not that you need the confirmation (because you wrote the code!), this is what happens. This occured last night and I have both the suggestion & scheduled recording in my TDL, with no padding applied.
sanderton
10-15-2003, 05:59 AM
Originally posted by bobnick
I was concentrating on the *soft* element of negative padding; if only one show was going to be recorded, it'd be nice to have it start a minute early. If two programmes were on, overlapping by 5 minutes, it'd be nice to have the first one recorded in its entirety, and have the second programme recorded too (apart from the first overlapped 5 minutes)
Yes, that's exactly what I'm planning as an option.
Fozzie
10-15-2003, 06:00 AM
Originally posted by cinnamon_oil
Actually, a third option just came to mind; if a scheduled recording follows a scheduled one then the padding is applied to the one that has priority in the SP list? With those options I reckon everyone can have the options that suit them.
I wouldn't use that option. If there was a choice between adding end padding to the current recording or adding start padding to the next (higher) priority recording, I'd still prefer to get the end padding - as I believe currently happens i.e end padding has priority of start padding.
sanderton
10-15-2003, 06:09 AM
Originally posted by pahunt
I installed 1.2.2 last night and I think I may have a problem.
I recorded Life of Grime and it quite correctly put 5 minutes of extra padding on the end. However when it got to the end of the 2nd Father Ted on E4 it put 10 minutes on the end. I haven't recorded anything else since so I don't know if this was a one off and I won't be able to check anymore until I get home this evening but I thought I'd raise the question anyway.
Thanks; could you post the relevant clip of log file? I can't immediately see how that could happen.
sanderton
10-15-2003, 06:11 AM
Originally posted by Fozzie
I wouldn't use that option. If there was a choice between adding end padding to the current recording or adding start padding to the next (higher) priority recording, I'd still prefer to get the end padding - as I believe currently happens i.e end padding has priority of start padding.
I'd rather no got down that route as it's adding loads of database accesses to look up the SPs. Less is more when it comes to stability. :)
sanderton
10-15-2003, 06:17 AM
Originally posted by dd400005
Aren't we getting a little over-complicated now?
In my opinion, the amount of end or start padding defined should be a maximum, rather than a fixed amount. If you specify 5 mins of soft end-padding, then the script should try and add as much as possible without interrupting the next scheduled program (SP or Suggestion). Maybe it's only 1 minute, maybe 4 minutes. If there's no clashes then the full 5 minutes.
I maybe oversimplifying things, and having never written a TCL script or even hacked my TiVo that's certainly possible, but don't we just want something as simple as this below?
1. Wakeup 5 mins before end of program. I don't know how you do that, but clearly you already are.
2. Add as much soft padding as possible (up to selected amount) so long as it doesn't affect the next scheduled SP or Suggestion.
3. Determine next scheduled recording and set a wakeup time of a few minutes before that, or every half hour.
4. At wakeup time, if not currently recording, and a recording is due to start shortly, add as much soft start-padding as possible (up to selected amount). If no recording scheduled, set wake up in half an hour again.
I think the regular half hourly wake-ups would catch things being added to the to do list that you might normally miss because 5 mins before the end of the previous program you specified the wakeup time 5 mins before the start of the next program. By specifying the wakeup time for start padding checking as either 5 mins before the next prog, or every half hour (whichever is nearer) then you would manage to soft-start-pad new items added to the list.
Waking up x mins before a scheduled start gives you time to add the soft start padding if not currently recording. If that prevents the user from being able to record a current show, or recording that show would cause a clash because the next one is scheduled to start y mins early, tough! TiVo will let you know about it. Likewise, if adding the soft end padding prevents the user from adding another show at the end interactively, or hitting record to the current show while in the end padding, tough!
I think the smallish problems you'd encounter by keeping the script simpler would be trivial. The simpler it is, the easier it is to understand the logic of how it's thinking. If you can summarize it in just a few lines of pseudo code, then the TiVo user will know exactly what it will do in the current circumstances just by looking at their todo list. There'll be no mystery, and that's worth a lot. Wondering what it might do because it's a complex beast isn't good IMHO.
I personally would specify 2 mins of soft start padding and 5 mins of soft end padding. I'd be happily looking in my To Do list and know "I'll get both there, I'll get only end there, I'll get only start there" etc etc.
You just described precisely what EndPad does and how it works (except I prefer for padding to take priority over suggestions). I may steal this post for the ReadMe. :)
sanderton
10-15-2003, 06:19 AM
Originally posted by Roj
If it helps, I can confirm that with 1.2.1, the scheduled recording can get deleted, since it happened to me last night.
Bggr. Sorry about that. 1.2.2 fixes the problem.
sanderton
10-15-2003, 07:06 AM
Version 1.2.3 now in the first post:
- fractions now really do work (ie, use 0.5 to give 30 seconds padding)
- log file handling improved, thanks to LJ
- the potential bug with very long end padding cancelling the next-but-one show if the next show was a suggestion fixed
Dibblah
10-15-2003, 07:23 AM
Originally posted by pahunt
I installed 1.2.2 last night and I think I may have a problem.
I recorded Life of Grime and it quite correctly put 5 minutes of extra padding on the end. However when it got to the end of the 2nd Father Ted on E4 it put 10 minutes on the end. I haven't recorded anything else since so I don't know if this was a one off and I won't be able to check anymore until I get home this evening but I thought I'd raise the question anyway.
Is it possible that the season pass has padding? Soft padding will add to this, up to the amount you specified.
Cheers,
Allan.
Crispin
10-15-2003, 08:03 AM
I have just installed 1.2.3, and it seems like it won't run unless you first create the /var/log/endpad.log file:
A stale PID file was found and has been deleted.
This means that this script terminated unexpectedly last time. Loading now.
The errors logged (if any) before the last termination were:
couldn't stat "/var/log/endpad.log": no such file or directory
while executing
"file mtime "$logfile""
(file "/var/hack/bin/endpad.tcl" line 229)
Once I create the file, it starts up fine :)
sanderton
10-15-2003, 08:11 AM
Thanks!
Fixed in 1.2.4, now in first post.
pahunt
10-15-2003, 08:32 AM
Originally posted by Dibblah
Is it possible that the season pass has padding? Soft padding will add to this, up to the amount you specified.
Cheers,
Allan.
No I definitely haven't got any padding on the Father Ted season pass because there were 2 episodes shown back to back and I got both of them. If there had been any hard padding I wouldn't have got the 2nd one at all.
pahunt
10-15-2003, 01:30 PM
Originally posted by pahunt
No I definitely haven't got any padding on the Father Ted season pass because there were 2 episodes shown back to back and I got both of them. If there had been any hard padding I wouldn't have got the 2nd one at all.
Well all my recordings today have worked perfectly so I've put last night's "problem" down as a one-off. I just installed 1.2.4 so I'll see what happens :)
sanderton
10-15-2003, 01:49 PM
Can you post the relevant bit of the log file (cut and paste from the Logs section of TiVoWeb)? I can't figure out how it could add more padding than you set.
pahunt
10-15-2003, 04:55 PM
Originally posted by sanderton
Can you post the relevant bit of the log file (cut and paste from the Logs section of TiVoWeb)? I can't figure out how it could add more padding than you set.
Sorry but I've rebooted since then (telnet died :() so I can't see the relevant part of the log in Tivoweb.
tivo_boj
10-15-2003, 05:54 PM
Found that endpad had teminated as log was stop mid way. on re-loading endpad got this
bash-2.02# cd /var/hack
bash-2.02# endpad.tcl 1.5 4.5
A stale PID file was found and has been deleted.
This means that this script terminated unexpectedly last time. Loading now.
The errors logged (if any) before the last termination were:
expected integer but got "$nextrecfsid"
while executing
"db $db openid $recfsid"
("uplevel" body line 2)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
set rec [db $db openid $recfsid]
set state [dbobj $rec get State]
if { $state != 6 } {
dbclose $db
return 0
} else {
dbob..."
(procedure "DeleteSuggestion" line 7)
invoked from within
"DeleteSuggestion {$nextrecfsid}"
(file "/var/hack/endpad.tcl" line 372)
bash-2.02# endpad.tcl 1.5 4.5
EndPad is already running
bash-2.02#
Any reason for this?
Dibblah
10-15-2003, 06:10 PM
It looks like the suggestion died because someone looked at it funny, before endpad could do it.
Cheers,
Allan.
Dibblah
10-15-2003, 06:11 PM
NSecondsWatched is an entry on each recording, which gets set when you pause it. How about setting it to either a variable amount, or the unpadded start of the recording?
Just an idea,
Allan.
leejordan
10-16-2003, 02:46 AM
Hi,
I'm running endpad 1.2.4 and it failed with this message last night..
A stale PID file was found and has been deleted.
This means that this script terminated unexpectedly last time. Loading now.
The errors logged (if any) before the last termination were:
syntax error in expression "-auto * 60"
while executing
"expr $endpadding * 60"
(file "/var/hack/endpad.tcl" line 362)
syntax error in expression "-auto * 60"
while executing
"expr $endpadding * 60"
(file "/var/hack/endpad.tcl" line 362)
Hope this is of some help.
Lee.
Chris T
10-16-2003, 03:55 AM
The latest version also failed on me last night, with the error:
expected integer but got "$nextrecfsid"
while executing
"db $db openid $recfsid"
("uplevel" body line 2)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
set rec [db $db openid $recfsid]
set state [dbobj $rec get State]
if { $state != 6 } {
dbclose $db
return 0
} else {
dbob..."
(procedure "DeleteSuggestion" line 7)
invoked from within
"DeleteSuggestion {$nextrecfsid}"
(file "/var/hack/endpad.tcl" line 372)
Tivo was recording back to back suggestions at the time.
sunscreem
10-16-2003, 04:10 AM
Just a quick one...
I installed the latest version 1.2.4 (?) (for the first time last night).
It works a treat - but it did appear to stop running about 3 hours after it was installed (my friends did the same too).
I just started it again and it appears to be fine now.
Rob
Fozzie
10-16-2003, 04:13 AM
Stuart, could you explain how the log switching works.
I've got endpad.log which runs from when I started endpad going up to now and Oendpad.log which starts from when I started endpad going up to 00:28 last night.
I was expecting that when Oendpad.log was created, endpad.log would be cleared and then start from that time?
Thanks.
Edit: endpad's been running solid since 1900 yesterday :)
sanderton
10-16-2003, 04:23 AM
Errors, lovely errors.
There are so many nested "if"s in the code to catch all the possibilities that I can never be sure each line has been run until its been out in the field for a bit.
The two "expected integer but got "$nextrecfsid"" are because of a typo in the the code; I used the wrong kind of brackets in a command. Look for 1.2.5 in a couple of minutes.
The "syntax error in expression "-auto * 60"" error is because the order the arguments appear is imprortant, it needs to be:
/var/hack/endpad.tcl s e -auto >> dev/null &
and it looks like you have entered:
/var/hack/endpad.tcl -auto s e >> dev/null &
The logfile problem is also fixed in 1.2.5.
Stuart,
Just wondered if you've already thought about whether there will be any impact on endpad from the clocks changing between GMT/BST.
The logs seem to be in GMT anyway, so perhaps there is none?
Probably worth thinking about this before the next change, since you don't get many opportunities for testing!
Roj
sanderton
10-16-2003, 06:30 AM
EndPad uses TiVos own internal clock system, which AFAIK doesn't "do" BST etc at all. The times are converted to local time by TiVo before being displayed. Even US Tivos run on GMT! Because I only use the internal clock, there should be no issue.
iankb
10-16-2003, 06:41 AM
Originally posted by sanderton
Even US Tivos run on GMT!
I'm sure they really run on UTC. :p
Ian.
sanderton
10-16-2003, 07:01 AM
That's just so they don't feel too colonial. :)
burriko
10-16-2003, 08:18 AM
I just thought i'd chip in to say that i've been running endpad 1.01 for almost a week now, and haven't had a single problem. It hasn't crashed once and it's added the correct padding to every programme that it could.
From reading this thread it seems that versions since then having been causing problems. It's great that new features are still being worked on, but if people just want a stable version to use until the newer, more advanced features are fully tested, then i recommend giving 1.01 a go.
btw, thanks for all the hard work sanderton, it's a truly useful program!
sanderton
10-16-2003, 08:40 AM
Glad its working for you. :)
1.01 actually had a few bugs in it that could cause you to lose recordings, admittedly under fairly unusual circumstances. I think that 1.2.5 should be pretty stable now. If/when I add forced ngatve padding, the stable version will remain available.
But I'm mainly fiddling with a TiVoWeb module to atttempt to resolve conflicts by scheduling them on a second TiVo now!
burriko
10-16-2003, 09:11 AM
Originally posted by sanderton
1.01 actually had a few bugs in it that could cause you to lose recordings, admittedly under fairly unusual circumstances.
I was wondering if i'd just been lucky so far. :)
I think that 1.2.5 should be pretty stable now. If/when I add forced ngatve padding, the stable version will remain available.
cool, i'll give it a try then.
RichyClarke
10-16-2003, 10:52 AM
Sanderton - Have to say this is the second best util around (after TivoWeb of course) .
Set up 1.2.4 last night and had the same probs as others here (fell over after ~3 hours) so checked back here and installed 1.2.5 - no problems since running it this AM with a few test programs.
I felt I had to break my silence (been a lurker for a few months now) to say thanks for this excellent utility.
:) :p :up:
Record clashes on a second tivo
I'd like to see pace get sky+ to do that !
:D
Fozzie
10-16-2003, 11:30 AM
Originally posted by RichyClarke
Set up 1.2.4 last night and had the same probs as others here (fell over after ~3 hours) so checked back here and installed 1.2.5 - no problems since running it this AM with a few test programs.
I thought I'd do a quick check of my 1.2.4 from work and after running fine for ~15 hours, fell over just before lunchtime!
Stuart, Ill post the log when I get home so you can check that it was one of the bugs you've fixed in 1.2.5. It looks like it was recording back to back suggestions.
sanderton
10-16-2003, 11:40 AM
That's where the bug was.
Fozzie
10-16-2003, 02:43 PM
Yep. Same error as Chris T above. All back up and running now with 1.2.5.
(Just noticed a wee typo on the message after stopping endpad. It says to check the log 'withe Tivoweb')
DougF
10-16-2003, 04:02 PM
I've only been a TiVo user for six months and haven't heard the terms "soft-padding" and "hard-padding" before.
If I'm reading correctly, this hack will add x minutes to the end of a schedule recording, but only five minutes before that scheduled recording ends and only if there is no conflict. Example:
Recording scheduled for program guide shows starting at 8:00 PM and ending at 8:30 PM. At 8:25 PM, this hack checks for any recordings starting at 8:30 PM. If there are none, the current recording is extending past 8:30 PM by the number of minutes specified at startup. If another recording is scheduled to start at 8:30 PM, no additional time is added to the 8:00 PM recording.
Is this correct? Sorry for the question, I just want to make sure I know what I'm adding first. If I'm understanding it correctly, it seems like a very cool hack.
Thanks a bunch!
pahunt
10-16-2003, 04:08 PM
Originally posted by Frozen Solid
I've only been a TiVo user for six months and haven't heard the terms "soft-padding" and "hard-padding" before.
If I'm reading correctly, this hack will add x minutes to the end of a schedule recording, but only five minutes before that scheduled recording ends and only if there is no conflict. Example:
Recording scheduled for program guide shows starting at 8:00 PM and ending at 8:30 PM. At 8:25 PM, this hack checks for any recordings starting at 8:30 PM. If there are none, the current recording is extending past 8:30 PM by the number of minutes specified at startup. If another recording is scheduled to start at 8:30 PM, no additional time is added to the 8:00 PM recording.
Is this correct? Sorry for the question, I just want to make sure I know what I'm adding first. If I'm understanding it correctly, it seems like a very cool hack.
Thanks a bunch!
Yes you've got the idea. If you read the first post in this thread it gives you a more detailed explanation of what happens
DougF
10-16-2003, 04:17 PM
Thanks, Paul. I appreciate the response.
Is anything about this specific to UK programming or hardware? I'm in the US with a Series 1 SA with 3.0. Is there any reason I can't use it?
pahunt
10-16-2003, 04:39 PM
I don't know to be honest. AFAIK it's only be tried on UK Tivo's which means 2.5.5 software but somebody else may be able to give you the answer.
sanderton
10-16-2003, 04:44 PM
Originally posted by Frozen Solid
Thanks, Paul. I appreciate the response.
Is anything about this specific to UK programming or hardware? I'm in the US with a Series 1 SA with 3.0. Is there any reason I can't use it?
It should work fine with a US TiVo, I looked through TiVoWeb for the bits of code which vary depending on 2.x or 3.x, and EndPad doesn't touch any of them. I've also left all times and dates in raw TiVo format so nothing uses UK dates or BST. But I'd appreciate it if you could report back if you do have any problems (or indeed if you don't!).
There is possible non-optimal behavior with DirecTiVos because of the dual tuners, but standalone U.S. TiVos that aren't running ancient releases should be fine.
Bakdraft
10-16-2003, 05:42 PM
Hi Stuart,
Could you clarify the Command line arguments s and e. You say:
Run it with:
/var/hack/endpad.tcl s e
where s is the number of minutes padding to be added and e is the number of end minutes
And I understand s, but I am not clear on what e means, which may mean I do not understand s as I thought.
I hope that hasn't confused you :confused:
Thanks
Dave
pahunt
10-16-2003, 05:45 PM
s is the number of minutes that will be added to the beginning of the recording and e is the number that will be added to the end.
Bakdraft
10-16-2003, 06:11 PM
Ta very much Paul.
Thanks Stuart for modifying the narrative
I look forward to tomorrows hacking
Dave
srs5694
10-17-2003, 12:09 AM
I'm running it on a Sony SAT-T60 DirecTiVo running 2.5.2 software in the US, and it works, but not optimally -- the script doesn't know about the dual tuners, and it determines whether or not to pad something based on a search for a potentially-conflicting upcoming show (I've not yet checked the logic for the start padding, but I assume it's similar). The bottom line is that it won't pad some shows that could be padded because the script doesn't realize there's an unused tuner. None of these issues would affect SA TiVos in the US.
FWIW, I hope to look over the code and modify it to work with both single-tuner and dual-tuner TiVos, but I'm busy with other matters right now. With any luck I'll have the free time in a week or so.
RichyClarke
10-17-2003, 05:28 AM
Sanderton - still going on 2.2.5, hasn't missed a beat yet!
Happy bunnies here :D
Thanks again
smokie
10-17-2003, 06:09 AM
Wow, this looks just what I need...all too often we are missing the last few minutes of things.
Now I just need to bone up on hacking...
pahunt
10-17-2003, 08:57 AM
Originally posted by RichyClarke
Sanderton - still going on 2.2.5, hasn't missed a beat yet!
Happy bunnies here :D
Thanks again
Version 2.25 wow! I'm running 1.2.5 and I thought that was good. Imagine the features that you must have ;)
racingclub
10-20-2003, 03:28 AM
nice one - this works great for me :)
tivo_boj
10-20-2003, 03:34 PM
couple of days now with no issues and no missed endings
GREAT PIECE OF WORK
what about being able to stop/start and change settings directly via tivoweb? - Some people are never satisfied
leejordan
10-20-2003, 04:30 PM
I'm not sure if this is just my imagination but it does seem to have happened a couple of times..
Tivo was recording Speed Machines and was scheduled to record Pompeii immediately afterwards.
The Endpad 1.2.5 log said..
Monday 19:53:58 : Woken up
Monday 19:53:58 : Recording {Speed Machines} on C4 now
Monday 19:53:58 : Recording Scheduled End Time: 19:58
Monday 19:53:58 : Next recording is {Pompeii: The Last Day} on BBC1SE at 20:00
Monday 19:53:58 : Added 60 seconds end padding to {Speed Machines}
Monday 19:53:58 : Next end padding setting due 20:55
Monday 19:53:58 : Not time to add start padding yet
Monday 19:53:58 : Next start padding setting due 19:58
Monday 19:53:58 : Next wake up will be 19:58
Sleeping, checking every minute for kill signal......
Monday 19:58:01 : Woken up
Monday 19:58:01 : Recording {Speed Machines} on C4 now
Monday 19:58:01 : Recording Scheduled End Time: 19:59
Monday 19:58:01 : Next recording is {Pompeii: The Last Day} on BBC1SE at 20:00
Monday 19:58:01 : Next end padding setting due 20:55
Monday 19:58:01 : Can't add start padding to {Pompeii: The Last Day}
Monday 19:58:01 : Gap is only 2 seconds
Monday 19:58:01 : Next start padding setting due 20:55
Monday 19:58:01 : Next wake up will be 20:28
Sleeping, checking every minute for kill signal.....................
but it didn't actually start recording Pompeii, I had to start it manually.
Could there be a problem here?
Originally posted by tivo_boj
what about being able to stop/start and change settings directly via tivoweb? For changing the settings, it should be a simple matter for endpad.tcl to read the padding settings each time from a file instead of just getting them from the command line. TiVo Web would then only have to overwrite the file with new settings, which would take effect for the next recording to be padded (they would not affect currently recording, already padded programmes near their ends).
Taking this a step further, a major enhancement I would like to see later is the ability to specify custom soft padding for season passes (and maybe wishlists). This would involve creating a mini season pass->soft padding lookup/database, correlating items in the to do list with their season passes, and TiVo Web code for the front end.
sanderton
10-20-2003, 05:12 PM
Originally posted by leejordan
I'm not sure if this is just my imagination but it does seem to have happened a couple of times..
Tivo was recording Speed Machines and was scheduled to record Pompeii immediately afterwards.
The Endpad 1.2.5 log said..
Monday 19:53:58 : Woken up
Monday 19:53:58 : Recording {Speed Machines} on C4 now
Monday 19:53:58 : Recording Scheduled End Time: 19:58
but it didn't actually start recording Pompeii, I had to start it manually.
Could there be a problem here?
The odd part of the log is that it has the finish time for Speed Machines at 19.58 (the 19.59 after the padding). C4 programmes in the logs on my TiVo always start and end with the round numbers. I just checked the MFS data for Speed Machines and it was due to end at 20:00 TiVo time, not 19:58.
It looks like it's calced the end time wrong and added 60 seconds padding which there wasn't room for.
Are you absolutely sure you're running 1.2.5, as I this used happen on earlier versions but I rewrote the end time calculation to prevent it, and I haven't seen a non-round number end time in my logs since? (The log should announce itself as 1.2.5).
sanderton
10-20-2003, 05:16 PM
Originally posted by ccwf
For changing the settings, it should be a simple matter for endpad.tcl to read the padding settings each time from a file instead of just getting them from the command line. TiVo Web would then only have to overwrite the file with new settings, which would take effect for the next recording to be padded (they would not affect currently recording, already padded programmes near their ends).
Taking this a step further, a major enhancement I would like to see later is the ability to specify custom soft padding for season passes (and maybe wishlists). This would involve creating a mini season pass->soft padding lookup/database, correlating items in the to do list with their season passes, and TiVo Web code for the front end.
I got half way through a TiVoWeb control module, but stopped when my wife threatened me with violence.
A per-SP version would be quite nice, and I can see how to do it. But with the World Cup on at the moment my programming time is strictly limited!
leejordan
10-21-2003, 04:35 AM
Originally posted by sanderton
Are you absolutely sure you're running 1.2.5, as I this used happen on earlier versions but I rewrote the end time calculation to prevent it, and I haven't seen a non-round number end time in my logs since? (The log should announce itself as 1.2.5).
I'll reinstall it tonight just to make sure.
I've noticed non-round end times a few times in the log.
Lee.
RichyClarke
10-21-2003, 02:48 PM
Version 2.2.5 wow! I'm running 1.2.5 and I thought that was good. Imagine the features that you must have.
Haven't you heard - Auto Soft padding on a per season pass basis, padding that takes account of preferences, in-built conflict resolution (dials your mobile and asks you what you want), MP3 playback, records 2 channels at the same time, makes the Tea!!!
Tell you what - don't know how I managed without it!
;)
leejordan
10-21-2003, 03:07 PM
Sanderton, you were right as usual, I was using an old version. I'm definately on 1.2.5 now!
Thanks,
Lee.
sanderton
10-21-2003, 04:02 PM
Phew.
My TiVos have been stable running 1.2.5 for four days continuously so far, so I think I can tentatively say that it is working now...
pahunt
10-21-2003, 04:06 PM
Originally posted by sanderton
Phew.
My TiVos have been stable running 1.2.5 for four days continuously so far, so I think I can tentatively say that it is working now...
Since there hasn't been a significant number postings in this thread for 4 or 5 days I think most people would agree. No news is good news :D
Thanks for your efforts
sanderton
10-21-2003, 04:08 PM
Can I gauge how much interest there is in three possible additional features, so I can decide whether it's worth adding them:
1) A TiVoWeb control panel to turn padding off and on and set the amounts.
2) A TiVoWeb control panel to allow padding settings to be varied either a) per channel or b) per SP/WL
3) Forced end padding, with a following show starting to record a couple of minutes late if need be
Please post your thoughts. Ta.
pahunt
10-21-2003, 04:13 PM
Out of the things you list the only one that I would be interested in is (3) as I can see use for that on my top 5 season passes (but then you would have to be able to do it on a season pass specific basis, I suppose).
I can see some people might want (2) but to be honest I've enough trouble prioritising season passes without having to worry about padding each one as well! Item (1) would be nice but I can certainly live without it
iankb
10-21-2003, 04:14 PM
I'm not using it yet because, until now, I haven't found a real need to install TiVoWeb. However, if I were to install it, I would find (3) the most useful.
Ian.
fireshipjohn
10-21-2003, 04:21 PM
Hi,
I just want to say thanks, its been doing fine service here for a week , and I dont think it needs any more...
It just does what it says on the tin :)
John
Fozzie
10-21-2003, 04:23 PM
Originally posted by iankb
I'm not using it yet because, until now, I haven't found a real need to install TiVoWeb.
Hmmm - but you don't need TiVoWeb installed to use Endpad. Or am I misunderstanding you?
iankb
10-21-2003, 04:27 PM
It would help if I had network access 'though. And if I installed a network interface, I would automatically install TivoWeb. To me, they're the same thing.
Ian.
(2) would be the most useful for me because it would be nice to be able to set a large amount of soft end padding only for sports programmes and some channels are much worse about starting and ending programmes on time than others. (3) is often requested but less pressing for me because semisoft padding can often be used already for this purpose (but not always, and it's cumbersome).
Originally posted by ccwf
it would be nice to be able to set a large amount of soft end padding only for sports programmes This was, in fact, the reason I wanted to be able to have soft padding add onto any hard padding—many live sports events need to be hard padded because they often run long, but soft padding beyond that would be nice to catch some of the cases where an event runs really, really long.
Fozzie
10-21-2003, 04:33 PM
Originally posted by sanderton
1) A TiVoWeb control panel to turn padding off and on and set the amounts.
This would be nice - just to give it a more user friendly front-end and the ability to adjust things remotely.
2) A TiVoWeb control panel to allow padding settings to be varied either a) per channel or b) per SP/WL
Agree with pahunt - a global setting is good enough for me. Deciding priorities for SPs tears me up, let alone stressing about individual padding :) I wouldn't use individual settings.
3) Forced end padding, with a following show starting to record a couple of minutes late if need be
I wouldn't use this either. I use padding to ensure I get the start and ends of recordings. I don't want to start losing the beginnings again because of some random combination of prioritised, negative, positive, soft, hard, season pass, suggestion, user screwed up padding setting :)
I think that you've got the functionality just right as it is.
Finally, just to add my thanks for this superb piece of code.
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.