[mythtv] [mythtv-commits] Ticket #1772: Allow Multiple Channels rom 1 Transponder...

Martin Long martin.long at rozel.net
Sat Sep 23 11:46:25 UTC 2006

Stuart Auchterlonie:

> It could be similar to what scheduler does when LiveTV is playing - it
> tries to find a free input/card and if there is none it asks the
> what to do with the LiveTV - whether to stop it or give up on the
> recording. Now the multiplex-enhanced scheduler would simply try to
> search for an already running recording from the same multiplex and if
> it found it it would join that recording on the card. If there
> be any sibling recording in progress then no problem, it would work as
> always, but if there was a recording from the same mux then joining it
> would be a nice bonus.

Problem is, this is not how it works behind the scenes. The scheduler
doesn't actually allocate the tuner inputs in real-time, on-the-fly. A
tuner is allocated in advance, when the scheduler runs periodically, or
when you add the recording schedule. The can be demonstrated by turning
of the "Avoid clashes with LiveTV" option, which only makes live TV
choose the last tuner input in the list. If you turn this off, LiveTV
will use Tuner1 by default, and then when the first recording comes up,
it will ask to kick you off the channel (even though Tuners 2 3 etc are
free). If it was selecting tuners on the fly, it would just go straight
to 2. 

An option would be to use an on-the-fly scheduler, however, this
wouldn't be able to give advanced notice of clashes reliably. 

So what is actually required is a mechanism of allocating overlapping
(or even same start and end times) programmes to the same tuner input
(or a logical tuner input which is bound to being on the same Mux as
another logical tuner input). 

Bruce Markey:

> This issue has come up time and time again and each time
> people come to this wrong conclusion. The scheduler already
> knows how to assign shows to multiple inputs on multiple
> cards with multiple video sources in any combination and
> deal with overlaps, choosing the preferred input, "L"atering
> shows to make them fit, etc.

Yes, I'm aware that the scheduler is capable of doing this. What it is
not capable of is being aware of shows which are on the same mux, and
can be assigned to the same tuner. 

> But there is no way to configure this. That is the missing
> piece. There would need to be a mechanism to tell the system
> that the same device can be used as two independent inputs
> that are not mutually exclusive. The other side of the coin
> is that there in no way to tell the system that two inputs
> on different cards share a resource and need to be mutually
> exclusive.

This is exactly what I'm talking about, but the scheduler also needs
work to understand how to use this additional information. It could be
possible to assign up to 32 'virtual' inputs to a single tuner card for
example (Multiplex 2 in the UK has 30 channels!). This would mean that
you could record 32 programs at the same time, only using up a single

The rules for the scheduler are already quite complex, and this would
certainly add complexity to that. For example, on a SINGLE tuner system:

Two priority 0 programs are scheduled for 8am - 9pm on Mux 1, a new
program is added on Mux2 priority 1, should this trump BOTH of the
programs on Mux1? The answer may or may not be obvious, but the question
has to be asked, and the tuner doesn't currently know what to do in this

Here's one which would create an interesting situation, 2 tuner inputs:

Already set to record:

   1. Mux 1 (BBC 1) 7:00 - 8:00   - allocated to Tuner 1
   2. Mux 2 (ITV 1) 8:10 - 9:10   - allocated to Tuner 1

I want to add in the following program:

   3. Mux 1 (BBC 2) 7:30 - 9:30

This would sit fine with recording 1 on BBC 1, but because it would
clash with recording 2 on ITV 1, the scheduler would probably allocate
it to Tuner 2. This would mean 2 tuners are tied up for a longer period,
leaving less resources for other new recordings or live TV. 

The ideal solutions would be if the scheduler could recognise this, and
allocate recording 2 to the second tuner, allowing recordings 1 and 3 to
share the same tuner. 

    1. Mux 1 (BBC 1) 7:00 - 8:00    - allocated to Tuner 1
    2. Mux 2 (ITV 1) 8:10 - 9:10    - allocated to Tuner 2
    3. Mux 1 (BBC 2) 7:30 - 9:30	- allocated to Tuner 1

Again, it seems like it may be simple to implement this case, but we
have to consider how the rules interact with many of the others already
in the scheduler - eg Tuner priorty (which can often cause the scheduler
to choose later showings, rather than utilise a second tuner). 

How would LiveTV interact with this scheduler?

I may of course be wrong, and this can already be done, but looking at
the code, it does only seem to handle allocating recordings to distinct
tuner inputs. 

More information about the mythtv-dev mailing list