From patchwork Tue Feb 19 10:26:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 16917 Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1U7kPG-0000Bs-Rh; Tue, 19 Feb 2013 11:26:38 +0100 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1U7kPF-0000Bi-09 for vdr@linuxtv.org; Tue, 19 Feb 2013 11:26:37 +0100 X-tubIT-Incoming-IP: 188.40.50.18 Received: from racoon.tvdr.de ([188.40.50.18]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtps [TLSv1:AES256-SHA:256] for id 1U7kPE-0006V0-C3; Tue, 19 Feb 2013 11:26:36 +0100 Received: from dolphin.tvdr.de (dolphin.tvdr.de [192.168.100.2]) by racoon.tvdr.de (8.14.5/8.14.5) with ESMTP id r1JAQZax024046 for ; Tue, 19 Feb 2013 11:26:36 +0100 Received: from [192.168.100.11] (falcon.tvdr.de [192.168.100.11]) by dolphin.tvdr.de (8.14.4/8.14.4) with ESMTP id r1JAQU3Q027863 for ; Tue, 19 Feb 2013 11:26:30 +0100 Message-ID: <51235356.60901@tvdr.de> Date: Tue, 19 Feb 2013 11:26:30 +0100 From: Klaus Schmidinger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: vdr@linuxtv.org References: <20130216154636.GA21094@triton8.kn-bremen.de> <20130217153425.GA65533@triton8.kn-bremen.de> <20130218225125.GA64928@triton8.kn-bremen.de> <512351BA.1070403@tvdr.de> In-Reply-To: <512351BA.1070403@tvdr.de> X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.2.19.101515 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __FW_1LN_BOT_MSGID 0, __HAS_FROM 0, __HAS_MSGID 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT 0' X-LSpam-Score: -1.1 (-) X-LSpam-Report: No, score=-1.1 required=5.0 tests=BAYES_00=-1.9, RDNS_NONE=0.793 autolearn=no Subject: Re: [vdr] Device bonding X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org On 19.02.2013 11:19, Klaus Schmidinger wrote: > On 18.02.2013 23:51, Juergen Lock wrote: >> On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote: >>> On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote: >>>> Hi! >>>> >>>> [...] >>> >>>> 3. Running with these four tuners (dual DVB-T and the bonded two DVB-S2) >>>> I get two different deadlocks waiting for cDvbTuner::bondMutex >>>> after live viewing a DVB-T(!) channel for longer (OSD doesn't >>>> react anymore and attaching gdb reveals two threads waiting for >>>> bondMutex) - the following two changes make it work but there >>>> probably is a better fix: (patch may apply with offsets; one >>>> of the problems I think is a lock order reversal with cDvbTuner::mutex >>>> and bondMutex when cDvbTuner::SetChannel calls back into itself >>>> with bondMutex held.) >>>> >>>> --- dvbdevice.c.orig >>>> +++ dvbdevice.c >>>> @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne >>>> t->SetChannel(NULL); >>>> } >>>> } >>>> - else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) >>>> + else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) { >>>> + bondMutex.Unlock(); >>>> BondedMaster->SetChannel(Channel); >>>> + } >>>> } >>>> cMutexLock MutexLock(&mutex); >>>> if (!IsTunedTo(Channel)) >>>> @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) >>>> tone = SEC_TONE_ON; >>>> } >>>> int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; >>>> - if (GetBondedMaster() != this) { >>>> +#if 1 >>>> + if (bondedTuner && !bondedMaster) >>>> +#else >>>> + if (GetBondedMaster() != this) >>>> +#endif >>>> + { >>>> tone = SEC_TONE_OFF; >>>> volt = SEC_VOLTAGE_13; >>>> } >>>> >>> >>> Hmm looks like I posted too soon, the first hunk is actually too much >>> and causes other deadlocks (like when trying to play a DVB-S channel >>> via streamdev while live viewing another), so the patch I'm not testing >> >> .. I'm _now_ testing... >> >>> becomes: >>> >>> --- dvbdevice.c.orig >>> +++ dvbdevice.c >>> @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) >>> tone = SEC_TONE_ON; >>> } >>> int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; >>> - if (GetBondedMaster() != this) { >>> +#if 1 >>> + if (bondedTuner && !bondedMaster) >>> +#else >>> + if (GetBondedMaster() != this) >>> +#endif >>> + { >>> tone = SEC_TONE_OFF; >>> volt = SEC_VOLTAGE_13; >>> } >>> > > Can you please test whether this one works just as well? > > --- dvbdevice.c 2013/02/17 13:17:33 2.80 > +++ dvbdevice.c 2013/02/19 10:18:08 > @@ -742,7 +742,7 @@ > if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { > frequency -= diseqc->Lof(); > if (diseqc != lastDiseqc || diseqc->IsScr()) { > - if (GetBondedMaster() == this) { > + if (bondedMaster) { > ExecuteDiseqc(diseqc, &frequency); > if (frequency == 0) > return false; > @@ -768,7 +768,7 @@ > tone = SEC_TONE_ON; > } > int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; > - if (GetBondedMaster() != this) { > + if (!bondedMaster) { > tone = SEC_TONE_OFF; > volt = SEC_VOLTAGE_13; > } Sorry, that was a mistake. Try this one, please: Klaus --- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:24:39 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) { - if (GetBondedMaster() == this) { + if (!bondedTuner || bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false; @@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; - if (GetBondedMaster() != this) { + if (bondedTuner && !bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }