From patchwork Sun Dec 21 15:19:34 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12686 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.63) (envelope-from ) id 1LEQ6E-0000J2-08 for vdr@linuxtv.org; Sun, 21 Dec 2008 16:20:17 +0100 Received: (qmail invoked by alias); 21 Dec 2008 15:19:36 -0000 Received: from Wa19f.w.pppool.de (EHLO localhost) [89.58.161.159] by mail.gmx.net (mp069) with SMTP; 21 Dec 2008 16:19:36 +0100 X-Authenticated: #1417946 X-Provags-ID: V01U2FsdGVkX19Aub9FB95AMRExdI8OpO9cT6y5t22s0QEm7j1jbG YV7qd0s2MFSwnk Message-ID: <494E5E86.7030109@gmx.de> Date: Sun, 21 Dec 2008 16:19:34 +0100 From: Udo Richter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20081204 Thunderbird/3.0b1 MIME-Version: 1.0 To: VDR Mailing List References: <20081201160216.18966PxIzEw208@wizard.castle> In-Reply-To: <20081201160216.18966PxIzEw208@wizard.castle> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=AWL=0.160, BAYES_00=-2.599 autolearn=ham Subject: Re: [vdr] Regression from a fix in VDR 1.4.1: Needless blocking of CAM DVB cards 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, 21 Dec 2008 15:20:19 -0000 Status: O X-Status: X-Keywords: X-UID: 18901 On 01.12.2008 16:02, Jörn Reder wrote: >> Jörn Reder wrote: >>> With vdr 1.4 this worked perfectly, now with 1.6 VDR always prefers my >>> Budget CI card for recordings so I can't view any Pay TV when a >>> recording is active. >> The rules that were added with 1.4.1-4 are still present, so they >> probably got over-ruled by something else. > > I can reproduce it this way: > > - watching a non pay TV channel (e.g. ARD) > - manually start a recording on it (go to menu, hit RED button) > - now switching to a pay TV channel is impossible I've attached a debug patch for impact logging. It dumps the reasons why VDR used a certain device to the console. (replace printf with isyslog if you prefer the log files.) Output looks like this: Impact: LiDeReTrPriPrcNdPrCiDeDc Dev 0.00: 0 0 0 0 62 63 1 1 1 1 0 Dev 1.00: 0 0 0 0 62 63 0 0 1 0 0 Device 1.00 wins The first difference decides, lower value wins. In this case, the second device wins because its Nd is 0. Thats the 'needs detach receivers' rule. Run the above test case and post the corresponding output here. Cheers, Udo --- device.c.orig 2008-12-21 15:46:20.000000000 +0100 +++ device.c 2008-12-21 15:51:44.000000000 +0100 @@ -384,6 +384,8 @@ cCamSlot *s = NULL; uint32_t Impact = 0xFFFFFFFF; // we're looking for a device with the least impact + printf("Impact: LiDeReTrPriPrcNdPrCiDeDc\n"); + int besti=0, bestj=0; for (int j = 0; j < NumCamSlots || !NumUsableSlots; j++) { if (NumUsableSlots && SlotPriority[j] > MAXPRIORITY) continue; // there is no CAM available in this slot @@ -419,10 +421,29 @@ 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 + + #define bitextract(u, bit, len) (((u) >> (bit)) & ((1 << (len)) - 1)) + printf("Dev %2i.%02i: %i %i %i %i %02x %02x %i %i %i %i %i\n", + i, + j, + bitextract(imp, 24, 1), + bitextract(imp, 23, 1), + bitextract(imp, 22, 1), + bitextract(imp, 21, 1), + bitextract(imp, 13, 8), + bitextract(imp, 5, 8), + bitextract(imp, 4, 1), + bitextract(imp, 3, 1), + bitextract(imp, 2, 1), + bitextract(imp, 1, 1), + bitextract(imp, 0, 1)); + if (imp < Impact) { // This device has less impact than any previous one, so we take it. Impact = imp; d = device[i]; + besti=i; + bestj=j; NeedsDetachReceivers = ndr; if (NumUsableSlots) s = CamSlots.Get(j); @@ -433,6 +454,7 @@ break; // no CAM necessary, so just one loop over the devices } if (d) { + printf("Device %2i.%02i wins\n", besti,bestj); if (NeedsDetachReceivers) d->DetachAllReceivers(); if (s) {