From patchwork Sun May 4 09:26:23 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12654 Received: from raven.cadsoft.de ([217.7.101.211]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1JsaUG-0005mJ-G6 for vdr@linuxtv.org; Sun, 04 May 2008 11:26:29 +0200 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.13.3/8.13.3) with ESMTP id m449QNwA005746 for ; Sun, 4 May 2008 11:26:24 +0200 Message-ID: <481D813F.3050401@cadsoft.de> Date: Sun, 04 May 2008 11:26:23 +0200 From: Klaus Schmidinger Organization: CadSoft Computer GmbH User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: vdr@linuxtv.org References: <19701E9E9B984DC38521C940F8857445@ENTERPRISE> In-Reply-To: <19701E9E9B984DC38521C940F8857445@ENTERPRISE> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (raven.cadsoft.de [192.168.1.1]); Sun, 04 May 2008 11:26:24 +0200 (CEST) X-LSpam-Score: -2.1 (--) X-LSpam-Report: No, score=-2.1 required=5.0 tests=AWL=0.501, BAYES_00=-2.599 autolearn=ham Subject: Re: [vdr] Upgrading from 1.4.7 to 1.7.0 : enabling #define X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2008 09:26:29 -0000 Status: O X-Status: X-Keywords: X-UID: 16732 On 05/04/08 10:23, Pierre-Yves Paranthoen (PERSO) wrote: > Added in device.c debug output to cDevice::GetDevice(const cChannel > *Channel, int Priority, bool LiveView) : > > > GetDevice 2 0 1 -1 > j = 1, i = 0, imp = 020C4C4B, Impact = FFFFFFFF > device 0 > GetDevice 2 0 1 -1 > no usable CAM slots! > ... Looks like for some reason the CAM is not usable at this time. Please apply the attched patch instead of the previous one. It produces additional output and writes it into the syslog, so that it will be in sync with the other log messages. Klaus --- device.c 2008/04/12 14:12:14 2.2 +++ device.c 2008/05/04 09:24:16 @@ -372,26 +372,35 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView) { + dsyslog("GetDevice %d %d %d %d %04X", Channel->Number(), Priority, LiveView, avoidDevice ? avoidDevice->CardIndex() : -1, Channel->Ca());//XXX cDevice *AvoidDevice = avoidDevice; avoidDevice = NULL; // Collect the current priorities of all CAM slots that can decrypt the channel: int NumCamSlots = CamSlots.Count(); + dsyslog("NumCamSlots = %d", NumCamSlots);//XXX int SlotPriority[NumCamSlots]; int NumUsableSlots = 0; if (Channel->Ca() >= CA_ENCRYPTED_MIN) { for (cCamSlot *CamSlot = CamSlots.First(); CamSlot; CamSlot = CamSlots.Next(CamSlot)) { SlotPriority[CamSlot->Index()] = MAXPRIORITY + 1; // assumes it can't be used if (CamSlot->ModuleStatus() == msReady) { + dsyslog("CAM %d ready", CamSlot->Index());//XXX if (CamSlot->ProvidesCa(Channel->Caids())) { + dsyslog("CAM %d provides CA", CamSlot->Index());//XXX if (!ChannelCamRelations.CamChecked(Channel->GetChannelID(), CamSlot->SlotNumber())) { SlotPriority[CamSlot->Index()] = CamSlot->Priority(); NumUsableSlots++; + dsyslog("NumUsableSlots = %d", NumUsableSlots);//XXX } + else dsyslog("ChannelCamRelations.CamChecked(%s, %d) = 0", *Channel->GetChannelID().ToString(), CamSlot->SlotNumber());//XXX } } + else dsyslog("CAM %d not ready", CamSlot->Index());//XXX } if (!NumUsableSlots) + {dsyslog("no usable CAM slots!");//XXX return NULL; // no CAM is able to decrypt this channel + }//XXX } bool NeedsDetachReceivers = false; @@ -432,6 +441,7 @@ imp <<= 1; imp |= NumUsableSlots ? 0 : device[i]->HasCi(); // avoid cards with Common Interface for FTA channels imp <<= 1; imp |= device[i]->HasDecoder(); // avoid full featured cards imp <<= 1; imp |= NumUsableSlots ? !ChannelCamRelations.CamDecrypt(Channel->GetChannelID(), j + 1) : 0; // prefer CAMs that are known to decrypt this channel + dsyslog("j = %d, i = %d, imp = %08X, Impact = %08X", j, i, imp, Impact);//XXX if (imp < Impact) { // This device has less impact than any previous one, so we take it. Impact = imp; @@ -446,6 +456,7 @@ break; // no CAM necessary, so just one loop over the devices } if (d) { + dsyslog("device %d", d->CardIndex());//XXX if (NeedsDetachReceivers) d->DetachAllReceivers(); if (s) { @@ -460,6 +471,7 @@ else if (d->CamSlot() && !d->CamSlot()->IsDecrypting()) d->CamSlot()->Assign(NULL); } + else dsyslog("no device found");//XXX return d; }