Schedchk

From hummy.tv Wiki
Revision as of 15:10, 26 May 2020 by MymsMan (talk | contribs) (Split recording)
Jump to: navigation, search

Schedchk48.png
DRAFT Schedchk - Check and fix the Humax recording schedule DRAFT

Introduction

While it is "only telly" it can be extremely annoying when we find that a programme we had scheduled to record fails to record correctly. Some failures can be attributed to user errors but a considerable numbers of problems are attributable to the broadcasters and problems in the Humax software not anticipating the ever more creative ways the broadcasters find to make life complicated!

The origins of schedchk go back several years to a forum postwhere I proposed the idea of automatically detecting when programmes were delayed or moved to another channel (e.g. BBC One -> BBC Two) because of overrunning sporting events or breaking news events. Nothing much happened at that time since Wimbledon only last two weeks and other last minute programme changes are by their nature unpredictable making testing difficult.

However now we live in Interesting Times the unpredictable has become routine, every day the BBC1 showing of Pointless is moved to BBC2 to make way for the Corona Virus Daily Update. One might think that after this long the BBC would take the hint and schedule Pointless on BBC2 but no they persist in scheduling it on BBC1 and only update the schedules 3-72 hours in advance! Since Pointless is one of our favourite shows I was provoked into resurrecting the Schedchk idea and finally it is now ready for a wider audience though there may still be a few rough edges.

The program relies on the epg being kept up-to-date to allow it to find alternative showings of programmes and, especially wih last minute changes, that can't be relied upon and sometimes there are no alternate showings so it will not be infallible but hopefully it will help you avoid some missed recordings,

I have found several different categories of potential errors in the schedule and these are listed below with examples of how they can occur and action schedchk takes when attempting to fix them.

Failure Categories

EPG changes

The most basic form of schedule change is when the broadcaster changes the start time, duration or scheduled episode (CRID change). Usually the humax is quite good at spotting these changes but sometimes it doesn't immediately.

Schedchk will resolve this type of error by updating the schedule entry with the new details.

Checking for this type of problem can be by-passed by specifying the -noEPGchg option in settings or on the command line

Missing EPG entry

Duplicate episode

Sometimes the event-id associated with a programme changes and the Humax is not good at resolving these, on occasion it can get very confused resulting in it scheduling two episodes of the same series at the same time!

Changes to the event-id can occur when a programme is moved another channel (e.g. Pointless moving from BBC1_>2), when a programme is added to the schedule (ITV assigned new event-ids to all programmes following the Queen's recent broadcasts), a different episode is scheduled (e.g, the duplicate example above) or if a programme is cancelled and replaced by something else.

Schedchk attempts to resolve this type of error by searching for another showing of the same programme (by event CRID) elsewhere in the EPG and if another showing (that doesn't cause a conflict) can be found, it will schedule that showing instead. If there are no matches by event-crid it will look for a programme of the same name scheduled for the same time in case the Broadcaster has changed event-id, event-CRID and series-CRID and scheduled an episode from a different series of the programme. If duplicate episodes occur it will delete the episode that no longer appears in the EPG.

Checking for this type of problem can be by-passed by specifying the -noMissEPG option in settings or on the command line

Conflict resolution

Conflict arise when three of more programmes are scheduled to be recorded at the same time (Two or more on HD model). This can arise if a user ignores conflict warnings when scheduling, when a news days EPG data is loaded, or if the EPG changes.

Schedchk attempts to resolve this type of error by searching for another showing of the same programme (by event CRID) elsewhere in the EPG and if another showing (that doesn't cause a conflict) can be found, it will schedule that showing instead. When considering alternatives schedchk will attempt to find a match on a channel with the same definition (HD or SD) as the original but if there is no match it will consider matches on channels with a different definition.

Schedchk is quite simple minded in its approach to conflict resolution and will not always choose the best solution for your viewing needs. For complex conflicts or where you want to select which programmes you don't want delayed you should attempt to manually resolve conflicts using the Visual Schedule displays in the webif or RS before schedchk attempts automatic resolution.

At the moment Split recordings are not considered for conflict resolution.


Checking for this type of problem can be by-passed by specifying the -noConflict option in settings or on the command line

Unscheduled episodes

The Humax normally manges to automatically schedule new episodes of a series but can sometimes miss changes that happen in the middle of the scheduled sequence

Schedchk checks the EPG by series-CRID and adds any missing

Checking for this type of problem can be by-passed by specifying the -noUnsched option in settings or on the command line

series-CRID changes

Often broadcasters change the series-CRID of a long running programme causing the next episodes of the programme to be not recorded. Sometimes this is because it has switched to another series of the programme (as if we really care whether it is repeats from series 51 or 55) but other times there is no obvious reason for the change.

Schedchk handles this by looking by programme name for a new series with matching name in the same time slot on the same channel and scheduling a new series recording for the programme.

Prefixes such as New: are ignored but the checking can miss some programmes and find false matches in other cases:

  • Variations in title, Pointless would match Pointless Celebrities but not vice versa
  • Programmes with variable time slots such as the F1 Grand Prix races
  • Programmes moved by conflict resolution, If, for example, an series episode has been moved to a +1 channel the series-CRID check is liable to consider the +1 series a new unscheduled series

Checking for this type of problem can be by-passed by specifying the -noSCRID option in settings or on the command line

One-off episodes of a series

Some times broadcasters schedule episodes of a series as 1-off programmes without a series-CRID. Often this is deliberate when filling in a gap in the schedule but other times it is the result of broadcaster incompetence! Recently Pick broadcast several episodes of the Sherlock series as 1-off programmes 😥

Schedchk handles this by looking by programme name for a 1-off programme with matching name on the same channel and scheduling a recording for the programme.

Prefixes such as New: are ignored but the checking can miss some programmes and find false matches in other cases:

  • Variations in title, Pointless would match Pointless Celebrities but not vice versa
  • Programmes moved by conflict resolution, If, for example, an series episode has been moved to a +1 channel the 1-off check is liable to search the +1 channel

Checking for this type of problem can be by-passed by specifying the -no1off option in settings or on the command line

Not Recording

Occasionally a programme fails to start recording. This can be due to an unresolved conflict, overrunning programmes, last minute schedule changes etc. but some failures are unexplained.

When a programme is due to be recording schedchk checks whether there is a file for the recording and whether it is growing in size. If the programme is not recording it searches by event-CRID for an alternative showing and, if a suitable alternate is found, schedules it as a 1-off recording.

Since some late starting is normal the checking starts a short while after the scheduled start. By default this is 300 seconds (5 minutes) but this can be modified by specifying the -recWait option in settings or on the command line

Checking for this type of problem can be by-passed by specifying the -noNotRec option in settings or on the command line

Note: Since active recording schedule entries are deleted on Humax start-up schedchk can't schedule alternates for recordings truncated by a power failure or Humax crash 😥.

Split Recordings

Split recordings are where a long programme such as a film has a shorter programme, often a news bulletin, in the middle of the longer programme. While they may appear to be a 2-epsidode series they are not treated as such by the broadcasters or the Humax and have there own (very badly designed) set of rules which the Humax only partially implements. Split recordings contain #number at the end of their event-CRID (eg /X4454865#01) and both halves of he split recording are required to have the same number, known as an IMI (Instance Metadata ID). The problem arises when the same film is repeated later in the week with exactly the same event-CRID and IMI, under the rules if there is more than three hours between them they should be treated as different programmes but the Humax treats them all as additional parts of the same programme.

This is a particular problem on channels such as Sony Movies which split most films into 2 parts and regularly repeat films up to three times a week. So you can attempt to schedule just one showing of a film but the Humax will schedule all six parts and some of the unwanted recordings can cause schedule conflicts.

Schedchk handles split recordings by leaving those with one or two parts schedule alone, if there are more than two parts scheduled it checks whether there is more than a 3-hour gap and whether there are any conflicts. The first, non-conflicting, showing is kept with a dummy IMI to prevent the Humax rescheduling and the other showings are removed from the schedule.

Checking for this type of problem can be by-passed by specifying the -no Split option in settings or on the command line

Other controls

Schedchk setting

Initially all schedchk processing options are enabled but the default settings can be overridden on the webif Settings page, any changes made here become the new defaults for schedchk.

More detail on each of the options is given in the sections above.

SchedChk Settings Page

Schedchk command line

As well as running automatically every few minutes as part of the regular auto process you can also run schedchk on demand from a command line. Options specified on the command line override values set on the settings page for this invocation of schedchk only, they don't change the default values.

schedchk = Check for recording schedule issues and attempt to fix them

schedchk -h            = produce this help
schedchk -rsv          = scan the recording schedule

Options      Default (unless changed in Settings)
-thresh      36   = Don't check for problems more than x hrs away from start
-d           0    = Produce more detailed output
-test        n    = Don't make updates
-noAuto      n    = Don't run regularly as part of Auto-Processing
-noAlert     n    = Don't generate webif alert messages for changes made
-noConflict  n    = Don't check for conflicts
-noUnsched   n    = Don't check for episodes missing from schedule
-noSCRID     n    = Don't check for series CRID changes
-no1off      n    = Don't check for episodes scheduled as one off programmes
-noNotRec    n    = Don't check for failures to record
-recWait     300  = Don't assume recording failed until x seconds late starting
-noMissEPG   n    = Don't resolve missing epg entries
-noEPGchg    n    = Don't resolve epg time/ duration/ event crid changes
-noSplit     n    = Don't resolve repeated split recordings
-noInplace   n    = Update reservation by skipping & 1-off rather than inplace

Note: Options are not case sensitive

-noAuto has no effect when specified as a command option, it needs to be set via the settings page.

Running via crontabs

As an alternative to running schedchk as part of the standard customised firmware Auto processing it also possible to schedule schedchk to run at different intervals using the crontabs file.

You might want to do this if:

  • You normally disable Auto processing during recordings but would still like to take advantage of Not Recording checks
  • You want some checks made at a different frequency from others
  • You want process messages written to a dedicated log file

You can edit the crontabs file via webif->Diag->File Editor->Commonly edited files->/mod/var/spool/cron/crontabs/root

Editing crontabs file

In the example above schedchk will run a Not Recording check every 4 minutes and check for SCRID changes and 1-off recordings every 4 hours at 17 minutes past the hour, output will be written to schedchk.log

Guides to crontabs time formats are available online

fmtrsv - Format a rsv.db table entry

Other Stuff

Change history

Date Version Author Description
2020-05-xx schedchk 0.1,0-0 mymsman Intial Version
  • All new!

Acknowledgements

af123
For providing the cf framework that underlies everything and who's code I have copied and hacked.
/df
For investigating the problems with Split recordings and writing the rsv set method
everbody else
Who has assisted through the forums

Future Enhancements

  • Detect and reschedule recordings active at time of crash
  • Improve Series CRID change detection to reduce false positive's