1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Automatic soft padding running on the TiVo

Discussion in 'TiVo Series 1 - UK' started by sanderton, Oct 8, 2003.

Thread Status:
Not open for further replies.
  1. Oct 9, 2003 #21 of 1197
    burriko

    burriko New Member

    12
    0
    Jun 14, 2002
    from reading through the script it appears to discard suggestions if they get in the way. so option [1].
    i could be wrong though.
     
  2. Oct 9, 2003 #22 of 1197
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    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.
     
  3. Oct 9, 2003 #23 of 1197
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    .

    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
     
  4. Oct 9, 2003 #24 of 1197
    doogie

    doogie New Member

    136
    0
    Apr 5, 2002
    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
     
  5. Oct 9, 2003 #25 of 1197
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    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"
     
  6. Oct 9, 2003 #26 of 1197
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
  7. Oct 9, 2003 #27 of 1197
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    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.
     
  8. Oct 9, 2003 #28 of 1197
    leejordan

    leejordan Member

    132
    0
    Apr 22, 2002
    London, UK
    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
     
  9. Oct 9, 2003 #29 of 1197
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    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.
     
  10. Oct 9, 2003 #30 of 1197
    leejordan

    leejordan Member

    132
    0
    Apr 22, 2002
    London, UK
    Thanks but I still get the same message.

    Lee.
     
  11. Oct 9, 2003 #31 of 1197
    mike0151

    mike0151 A Friend of Dot

    752
    0
    Dec 13, 2001
    Liverpool,...
    depends if /var/hack is in the PATH
    If not, from /var/hack run ./endpad.tcl
    or run /var/hack/endpad.tcl

    HTH
     
  12. Oct 9, 2003 #32 of 1197
    leejordan

    leejordan Member

    132
    0
    Apr 22, 2002
    London, UK
    /var/hack is in my PATH and I get the same result which ever way I run it.

    Told you I was dim :)
     
  13. Oct 9, 2003 #33 of 1197
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    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.
     
  14. Oct 9, 2003 #34 of 1197
    leejordan

    leejordan Member

    132
    0
    Apr 22, 2002
    London, UK
    Thanks Sanderton, that did the trick :D

    I had opened it in Wordpad before I ftp'd it.

    Thanks again!

    Lee.
     
  15. Oct 9, 2003 #35 of 1197
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    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!
     
  16. Oct 9, 2003 #36 of 1197
    Fozzie

    Fozzie New Member

    837
    0
    Sep 3, 2001
    Alton,...
    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.
     
  17. Oct 9, 2003 #37 of 1197
    ccwf

    ccwf 国際化 Member

    8,634
    0
    Dec 29, 2001
    Malibu
    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:
    Code:
    (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?
     
  18. Oct 9, 2003 #38 of 1197
    ccwf

    ccwf 国際化 Member

    8,634
    0
    Dec 29, 2001
    Malibu
    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).
     
  19. Oct 9, 2003 #39 of 1197
    Dibblah

    Dibblah Don't ReMember

    272
    0
    Jun 9, 2002
    Files in transit - Passworded to stop forking :)

    Cheers,

    Allan.
     

    Attached Files:

  20. Oct 9, 2003 #40 of 1197
    ccwf

    ccwf 国際化 Member

    8,634
    0
    Dec 29, 2001
    Malibu
    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.
    Code:
    # Time this recording ends, including hard-padding.
    set endtime [expr "$recstartdate  * 86400  + $recstarttime" + $duration + existingpadding]
    Then, change the block where padding is set to
    Code:
    # 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.
     
Thread Status:
Not open for further replies.

Share This Page