Message ID | 51235356.60901@tvdr.de |
---|---|
State | New |
Headers |
Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <vdr-bounces@linuxtv.org>) 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 <Klaus.Schmidinger@tvdr.de>) 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 <vdr@linuxtv.org> 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 <vdr@linuxtv.org>; 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 <vdr@linuxtv.org>; 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 <Klaus.Schmidinger@tvdr.de> 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 <vdr@linuxtv.org> List-Id: VDR Mailing List <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/options/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org |
Commit Message
Klaus Schmidinger
Feb. 19, 2013, 10:26 a.m. UTC
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
Comments
In article <51235356.60901@tvdr.de> you write: >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: > >--- 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; > } > Yeah that's the same as I had it (other than that I ignored the diseqc case), so it should work (testing now.) Thanx! :) Juergen
On 19.02.2013 21:32, Juergen Lock wrote: > In article <51235356.60901@tvdr.de> you write: >> 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: >> >> --- 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; >> } >> > Yeah that's the same as I had it Absolutely! I thought it would work in a simpler manner, but I was wrong. Didn't mean to "steal" your idea ;-). > (other than that I ignored the diseqc > case), so it should work (testing now.) I just systematically replaced all calls to GetBondedMaster() that were just checks with the appropriate use of bondedTuner and bondedMaster. Maybe I'll even put this into a function bool IsBondedMaster(void) const { return !bondedTuner || bondedMaster; } Klaus
In article <5123EAD9.7050808@tvdr.de> you write: >On 19.02.2013 21:32, Juergen Lock wrote: >> In article <51235356.60901@tvdr.de> you write: >>> 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: >>> >>> --- 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; >>> } >>> >> Yeah that's the same as I had it > >Absolutely! I thought it would work in a simpler manner, but I was wrong. >Didn't mean to "steal" your idea ;-). > >> (other than that I ignored the diseqc >> case), so it should work (testing now.) > >I just systematically replaced all calls to GetBondedMaster() that were just checks with >the appropriate use of bondedTuner and bondedMaster. >Maybe I'll even put this into a function > >bool IsBondedMaster(void) const { return !bondedTuner || bondedMaster; } > Hmm were these the only two places that were just these checks or were there more? If there were other places too then in those cases the master may not be determined yet... Just thinking, :) Juergen
On 19.02.2013 23:14, Juergen Lock wrote: > In article <5123EAD9.7050808@tvdr.de> you write: >> On 19.02.2013 21:32, Juergen Lock wrote: >>> In article <51235356.60901@tvdr.de> you write: >>>> 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: >>>> >>>> --- 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; >>>> } >>>> >>> Yeah that's the same as I had it >> >> Absolutely! I thought it would work in a simpler manner, but I was wrong. >> Didn't mean to "steal" your idea ;-). >> >>> (other than that I ignored the diseqc >>> case), so it should work (testing now.) >> >> I just systematically replaced all calls to GetBondedMaster() that were just checks with >> the appropriate use of bondedTuner and bondedMaster. >> Maybe I'll even put this into a function >> >> bool IsBondedMaster(void) const { return !bondedTuner || bondedMaster; } >> > Hmm were these the only two places that were just these checks or > were there more? If there were other places too then in those cases > the master may not be determined yet... Yes, those were the only two places where this function was called purely to check whether this is the master. I've even made GetBondedMaster() private within cDvbTuner now. It is called from cDvbTuner::SetChannel(), which should be enough. 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; }