From patchwork Sun Dec 11 13:06:19 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinhard Nissl X-Patchwork-Id: 12119 Received: from mail.gmx.net ([213.165.64.21]) by www.linuxtv.org with smtp (Exim 4.50) id 1ElQui-0004VR-3O for vdr@linuxtv.org; Sun, 11 Dec 2005 14:06:52 +0100 Received: (qmail invoked by alias); 11 Dec 2005 13:06:21 -0000 Received: from ambg-c34713f0.pool.mediaWays.net (EHLO [192.168.101.15]) [195.71.19.240] by mail.gmx.net (mp034) with SMTP; 11 Dec 2005 14:06:21 +0100 X-Authenticated: #527675 Message-ID: <439C244B.8050203@gmx.de> Date: Sun, 11 Dec 2005 14:06:19 +0100 From: Reinhard Nissl User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] VDR-1.3.37: retuning -- possibly a fix for VDSB References: <43936C1D.2070904@gmx.de> <4396A873.7080700@gmx.de> <43982C00.3040409@gmx.de> <439B238E.8030504@gmx.de> <439BF8B9.8080107@gmx.de> In-Reply-To: <439BF8B9.8080107@gmx.de> X-Y-GMX-Trusted: 0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 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, 11 Dec 2005 13:06:52 -0000 Status: O X-Status: X-Keywords: X-UID: 6590 Hi, Thomas Rausch wrote: >> So for now, I've no further requirements concerning any test. Maybe >> I'll modify and post my patch later with a new invitation for testing ;-) > > I wait completely longingly for it. :-) Attached you'll find the updated patch: - retunes now only in DiSEqC setups. - just a single timeout (1000 ms) for retuning/resending DiSEqC message. - lost lock timeout increased (1000 ms). As resending the DiSEqC message requires to retune afterwards, it is now possible, that you cannot tune to channels where tuning takes longer than 1000 ms. In such a (rare) case, please increase the DISEQC_TUNE_TO_RETUNE_TIMEOUT e. g. to 1500, 2000 or an even larger value. Bye. --- ../vdr-1.3.37-orig/dvbdevice.c 2005-11-26 14:23:11.000000000 +0100 +++ dvbdevice.c 2005-12-11 13:11:22.000000000 +0100 @@ -284,8 +284,14 @@ bool cDvbTuner::SetFrontend(void) return true; } +#define DISEQC_TUNE_TO_RETUNE_TIMEOUT 1000 //ms +#define DISEQC_LOST_LOCK_TO_RETUNE_TIMEOUT 1000 //ms + void cDvbTuner::Action(void) { + enum { tssIdle, tssLostLock } TunerSubStatus = tssIdle; + cTimeMs Timer; + dvb_frontend_event event; while (Running()) { bool hasEvent = GetFrontendEvent(event, 1); @@ -298,8 +304,16 @@ void cDvbTuner::Action(void) if (hasEvent) continue; tunerStatus = SetFrontend() ? tsTuned : tsIdle; + TunerSubStatus = tssIdle; + Timer.Set(DISEQC_TUNE_TO_RETUNE_TIMEOUT); continue; case tsTuned: + if (diseqcCommands && Timer.TimedOut()) { // DiSEqC tuning timed out + tunerStatus = tsSet; + diseqcCommands = NULL; // deep re-tuning (= resend DiSEqC commands) + esyslog("ERROR: frontend %d timed out while tuning - re-tuning", cardIndex); + continue; + } case tsLocked: if (hasEvent) { if (event.status & FE_REINIT) { @@ -308,16 +322,27 @@ void cDvbTuner::Action(void) } if (event.status & FE_HAS_LOCK) { tunerStatus = tsLocked; + TunerSubStatus = tssIdle; locked.Broadcast(); } + else if (diseqcCommands && tunerStatus >= tsLocked) { // trigger DiSEqC re-tuning + TunerSubStatus = tssLostLock; + Timer.Set(DISEQC_LOST_LOCK_TO_RETUNE_TIMEOUT); + } + continue; + } + else if (tunerStatus >= tsLocked && TunerSubStatus == tssLostLock && Timer.TimedOut()) { + tunerStatus = tsSet; + diseqcCommands = NULL; // deep re-tuning (= resend DiSEqC commands) + esyslog("ERROR: frontend %d lost lock - re-tuning", cardIndex); continue; } } if (ciHandler) ciHandler->Process(); - if (tunerStatus != tsTuned) - newSet.TimedWait(mutex, 1000); + if (tunerStatus != tsTuned) // the tuners sub status may require faster reaction + newSet.TimedWait(mutex, (TunerSubStatus != tssIdle) ? 100 : 1000); } }