Mailing List Archive

More scheduling scheduler
Hi David Engel and all,

In Australia the commercial channels (all three of them) run their programs
earlier or later than their scheduled times.

What I'd like to do is:
If channel in [7,9,10]:
if time > 23:00:
start-=10
end+=20
else:
start-=5
end+=10
If previousProgram('Rove Live'):
end+=20

I could hard code it in C++ or even imbed Python. But would like it to be
acceptable for SVN inclusion. Any suggestions on how user can specify such
rules would be appreciated. Maybe SQL.

Couldn't I also duplicate the ProgramInfo in AddNewRecords and AddNotListed so
that the program is added with higher recpriority and increased start / end
time, as well as the orignal scheduled times. With the hope that the program
is recorded with the increased times if possible, otherwise normal times.

What a beautiful dream,
Paul
--
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Thu, Apr 06, 2006 at 01:40:30AM +1000, Paul Andreassen wrote:
> What I'd like to do is:
> If channel in [7,9,10]:
> if time > 23:00:
> start-=10
> end+=20
> else:
> start-=5
> end+=10
> If previousProgram('Rove Live'):
> end+=20
>
> I could hard code it in C++ or even imbed Python. But would like it to be
> acceptable for SVN inclusion. Any suggestions on how user can specify such
> rules would be appreciated. Maybe SQL.

The logical way to do it would be to add channel specific start early
and end late settings to the channel table, then pull them in in
AddNewRecords. I suspect such a change would cause ripple effects
elsewhere, though, probably in the ability to change the end time of
an in-progress recording.

Alternatively, search the archives for "soft3.patch". It was an
experimental patch to add soft padding for you Aussies. There was an
initial report that it didn't work as intended so the effort was
abandoned. That report is now suspected to have been bogus. FYI,
that patch will almost certainly not apply cleanly anymore.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Thu, 6 Apr 2006 11:57 am, David Engel wrote:
> On Thu, Apr 06, 2006 at 01:40:30AM +1000, Paul Andreassen wrote:
> > What I'd like to do is:
> > If channel in [7,9,10]:
> > if time > 23:00:
> > start-=10
> > end+=20
> > else:
> > start-=5
> > end+=10
> > If previousProgram('Rove Live'):
> > end+=20
> >
> > I could hard code it in C++ or even imbed Python. But would like it to
> > be acceptable for SVN inclusion. Any suggestions on how user can specify
> > such rules would be appreciated. Maybe SQL.
>
> The logical way to do it would be to add channel specific start early
> and end late settings to the channel table, then pull them in in
> AddNewRecords. I suspect such a change would cause ripple effects
> elsewhere, though, probably in the ability to change the end time of
> an in-progress recording.
>
> Alternatively, search the archives for "soft3.patch". It was an
> experimental patch to add soft padding for you Aussies. There was an
> initial report that it didn't work as intended so the effort was
> abandoned. That report is now suspected to have been bogus. FYI,
> that patch will almost certainly not apply cleanly anymore.

Hi David,

Thanks for the reply.

Found http://www.gossamer-threads.com/lists/mythtv/dev/155137 and I do like to
"soft3.patch".

What if we add RecordPreRoll/RecordOverTime as part of the scheduler. Replace
softstartoffset/softendoffset with RecordPreRoll/RecordOverTime in the patch.
Add a disable soft so Max Barry can see his conflicts. Add a column to
Channels table for enabling RecordPreRoll/RecordOverTime. And add
CategoryOverTime as well to the scheduler.

Will this break other peoples use?

The channels seem to start on time a 6:00am and drift further off time until
resyned at 6:00am. Minor problem that I can look at later.

Thanks again,
Paul
--
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Thu, Apr 06, 2006 at 08:33:54PM +1000, Paul Andreassen wrote:
> What if we add RecordPreRoll/RecordOverTime as part of the scheduler. Replace
> softstartoffset/softendoffset with RecordPreRoll/RecordOverTime in the patch.
> Add a disable soft so Max Barry can see his conflicts. Add a column to
> Channels table for enabling RecordPreRoll/RecordOverTime. And add
> CategoryOverTime as well to the scheduler.

I'm not sure I understand what you're proposing. Actually I am sure I
don't understand. :) Could you please elaborate?

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Fri, 7 Apr 2006 01:15 pm, David Engel wrote:
> On Thu, Apr 06, 2006 at 08:33:54PM +1000, Paul Andreassen wrote:
> > What if we add RecordPreRoll/RecordOverTime as part of the scheduler.
> > Replace softstartoffset/softendoffset with RecordPreRoll/RecordOverTime
> > in the patch. Add a disable soft so Max Barry can see his conflicts. Add
> > a column to Channels table for enabling RecordPreRoll/RecordOverTime.
> > And add CategoryOverTime as well to the scheduler.
>
> I'm not sure I understand what you're proposing. Actually I am sure I
> don't understand. :) Could you please elaborate?

Thats ok. I'll do up a patch and see what you think.

Paul
--
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Fri, 7 Apr 2006 02:57 pm, Paul Andreassen wrote:
> On Fri, 7 Apr 2006 01:15 pm, David Engel wrote:
> > On Thu, Apr 06, 2006 at 08:33:54PM +1000, Paul Andreassen wrote:
> > > What if we add RecordPreRoll/RecordOverTime as part of the scheduler.
> > > Replace softstartoffset/softendoffset with RecordPreRoll/RecordOverTime
> > > in the patch. Add a disable soft so Max Barry can see his conflicts.
> > > Add a column to Channels table for enabling
> > > RecordPreRoll/RecordOverTime. And add CategoryOverTime as well to the
> > > scheduler.
> >
> > I'm not sure I understand what you're proposing. Actually I am sure I
> > don't understand. :) Could you please elaborate?
>
> Thats ok. I'll do up a patch and see what you think.

Patch attached for 0.19-fixes. Very big and untried.

Because the scheduler now understands RecordPreRoll there is no long a need
for use by welcomedialog.*, mainserver.cpp, tv_rec.* and
previewgenerator.cpp.

First time at changing tables and UI,
Paul
--
Re: More scheduling scheduler [ In reply to ]
On Fri, 7 Apr 2006 10:44 pm, Paul Andreassen wrote:
> On Fri, 7 Apr 2006 02:57 pm, Paul Andreassen wrote:
> > On Fri, 7 Apr 2006 01:15 pm, David Engel wrote:
> > > On Thu, Apr 06, 2006 at 08:33:54PM +1000, Paul Andreassen wrote:
> > > > What if we add RecordPreRoll/RecordOverTime as part of the scheduler.
> > > > Replace softstartoffset/softendoffset with
> > > > RecordPreRoll/RecordOverTime in the patch. Add a disable soft so Max
> > > > Barry can see his conflicts. Add a column to Channels table for
> > > > enabling
> > > > RecordPreRoll/RecordOverTime. And add CategoryOverTime as well to the
> > > > scheduler.
> > >
> > > I'm not sure I understand what you're proposing. Actually I am sure I
> > > don't understand. :) Could you please elaborate?
> >
> > Thats ok. I'll do up a patch and see what you think.
>
> Patch attached for 0.19-fixes

Fixes for the previous patch so it compiles.

Paul
--
Re: More scheduling scheduler [ In reply to ]
On Sat, 8 Apr 2006 12:28 am, Paul Andreassen wrote:
> On Fri, 7 Apr 2006 10:44 pm, Paul Andreassen wrote:
> > On Fri, 7 Apr 2006 02:57 pm, Paul Andreassen wrote:
> > > On Fri, 7 Apr 2006 01:15 pm, David Engel wrote:
> > > > On Thu, Apr 06, 2006 at 08:33:54PM +1000, Paul Andreassen wrote:
> > > > > What if we add RecordPreRoll/RecordOverTime as part of the
> > > > > scheduler. Replace softstartoffset/softendoffset with
> > > > > RecordPreRoll/RecordOverTime in the patch. Add a disable soft so
> > > > > Max Barry can see his conflicts. Add a column to Channels table for
> > > > > enabling
> > > > > RecordPreRoll/RecordOverTime. And add CategoryOverTime as well to
> > > > > the scheduler.
> > > >
> > > > I'm not sure I understand what you're proposing. Actually I am sure
> > > > I don't understand. :) Could you please elaborate?
> > >
> > > Thats ok. I'll do up a patch and see what you think.
> >
> > Patch attached for 0.19-fixes
>
> Fixes for the previous patch so it compiles.

Last patch for the night. Seems to work well.

Paul
--
Re: More scheduling scheduler [ In reply to ]
On Sat, Apr 08, 2006 at 04:19:48AM +1000, Paul Andreassen wrote:
> Last patch for the night. Seems to work well.

Here are my initial comments on your patches.

Make your patches against current SVN. This is a new feature and
won't be considered for the 0.19 branch.

Don't change the current pre/postroll code. Some people, including
myself, like it the way it is. If it proves unnecessary, it can be
removed later.

Stick with global, soft start and end settings only for now. If this
feature proves useful, we can canisder per-channel or per-rule
settings later.

Remove the softp->recpriority2 stuff. That was just for proof of
concept. It can be addressed later if needed.

I think your handling of the ChangeRecordingEnd check is incorrect. I
think the best way to handle interaction with that feature is to
remember when soft end padding is added and take that into account
when needed. In addition, any soft end padding becomes hard once the
recording starts and that needs to be accounted for if the user really
does want to change the end time.

Limit your changes to the soft padding feature only. If you spot
non-related problems, address them separately.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Sun, 9 Apr 2006 04:08 pm, David Engel wrote:
> Here are my initial comments on your patches.

Thanks for any input.

> Make your patches against current SVN. This is a new feature and
> won't be considered for the 0.19 branch.

Thats fine. I run 0.19 but will forward port any patches.

> Don't change the current pre/postroll code. Some people, including
> myself, like it the way it is. If it proves unnecessary, it can be
> removed later.

It was only a attempt at simplifying things. I believe preroll/overtime is
for CAM setup on DVB-S, and if it could be scheduled it would help. What is
the else is it used for?

> Stick with global, soft start and end settings only for now. If this
> feature proves useful, we can canisder per-channel or per-rule
> settings later.

OK. Will keep a local patch for this and see if I like it.

> Remove the softp->recpriority2 stuff. That was just for proof of
> concept. It can be addressed later if needed.

How would the scheduler then pick the best showing? Based on length?

> I think your handling of the ChangeRecordingEnd check is incorrect. I
> think the best way to handle interaction with that feature is to
> remember when soft end padding is added and take that into account
> when needed. In addition, any soft end padding becomes hard once the
> recording starts and that needs to be accounted for if the user really
> does want to change the end time.

This would require the storing of soft padding, or doing what the comment says
and moving it PruneOverlaps.

> Limit your changes to the soft padding feature only. If you spot
> non-related problems, address them separately.

I noticed that retrylist is used low priority to high when searching in
MoveHigherRecords. See patch.

Thanks again,
Paul
--
Re: More scheduling scheduler [ In reply to ]
On Sun, Apr 09, 2006 at 11:31:55PM +1000, Paul Andreassen wrote:
> On Sun, 9 Apr 2006 04:08 pm, David Engel wrote:
> > Here are my initial comments on your patches.
>
> Thanks for any input.

You're welcome. I'm glad to see someone pick this up and do the grunt
work. It's something I'll likely never use, so it's been extremely
low on my TODO list.

> > Don't change the current pre/postroll code. Some people, including
> > myself, like it the way it is. If it proves unnecessary, it can be
> > removed later.
>
> It was only a attempt at simplifying things. I believe preroll/overtime is
> for CAM setup on DVB-S, and if it could be scheduled it would help. What is
> the else is it used for?

It's used for extremely soft padding. IOW, do it if possible, but
don't change the scheduling in any way because of it.

> > Remove the softp->recpriority2 stuff. That was just for proof of
> > concept. It can be addressed later if needed.
>
> How would the scheduler then pick the best showing? Based on length?

There's already recstart comparison in comp_priority. That should
handle soft starts without any changes. You should just need to add a
comparison to prefer programs with soft ends.

> > I think your handling of the ChangeRecordingEnd check is incorrect. I
> > think the best way to handle interaction with that feature is to
> > remember when soft end padding is added and take that into account
> > when needed. In addition, any soft end padding becomes hard once the
> > recording starts and that needs to be accounted for if the user really
> > does want to change the end time.
>
> This would require the storing of soft padding, or doing what the comment says
> and moving it PruneOverlaps.

I think storing the soft end is fine. You'll probably want it for thw
comp_priority check anyway.

> > Limit your changes to the soft padding feature only. If you spot
> > non-related problems, address them separately.
>
> I noticed that retrylist is used low priority to high when searching in
> MoveHigherRecords. See patch.

That's on purpose. The intent is starting with the lowest priority
loser will have the least impact on the highest priority winners
already scheduled. How well that works in practice is probably
debatable.

I can see, though, how this might not be ideal with soft padding. I
always expected soft padding would need an extra pass at the end to
add partial padding wherever possible. For example, say 20 minutes
padding before and after is desired and two programs stop and start 30
minutes apart. Obviously, they both can't each get the full 20
miniutes. With the current approach, one would get 20 minutes and the
other wouldn't get any. An extra pass could give the unused 10
minutes to the program that didn't get any.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Tue, 11 Apr 2006 01:23 am, David Engel wrote:
> > > Don't change the current pre/postroll code. Some people, including
> > > myself, like it the way it is. If it proves unnecessary, it can be
> > > removed later.
> > It was only a attempt at simplifying things. I believe preroll/overtime
> > is for CAM setup on DVB-S, and if it could be scheduled it would help.
> > What is the else is it used for?
> It's used for extremely soft padding. IOW, do it if possible, but
> don't change the scheduling in any way because of it.

Couldn't a function be added to Scheduler::FillRecordList to add in this 'no
preroll/overtime scheduling' and there by take them out of everywhere else in
the code.

> > > Remove the softp->recpriority2 stuff. That was just for proof of
> > > concept. It can be addressed later if needed.
> > How would the scheduler then pick the best showing? Based on length?
> There's already recstart comparison in comp_priority. That should
> handle soft starts without any changes. You should just need to add a
> comparison to prefer programs with soft ends.

I'm thinking a combo-box for priority order:
1. Channel/card priority (no preroll/overtime scheduling)
Current behaviour.
2. Channel/card priority then preroll/overtime priority
Don't move to a lower priority channel or card for preroll/overtime.
3. Preroll/overtime priority then channel/card priority
Move to lower channel or card to keep preroll/overtime.
4. Hard Preroll/overtime (with Channel/card priority)
Make Max Barry happy.

> I can see, though, how this might not be ideal with soft padding. I
> always expected soft padding would need an extra pass at the end to
> add partial padding wherever possible. For example, say 20 minutes
> padding before and after is desired and two programs stop and start 30
> minutes apart. Obviously, they both can't each get the full 20
> miniutes. With the current approach, one would get 20 minutes and the
> other wouldn't get any. An extra pass could give the unused 10
> minutes to the program that didn't get any.

I thought about variable length soft padding but didn't think it worth while.
Most shows are on half hour blocks. Most often two minutes before and six
minutes after is enough. It gets worse after midnight until 6:00am. I use
five minutes before and ten minutes after to catch just about everything.

Thanks again,
Paul
--
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Tue, Apr 11, 2006 at 04:04:22AM +1000, Paul Andreassen wrote:
> On Tue, 11 Apr 2006 01:23 am, David Engel wrote:
> > It's used for extremely soft padding. IOW, do it if possible, but
> > don't change the scheduling in any way because of it.
>
> Couldn't a function be added to Scheduler::FillRecordList to add in this 'no
> preroll/overtime scheduling' and there by take them out of everywhere else in
> the code.

Perhaps. As I said before, that can be addressed separately later.

> I'm thinking a combo-box for priority order:
> 1. Channel/card priority (no preroll/overtime scheduling)
> Current behaviour.
> 2. Channel/card priority then preroll/overtime priority
> Don't move to a lower priority channel or card for preroll/overtime.
> 3. Preroll/overtime priority then channel/card priority
> Move to lower channel or card to keep preroll/overtime.
> 4. Hard Preroll/overtime (with Channel/card priority)
> Make Max Barry happy.

I don't want to go down that rat hole of hard coding combinations of
priorities. The whole point of having the user assign numeric values
to various priorities is to let them specify what is most imporatant
to them.

> Most shows are on half hour blocks. Most often two minutes before and six
> minutes after is enough. It gets worse after midnight until 6:00am. I use
> five minutes before and ten minutes after to catch just about everything.

Two and six minutes are pretty reasonable. What if, on the odd
chance, programs start 5 minutes apart, what would you do then?
Regardless, other people will use much larger times just because they
can, so this will probably have to be handled sooner or later.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Tue, 11 Apr 2006 05:07 am, David Engel wrote:
> > I'm thinking a combo-box for priority order:
> > 1. Channel/card priority (no preroll/overtime scheduling)
> > Current behaviour.
> > 2. Channel/card priority then preroll/overtime priority
> > Don't move to a lower priority channel or card for
> > preroll/overtime. 3. Preroll/overtime priority then channel/card priority
> > Move to lower channel or card to keep preroll/overtime.
> > 4. Hard Preroll/overtime (with Channel/card priority)
> > Make Max Barry happy.
>
> I don't want to go down that rat hole of hard coding combinations of
> priorities. The whole point of having the user assign numeric values
> to various priorities is to let them specify what is most imporatant
> to them.

So using a numeric values for preroll/overtime priorities is the correct way
to do it. Sound like a good idea.

> > Most shows are on half hour blocks. Most often two minutes before and
> > six minutes after is enough. It gets worse after midnight until 6:00am.
> > I use five minutes before and ten minutes after to catch just about
> > everything.
>
> Two and six minutes are pretty reasonable. What if, on the odd
> chance, programs start 5 minutes apart, what would you do then?
> Regardless, other people will use much larger times just because they
> can, so this will probably have to be handled sooner or later.

I can see how this is important and should be handled correctly. Maybe a as
much as possible approach.

Paul
--
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Tue, Apr 11, 2006 at 03:48:35PM +1000, Paul Andreassen wrote:
> On Tue, 11 Apr 2006 05:07 am, David Engel wrote:
> So using a numeric values for preroll/overtime priorities is the correct way
> to do it. Sound like a good idea.

Yes, but only if additional priorities are needed. I'm not convinced
they are needed yet, so leave them out for now.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
Hi David,

Attached is a first attempt at something acceptable for svn.

My biggest decision was the comp_priority function. I wanted the SoftEnd to
be higher then the SoftStart, which your suggestion wouldn't do (see
commented lines).

It took longer that expected due to learning quilt and ccache,
Paul
--
Re: More scheduling scheduler [ In reply to ]
On Fri, Apr 14, 2006 at 12:11:13AM +1000, Paul Andreassen wrote:
> Attached is a first attempt at something acceptable for svn.

Thanks. I created a branch called softpad for these changes to go
into. People who want this feature should help test it out.

> My biggest decision was the comp_priority function. I wanted the SoftEnd to
> be higher then the SoftStart, which your suggestion wouldn't do (see
> commented lines).

I took a simpler (I think) approach for now. We'll see if it works out.

Here's a brief list of the other changes I made before committing your
patch.

Used a little more descriptive setting names by prepending "Sched".

Don't apply soft padding at the start or end if corresponding hard
padding has already been added. Hard padding is limited to a
resolution of 1 minute so they can't currently be mixed.

Pass softend to the recorder when a recording starts. This is needed
so the recorder can pass it back to the scheduler if the master
backend gets restarted.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Fri, 14 Apr 2006 06:24 am, David Engel wrote:
> Thanks. I created a branch called softpad for these changes to go
> into. People who want this feature should help test it out.

Are we at this stage already? Cool.

> > My biggest decision was the comp_priority function. I wanted the SoftEnd
> > to be higher then the SoftStart, which your suggestion wouldn't do (see
> > commented lines).
> I took a simpler (I think) approach for now. We'll see if it works out.

I think your right. It'll try all programs with soft ends first, sorted by
record start times. Should this be mentioned in the setHelpText?

> Don't apply soft padding at the start or end if corresponding hard
> padding has already been added. Hard padding is limited to a
> resolution of 1 minute so they can't currently be mixed.

I can't see why you can't mix soft and hard padding. If you take out your
test, it should just work.

> Pass softend to the recorder when a recording starts. This is needed
> so the recorder can pass it back to the scheduler if the master
> backend gets restarted.

I didn't know how that worked.

Paul
--
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Fri, Apr 14, 2006 at 08:49:18AM +1000, Paul Andreassen wrote:
> On Fri, 14 Apr 2006 06:24 am, David Engel wrote:
> > Thanks. I created a branch called softpad for these changes to go
> > into. People who want this feature should help test it out.
>
> Are we at this stage already? Cool.

I think so. The core scheduling changes are just an update of the
previous proof-of-concept. There are some usability issues (see
below) which will have to be worked out though. That's one reason
this is on a branch.

Another reason for having a branch is to make it easier for would be
testers with patchophobia to try it out. I must add that anyone who
wants to see this merged into trunk needs to help test it. Unless
there's feedback, positive or negative, I will let it die on the vine
like previous attempts.

> > Don't apply soft padding at the start or end if corresponding hard
> > padding has already been added. Hard padding is limited to a
> > resolution of 1 minute so they can't currently be mixed.
>
> I can't see why you can't mix soft and hard padding. If you take out your
> test, it should just work.

Consider the following examples, both of which have SchedSoftEnd set
to 1200 seconds (20 minutes) and endoffset initially set to 0 minutes.
Also note the same issues apply to SchedSoftStart and startoffset as
well.

A program with softend added is scheduled to end at 9:20. The user
thinks that might not be late enough and changes endoffset to 15
minutes. There happens to be another program scheduled to record at
9:30 and it can't be moved. Since the softend can no longer be
applied, the scheduler changes recendts to 9:15.

A program without softend added is scheduled to end at 9:00. Again,
the user wants more time and changes endoffset to 15. That bumps a
program scheduled to start at 9:00 to some other place or time.
Softend can now be added so the scheduler changes recendts to 9:35.

In both examples, the resulting recendts is nonintuitive.

OK, the obvious solution is to automatically absorb softend into
endoffset when the recording rule is edited. That presents new
problems.

First, say the user goes to edit something else about a recurring rule
and they access it through the EPG. If that showing happened to have
softend added, they've now inadvertantly added that softend into the
endoffset for that rule. The only way to not do this would be to
access the rule through the Set Priorities screen since it doesn't
have specific showings tied to recurring rules.

FYI, this is why the ability to change the end time of an in-progress
recording has a separate button for doing that. It creates a
kOverride rule on the fly as needed so this won't happen.

Second, endoffset might get adjusted every time the rule is edited.
In other words, endoffset could keep growing higher and higher.

In the end, I think the simplest, most deterministic thing to do is
not add softend when endoffset is non-zero. The rationale is that if
the user went to the trouble of specifying endoffset, they probably
had a reason and that should be the exact end time.

There is another related nit regarding interaction of softend and
endoffset. Softend is specified in seconds, but endoffset is in
minutes. If softend needs to get absorbed into endoffset, it will
have to be rounded to a minute boundary. The simple fix for this is
to change softend (and softstart) to be minutes instead of seconds.

> > Pass softend to the recorder when a recording starts. This is needed
> > so the recorder can pass it back to the scheduler if the master
> > backend gets restarted.
>
> I didn't know how that worked.

I didn't expect you to. It was a simple enough fix so I just added it
myself.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
David Engel wrote:
> I must add that anyone who
> wants to see this merged into trunk needs to help test it. Unless
> there's feedback, positive or negative, I will let it die on the vine

I'll definitely give it a whirl! Great to see some action on this issue.

I don't suppose one of you could summarize what this new code does,
specifically? I gather it's not what Paul originally proposed, and the
ensuing discussion is too technical for me to decipher.

Clearly it's a soft buffer of some kind, but that term means different
things to different people.

Thanks again,

Max.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Fri, 14 Apr 2006 12:32 pm, David Engel wrote:
> On Fri, Apr 14, 2006 at 08:49:18AM +1000, Paul Andreassen wrote:
> > On Fri, 14 Apr 2006 06:24 am, David Engel wrote:
> > > Thanks. I created a branch called softpad for these changes to go
> > > into. People who want this feature should help test it out.
> > Are we at this stage already? Cool.
> I think so. The core scheduling changes are just an update of the
> previous proof-of-concept. There are some usability issues (see
> below) which will have to be worked out though. That's one reason
> this is on a branch.
> Another reason for having a branch is to make it easier for would be
> testers with patchophobia to try it out. I must add that anyone who
> wants to see this merged into trunk needs to help test it. Unless
> there's feedback, positive or negative, I will let it die on the vine
> like previous attempts.

If anyone is interested the patch applies to head and is here:
http://svn.mythtv.org/trac/changeset/9707?format=diff&new=9707
It should also be easy to back port to 0.19.

If you try it please post on the user list with any problems it causes.

> > > Don't apply soft padding at the start or end if corresponding hard
> > > padding has already been added. Hard padding is limited to a
> > > resolution of 1 minute so they can't currently be mixed.
> > I can't see why you can't mix soft and hard padding. If you take out
> > your test, it should just work.
> Consider the following examples, both of which have SchedSoftEnd set
> to 1200 seconds (20 minutes) and endoffset initially set to 0 minutes.
> Also note the same issues apply to SchedSoftStart and startoffset as
> well.
> A program with softend added is scheduled to end at 9:20. The user
> thinks that might not be late enough and changes endoffset to 15
> minutes. There happens to be another program scheduled to record at
> 9:30 and it can't be moved. Since the softend can no longer be
> applied, the scheduler changes recendts to 9:15.
> A program without softend added is scheduled to end at 9:00. Again,
> the user wants more time and changes endoffset to 15. That bumps a
> program scheduled to start at 9:00 to some other place or time.
> Softend can now be added so the scheduler changes recendts to 9:35.
> In both examples, the resulting recendts is nonintuitive.

These are intuitive to me but I guess I know more of what is going on behind
the scenes.

Also these examples are exactly what the 'no scheduling' preroll/overtime does
now, without any feedback to the user.

The user could well have meant to do both these things and if not, based on
the feedback from the scheduler could decide against his changes.

This is how I record programs. I use a softstart of 5 minutes, because I set
Jump Amount to 5 minutes, and a softend of 10minutes. For most programs this
is enough but for two late night programs I need more, so I add 10 minutes of
endoffset, which is 5 minutes before and 20 minutes after a program.

> OK, the obvious solution is to automatically absorb softend into
> endoffset when the recording rule is edited. That presents new
> problems.
> First, say the user goes to edit something else about a recurring rule
> and they access it through the EPG. If that showing happened to have
> softend added, they've now inadvertantly added that softend into the
> endoffset for that rule. The only way to not do this would be to
> access the rule through the Set Priorities screen since it doesn't
> have specific showings tied to recurring rules.
> FYI, this is why the ability to change the end time of an in-progress
> recording has a separate button for doing that. It creates a
> kOverride rule on the fly as needed so this won't happen.
> Second, endoffset might get adjusted every time the rule is edited.
> In other words, endoffset could keep growing higher and higher.

This is very weird idea.

> In the end, I think the simplest, most deterministic thing to do is
> not add softend when endoffset is non-zero. The rationale is that if
> the user went to the trouble of specifying endoffset, they probably
> had a reason and that should be the exact end time.

My understanding was the soft padding would be added if it could be. No
matter if the endoffset was in effect or not.

Paul
--
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Sat, Apr 15, 2006 at 12:16:10AM +1000, Paul Andreassen wrote:
> On Fri, 14 Apr 2006 12:32 pm, David Engel wrote:
> If anyone is interested the patch applies to head and is here:
> http://svn.mythtv.org/trac/changeset/9707?format=diff&new=9707
> It should also be easy to back port to 0.19.
>
> If you try it please post on the user list with any problems it causes.

No, please post to the -dev list. This is a new feature under
development, afterall.

> These are intuitive to me but I guess I know more of what is going on behind
> the scenes.
>
> Also these examples are exactly what the 'no scheduling' preroll/overtime does
> now, without any feedback to the user.
> [...]
> My understanding was the soft padding would be added if it could be. No
> matter if the endoffset was in effect or not.

I'm mostly indifferent since I'm not going to use this feature. You
guys try it both ways, with and without softpad always considered, and
let me know which way you like better. When you decide, please
provide a clear rationale. Those of us who sitck around and have to
support it (Bruce, Michael, myself, etc.) can then regurgitate it when
the questions come up again in the futrue.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Fri, Apr 14, 2006 at 04:21:07PM +1000, Max Barry wrote:
> I don't suppose one of you could summarize what this new code does,
> specifically? I gather it's not what Paul originally proposed, and the
> ensuing discussion is too technical for me to decipher.
>
> Clearly it's a soft buffer of some kind, but that term means different
> things to different people.

The general idea goes like this. For each program that might be
recorded at a given time on a given channel, create up to 3 additional
variations. One with extra time added to the beginning (softstart),
one with extra added to the end (softend), and one with time added to
the beginning and end. Tweak the scheduling algorithm to prefer the
variation in the following order (softend and softstart added, softend
added, softstart added, neither added). Schedule normally and see
what comes out.

David
--
David Engel
gigem@comcast.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
David Engel wrote:
> You guys try it both ways, with and without softpad always considered, and
> let me know which way you like better. When you decide, please
> provide a clear rationale. Those of us who sitck around and have to
> support it (Bruce, Michael, myself, etc.) can then regurgitate it when
> the questions come up again in the futrue.

I haven't tested the code yet (am preparing the box now!), but I know
I'm on Paul's side here. Softpad should absolutely not be canceled by a
hardpad. Here are my hopefully-regurgitatable reasons why:

First, we're calling this a global buffer. If it's global, it should be
applied... well, globally.

Second, hard and soft buffers serve very different purposes. Hard
buffers are for correcting known differences between the guide data and
the actual schedule time. Soft buffers, on the other hand, are insurance
against unpredictable time shifts.

An example: say I have a global 5-minute end-late soft pad--maybe I
don't trust my system clock, or the network's. Say also that although
SURVIVOR is scheduled for 8-9pm each week, I have noticed that the
credits always run a minute longer. That is, the show is actually 61
minutes long.

What I should do is simply extend the length of SURVIVOR by one minute.
I am thus using what I know to correct the guide data. But I am *not*
also saying I no longer wish to insure against clock drift.

If my action doesn't affect global softpad, everything is fine. MythTV
will record from 8pm to 9.06pm if it can honor the soft buffer, and 8pm
to 9.01pm if it can't.

If, on the other hand, this cancels the global softpad, MythTV will only
ever record to 9.01pm. Suddenly I am no longer insured against clock
drift. Even if I'm aware of this, I have no sensible way of
compensating. I could make that hardpad 6 minutes, but that's not the
same, because my "just-in-case" soft pad has now become a
"always-record-even-if-it-means-conflicting-other-shows" hard pad.
That's not what I wanted.

Although they both affect the precise time MythTV will be recording,
soft padding and hard padding have very little to do with each other
conceptually.

Thanks again for the code--and the summary! Looking forward to testing
this. It sounds great.

Max.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: More scheduling scheduler [ In reply to ]
On Sat, 15 Apr 2006 02:45 am, David Engel wrote:
> No, please post to the -dev list. This is a new feature under
> development, afterall.

I was a little afraid that there might be a lot of email like there was on the
user list this week. Probably wont be many testing it anyway.

If I did up some Debian packages for Stable, would anyone try them?

> I'm mostly indifferent since I'm not going to use this feature. You
> guys try it both ways, with and without softpad always considered, and
> let me know which way you like better. When you decide, please
> provide a clear rationale. Those of us who sitck around and have to
> support it (Bruce, Michael, myself, etc.) can then regurgitate it when
> the questions come up again in the futrue.

This kind of thing can be hard to explain to users.

> The general idea goes like this. For each program that might be
> recorded at a given time on a given channel, create up to 3 additional
> variations. One with extra time added to the beginning (softstart),
> one with extra added to the end (softend), and one with time added to
> the beginning and end. Tweak the scheduling algorithm to prefer the
> variation in the following order (softend and softstart added, softend
> added, softstart added, neither added). Schedule normally and see
> what comes out.

The patch is installed on my machines and it seems to be working.

It doesn't work quite like I expected. I hadn't realised that the scheduler
would only try other options if it can't record a program and channel/card
priority was minor importance. What it did was keep softstart and softend
for all programs by moving to a lower priority card. I guess this makes
sense because whats the point of recording if it might not have an end. Will
have to update the helptext for schedsoftstart/schedsoftend.

> > Also these examples are exactly what the 'no scheduling' preroll/overtime
> > does now, without any feedback to the user.

Attached is a patch to get mythweb working. Mythweb displays startts and
endts everywhere so it has no feedback on why difference cards are used.

The next thing is to try the different combinations of overrides, extending
end times and other scheduling stuff. The same applies to mythweb.

Thanks for the time,
Paul
--

1 2 3 4 5  View All