From patchwork Sat May 7 15:09:33 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 11867 Received: from tiger.cadsoft.de ([217.7.101.210]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DUQvx-0008Ga-Fh for vdr@linuxtv.org; Sat, 07 May 2005 17:09:37 +0200 Received: from raven.cadsoft.de (raven.cadsoft.de [217.7.101.211]) by tiger.cadsoft.de (8.12.7/8.12.7) with ESMTP id j47F9aMC023799 for ; Sat, 7 May 2005 17:09:36 +0200 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.12.7/8.12.7) with ESMTP id j47F9ZXY021928 for ; Sat, 7 May 2005 17:09:36 +0200 Message-ID: <427CDA2D.3040509@cadsoft.de> Date: Sat, 07 May 2005 17:09:33 +0200 From: Klaus Schmidinger Organization: CadSoft Computer GmbH User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en MIME-Version: 1.0 To: vdr@linuxtv.org Subject: Re: [vdr] vdr-1.3.22: channel not available. why? References: <1378040502EA7F46A1EB0DB1A826D7A537899C@ad-atlas.teklaad.tekla.com> In-Reply-To: <1378040502EA7F46A1EB0DB1A826D7A537899C@ad-atlas.teklaad.tekla.com> X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2005 15:09:37 -0000 Status: O X-Status: X-Keywords: X-UID: 1986 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 --- device.c 2005/05/05 14:48:01 1.100 +++ device.c 2005/05/07 15:04:17 @@ -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];