[mythtv-users] LiveTV channel switching time

McNally mcnallychris at pobox.com
Sun Dec 17 15:02:37 UTC 2006

    > Date: Sat, 2 Dec 2006 02:37:06 -0500
    > From: Chris Pinkham <cpinkham at bc2va.org>

    > > With your inuseprograms table and knowledge of which disks and
    > > encoders are in use, would it be possible to do these tasks
    > > when the system is quiet?

    > I believe so.  The housekeeper could do something like this:

    > void HouseKeeper::RunHouseKeeping(void)
    > {
    > ...
    >     if ((wantToRun("DailyDBTasks", 1, 0, 24)) &&
    >         (SystemIsIdle()))
    >     {
    >         RunExternalDailyDBTasksScript();
    >         updateLastrun("DailyDBTasks");
    >     }
    > ...
    > }

    > That way the backup/optimize never actually runs until the system is idle.
    > With this, it may make sense to include a script that does do the check,
    > optimize, and backup.  The name could be a setting if the user chose to
    > use their own, but otherwise we'd use the stock one.  Could probably take
    > advantage of or extend the perl bindings some for this.

    > Anything that is recording or in use by some form of playback should be in
    > the inuseprograms table.  The only notable exceptions that I know of
    > for this are MythArchive and nuvexport when it's not using mythtranscode.
    > That makes it easy to check whether we're idle or not.  That covers
    > the MythTV portion.  We know nothing about plugins, but we probably don't
    > care either.

>Does this also manage to avoid system-about-to-become-nonidle?
>E.g., you want to make sure the optimize/backup doesn't -start-
>within some configurable time (on the order of a couple of minutes)
>of when any encoder is -going- to be busy.  This requires at least
>some interaction with the scheduler, but no more than MythWeb's
>"Status" page has.

I'm not sure what you guys are talking about and how this relates to LiveTV channel switching, However I like the idea of scheduled MYSQL backups and other daily jobs that won't interfere with upcoming recordings. I think this could be started by Mythwelcome. When the system is idle, and there are no recordings about to start (in a configurable period of time) Mythwelcome will set the next time to wake up and then run the shutdown command. In addition, perhaps it could kick off a daily job if there is one, and wait again for the idle time. 

The Mythwelcome doc is on the wiki:


Mythwelcome will also prevent the backend from shutting down the system if it is busy commercial flagging, downloading EPG data, transcoding or shutdown has been locked by a user.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20061217/98f95127/attachment.htm 

More information about the mythtv-users mailing list