TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Main TiVo Forums > TiVo Series 1 - UK
TiVo Community
Closed Thread
Forum Jump
 
Thread Tools
Old 10-09-2003, 04:09 PM   #31
mike0151
A Friend of Dot
 
Join Date: Dec 2001
Location: Liverpool, Merseyside, UK
Posts: 752
depends if /var/hack is in the PATH
If not, from /var/hack run ./endpad.tcl
or run /var/hack/endpad.tcl

HTH
__________________
6020 since Feb 2001, 1 x 500Gb, Freeview, TurboNet and TiVoWeb
6022 since Feb 2003, 160Gb, Freeview, TurboNet and TiVoWeb;
mike0151 is offline  
Old 10-09-2003, 04:35 PM   #32
leejordan
Registered User
 
Join Date: Apr 2002
Location: London, UK
Posts: 131
Quote:
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
__________________
Model 6023
Single 120Gb disk
NTL:Home
Cachecard
Pace Twin PVR
Panasonic TX-28DT4 IDTV
leejordan is offline  
Old 10-09-2003, 04:56 PM   #33
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
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.
sanderton is offline  
Old 10-09-2003, 05:05 PM   #34
leejordan
Registered User
 
Join Date: Apr 2002
Location: London, UK
Posts: 131
Quote:
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

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

Thanks again!

Lee.
__________________
Model 6023
Single 120Gb disk
NTL:Home
Cachecard
Pace Twin PVR
Panasonic TX-28DT4 IDTV
leejordan is offline  
Old 10-09-2003, 05:29 PM   #35
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
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!
sanderton is offline  
Old 10-09-2003, 06:35 PM   #36
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
Truly great work

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.
Fozzie is offline  
Old 10-09-2003, 09:25 PM   #37
ccwf
国際化 Member
 
ccwf's Avatar
 
Join Date: Dec 2001
Location: Malibu
Posts: 8,634
Quote:
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:
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?
__________________
ccwf

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

TiVo
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

中日韓
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ccwf is offline  
Old 10-09-2003, 09:32 PM   #38
ccwf
国際化 Member
 
ccwf's Avatar
 
Join Date: Dec 2001
Location: Malibu
Posts: 8,634
Quote:
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 longwith only soft padding, no padding might occur, missing the ends of games in order to record another programme).
__________________
ccwf

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

TiVo
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

中日韓
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ccwf is offline  
Old 10-09-2003, 10:31 PM   #39
Dibblah
Don't ReMember
 
Join Date: Jun 2002
Posts: 272
Files in transit - Passworded to stop forking

Cheers,

Allan.
Attached Files
File Type: zip mine.zip (4.5 KB, 41 views)
__________________
6020|40+120Gb|32Mb|Turbonet|Tivoweb
Dibblah is offline  
Old 10-09-2003, 10:38 PM   #40
ccwf
国際化 Member
 
ccwf's Avatar
 
Join Date: Dec 2001
Location: Malibu
Posts: 8,634
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.

__________________
ccwf

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

TiVo
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

中日韓
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by ccwf : 10-09-2003 at 10:48 PM.
ccwf is offline  
Old 10-09-2003, 10:56 PM   #41
ccwf
国際化 Member
 
ccwf's Avatar
 
Join Date: Dec 2001
Location: Malibu
Posts: 8,634
Exclamation

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.
__________________
ccwf

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

TiVo
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

中日韓
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ccwf is offline  
Old 10-10-2003, 04:27 AM   #42
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
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.
sanderton is offline  
Old 10-10-2003, 04:40 AM   #43
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
Quote:
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 longwith 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,

Quote:
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)

Quote:
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.

Last edited by Fozzie : 10-10-2003 at 04:46 AM.
Fozzie is offline  
Old 10-10-2003, 04:46 AM   #44
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
Quote:
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.
sanderton is offline  
Old 10-10-2003, 04:58 AM   #45
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
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.)

Last edited by Fozzie : 10-10-2003 at 05:04 AM.
Fozzie is offline  
Old 10-10-2003, 05:01 AM   #46
ccwf
国際化 Member
 
ccwf's Avatar
 
Join Date: Dec 2001
Location: Malibu
Posts: 8,634
Quote:
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.
__________________
ccwf

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

TiVo
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

中日韓
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ccwf is offline  
Old 10-10-2003, 05:04 AM   #47
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
Quote:
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.

Last edited by sanderton : 10-10-2003 at 05:07 AM.
sanderton is offline  
Old 10-10-2003, 05:14 AM   #48
ccwf
国際化 Member
 
ccwf's Avatar
 
Join Date: Dec 2001
Location: Malibu
Posts: 8,634
Quote:
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.
Quote:
(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.
__________________
ccwf

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

TiVo
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

中日韓
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ccwf is offline  
Old 10-10-2003, 05:28 AM   #49
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
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?
Fozzie is offline  
Old 10-10-2003, 05:32 AM   #50
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
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).
sanderton is offline  
Old 10-10-2003, 05:39 AM   #51
iankb
Registered User
 
iankb's Avatar
 
Join Date: Oct 2000
Location: Reading, UK
Posts: 6,468
Quote:
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.
iankb is offline  
Old 10-10-2003, 05:45 AM   #52
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
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.
Fozzie is offline  
Old 10-10-2003, 05:57 AM   #53
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
Quote:
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!
sanderton is offline  
Old 10-10-2003, 06:08 AM   #54
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
Quote:
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.

Last edited by Fozzie : 10-10-2003 at 06:15 AM.
Fozzie is offline  
Old 10-10-2003, 06:14 AM   #55
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
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!
sanderton is offline  
Old 10-10-2003, 06:21 AM   #56
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
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
Fozzie is offline  
Old 10-10-2003, 06:25 AM   #57
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
Quote:
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.
sanderton is offline  
Old 10-10-2003, 06:32 AM   #58
Fozzie
Registered User
 
Fozzie's Avatar
 
Join Date: Sep 2001
Location: Alton, Hants, UK
Posts: 837
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)?

Last edited by Fozzie : 10-10-2003 at 06:36 AM.
Fozzie is offline  
Old 10-10-2003, 06:46 AM   #59
sanderton
TiVoer since 11/2000
 
Join Date: Jan 2002
Posts: 6,341
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.
sanderton is offline  
Old 10-10-2003, 07:09 AM   #60
bobnick
Registered User
 
Join Date: Jun 2002
Location: London
Posts: 862
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?
bobnick is offline  
Closed Thread
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVo is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 07:24 PM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |