vdr-1.3.22: channel not available. why?
Commit Message
Rantanen Teemu wrote:
> Stefan Taferner wrote:
>
>>I think it is necessary to have that checking for a CI. Otherwise
>>it wont work well on systems that have mixed CI and non-CI cards.
>>Or two cards with different CI (e.g. premiere + orf).
>
>
> This sounds good, at least it would fix this for me.
>
> In the meantime I modified for-loop in cDevice::GetDevice() to:
>
> for (int i = numDevices-1; i >= 0; i--)
>
> My full-card (with CI) is the first device, followed by 2 budget cards
> (non-CI). Now budget cards will be selected if they are free and can
> receive the channel.
>
> You should consider this as a (very) temporary solution, which may or
> may not help you (depending on the order of DVB cards in your system).
> For the real fix, wait for what Klaus has to say...
I believe one problem here is that with the old DVB driver the sequence
in which the DVB cards were detected is different than with the dvb-kernel
driver (or maybe it's because of the different kernel).
Anyway, the following patch should make VDR prefer budget cards (i.e. cards
that don't have an MPEG decoder) when selecting a device for recording.
I still need to do some work on the ProvidesCa() function, because this is
still based on the old CA handling, before VDR did the CA communication
itself.
Klaus
@@ -270,7 +270,7 @@
cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers)
{
cDevice *d = NULL;
- int select = 7, pri;
+ int select = 8, pri;
for (int i = 0; i < numDevices; i++) {
bool ndr;
@@ -279,16 +279,18 @@
pri = 0; // receiving and allows additional receivers
else if (d && !device[i]->Receiving() && device[i]->ProvidesCa(Channel) < d->ProvidesCa(Channel))
pri = 1; // free and fewer Ca's
+ else if (!device[i]->Receiving() && !device[i]->HasDecoder())
+ pri = 2; // free and not a full featured card
else if (!device[i]->Receiving() && !device[i]->IsPrimaryDevice())
- pri = 2; // free and not the primary device
+ pri = 3; // free and not the primary device
else if (!device[i]->Receiving())
- pri = 3; // free
+ pri = 4; // free
else if (d && device[i]->Priority() < d->Priority())
- pri = 4; // receiving but priority is lower
+ pri = 5; // receiving but priority is lower
else if (d && device[i]->Priority() == d->Priority() && device[i]->ProvidesCa(Channel) < d->ProvidesCa(Channel))
- pri = 5; // receiving with same priority but fewer Ca's
+ pri = 6; // receiving with same priority but fewer Ca's
else
- pri = 6; // all others
+ pri = 7; // all others
if (pri < select) {
select = pri;
d = device[i];