From patchwork Fri Dec 30 16:21:09 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinhard Nissl X-Patchwork-Id: 12127 Received: from mail.gmx.net ([213.165.64.21]) by www.linuxtv.org with smtp (Exim 4.50) id 1EsN0g-0002Vd-Ak for vdr@linuxtv.org; Fri, 30 Dec 2005 17:21:42 +0100 Received: (qmail invoked by alias); 30 Dec 2005 16:21:11 -0000 Received: from ambg-d9b9714d.pool.mediaWays.net (EHLO [192.168.101.15]) [217.185.113.77] by mail.gmx.net (mp010) with SMTP; 30 Dec 2005 17:21:11 +0100 X-Authenticated: #527675 Message-ID: <43B55E75.5030701@gmx.de> Date: Fri, 30 Dec 2005 17:21:09 +0100 From: Reinhard Nissl User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] Diseqc switch question References: <1135954334.6270.4.camel@localhost.localdomain> In-Reply-To: <1135954334.6270.4.camel@localhost.localdomain> 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: Fri, 30 Dec 2005 16:21:42 -0000 Status: O X-Status: X-Keywords: X-UID: 6842 Hi, Mlists wrote: > I'm running vdr 1.3.37 with a diseqc 2.0 switch. The problem I seem to > have is that switching between ports on the switch doesn't work cleanly. > Often it will not switch and give me a black screen. > > Can someone please confirm whether I have the right diseqc settings? > This is what I have -- > > # EchoStar 7 - 119W - Port 1 > S119.0W 99999 V 11250 t v W15 [E0 10 38 F0] > S119.0W 99999 H 11250 t V W15 [E0 10 38 F0] > > # EchoStar 6/8 - 110W - Port 2 > S110.0W 99999 V 11250 t v W15 [E0 10 38 F4] > S110.0W 99999 H 11250 t V W15 [E0 10 38 F4] Hhm, they don't look wrong, but I must admit that I cannot access those satellites. You may want to try the attached patch which repeats the DiSEqC message every 1000 ms until the tuner gets a lock on the signal. This should avoid the black screen with an additional delay of a little bit more then a second. Bye. --- ../vdr-1.3.37-orig/dvbdevice.c 2005-11-26 14:23:11.000000000 +0100 +++ dvbdevice.c 2005-12-11 19:59:37.000000000 +0100 @@ -70,7 +70,7 @@ static int DvbOpen(const char *Name, int class cDvbTuner : public cThread { private: - enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked }; + enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked, tsLockVanished }; int fd_frontend; int cardIndex; fe_type_t frontendType; @@ -130,6 +130,8 @@ void cDvbTuner::Set(const cChannel *Chan bool cDvbTuner::Locked(int TimeoutMs) { + // due to tsLockVanished, this method determines whether we got + // tsLocked at least once since the last tuning action (tsSet). bool isLocked = (tunerStatus >= tsLocked); if (isLocked || !TimeoutMs) return isLocked; @@ -284,8 +286,12 @@ 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) { + cTimeMs Timer; dvb_frontend_event event; while (Running()) { bool hasEvent = GetFrontendEvent(event, 1); @@ -298,9 +304,17 @@ void cDvbTuner::Action(void) if (hasEvent) continue; tunerStatus = SetFrontend() ? tsTuned : tsIdle; + 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: + case tsLockVanished: if (hasEvent) { if (event.status & FE_REINIT) { tunerStatus = tsSet; @@ -310,13 +324,23 @@ void cDvbTuner::Action(void) tunerStatus = tsLocked; locked.Broadcast(); } + else if (tunerStatus == tsLocked) { // trigger DiSEqC re-tuning + tunerStatus = tsLockVanished; + Timer.Set(DISEQC_LOST_LOCK_TO_RETUNE_TIMEOUT); + } + continue; + } + else if (tunerStatus >= tsLockVanished && diseqcCommands && Timer.TimedOut()) { // DiSEqC tuning lost lock + 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) + if (tunerStatus != tsTuned && tunerStatus != tsLockVanished) newSet.TimedWait(mutex, 1000); } }