[mythtv-users] Before I tear my hair out can a slave BE...

Chris Pinkham cpinkham at bc2va.org
Fri Feb 6 02:35:19 UTC 2009

* On Thu Feb 05, 2009 at 02:29:16PM +0000, Mike Perkins wrote:
> Chris, will your proposed change be able to wake up the correct slave if 
> that proves necessary?

Short answer: Yes.

Long answer:

My patch allows the scheduler to schedule recordings on slaves
that the master has put to sleep.  So there are now 3 backend states:

	- Connected
	- Asleep
	- Disconnected/Unknown

The scheduler will schedule recordings across backends/tuners that
are either Connected or Asleep.  I have not modified the scheduler
yet to prefer backends/tuners in a Connected state vs slaves that
are Asleep, but this could be accomplished by adding another pass
with the first pass utilizing only Connected tuners and the new
pass allowing use of asleep backends/tuners.  If I did add this, it
would probably be as an option (I know, bad word), because this could
cause tuners of a lower priority to be used just because they were
currently connected rather than waking up a slave just to use a
more preferred and possibly higher quality tuner.

When the master starts up, all slaves are in a disconnected state.  When
a slave connects, the master moves that slave from the disconnected
state to connected.  The scheduler reruns whenever a disconnected slave
connects.  If the slave was Asleep, the scheduler does not need to rerun,
because it doesn't care whether a slave is connected or asleep, it
treats them both the same and will schedule recordings across both.
When a slave disconnects from the master, it can go into 2 states.  If
the master told the slave to shutdown, the slave is marked as asleep.
If the slave was not told to shutdown by the master, the slave is marked
as disconnected.

LiveTV is not handled.  A slave that is asleep will not be woken up to
allow use for LiveTV.

Because of the way the scheduler considers connected and asleep slaves
to be equal, it will schedule recordings across tuners in the same
tuner allocations that recordings would be scheduled if the slaves were
all awake/connected instead of some being asleep.  The scheduler knows
which slave needs to be woken up in order to use a tuner in that slave,
each slave has its own wakeup and shutdown command, so the can be put to
sleep and awakened independently of each other.  There is a new backend
command that the master uses to tell a slave to go to sleep.  When the
slave gets this command, it runs its SleepCommand.  When a slave needs
to be woken up, the scheduler runs the slaves WakeUpCommand.  If the
slave is not woken up in time to record the program, the scheduler will
reschedule to attempt to work around the unavailable tuner(s).  As a
precaution, the scheduler will not tell a slave to go to sleep if a
WakeUpCommand does not exist for that slave.


More information about the mythtv-users mailing list