From patchwork Sat Feb 10 12:49:03 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinhard Nissl X-Patchwork-Id: 12435 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.50) id 1HFrgS-0004Ma-Pb for vdr@linuxtv.org; Sat, 10 Feb 2007 13:50:28 +0100 Received: (qmail invoked by alias); 10 Feb 2007 12:49:05 -0000 X-Provags-ID: V01U2FsdGVkX1+tuG1i1Byt/JZkSIdGk9n4gsKo/PY6Zdi3AULqWf uTkw== Message-ID: <45CDBF3F.1010600@gmx.de> Date: Sat, 10 Feb 2007 13:49:03 +0100 From: Reinhard Nissl User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20060911 SUSE/1.5.0.9-0.1 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] ERROR: video data stream broken on second dvb card , but szap works (include recording) References: <20070209121459.GC4364@bloms.de> <45CD892D.90402@gmx.de> <20070210094336.GB4467@bloms.de> In-Reply-To: <20070210094336.GB4467@bloms.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: Sat, 10 Feb 2007 12:50:28 -0000 Status: O X-Status: X-Keywords: X-UID: 12110 Hi, Dieter Bloms wrote: >>> Feb 9 12:02:00 video vdr: [30529] switching device 2 to channel 1 >>> Feb 9 12:02:09 video vdr: [30537] frontend 1 timed out while tuning to channel 1, tp 111836 >>> Feb 9 12:02:32 video vdr: [30603] ERROR: video data stream broken >>> >>> so why can I get ts streams from the second dvb card and vdr doesn't get >>> any bytes ? >> As you can see from the above lines, tuning fails for device 2 (= >> frontend 1) as VDR reports a timeout about 10 seconds after switching to >> this channel. VDR retries tuning in that case, but further reports are >> suppressed for the next 60 seconds so you don't see a second timeout report. >> >> Finally, after 30 seconds, the recording thread issues an emergency exit >> as it didn't see any data (=> video data stream broken) as the device >> was not able to tune to the channel. >> >> Is your DiSEqC setup correct (in case you are using DiSEqC)? > > I don't have a diseqc setup, I have a twin lnb and both dvb cards are > connected directly. > > It worked in the past, ok many timeouts, but after reloading the driver > and restart of vdr it worked. > > I was amazed that vdr can not tune to a channel and szap can do it > without reloading the driver ! > > Maybe they use differnt methods to switch the channels. szap always sends DiSEqC commands, so I'd suggest to use VDR's diseqc.conf. It's default section "Full DiSEqC sequence" is identical to the tuning sequence that szap uses. You may want to try the attached szap and VDR patch. You'll then get some output while tuning. Bye. --- ../vdr-1.4.5-orig/dvbdevice.c 2006-08-14 11:38:32.000000000 +0200 +++ dvbdevice.c 2007-02-01 21:38:44.000000000 +0100 @@ -176,6 +176,13 @@ static unsigned int FrequencyToHz(unsign return f; } +#include +static double now() { timeval t; gettimeofday(&t, 0); return t.tv_sec + t.tv_usec / 1e6; } +static int check(int c, int r, char *a, double t) { fprintf(stderr, "t: %.3lf, c: %d, r: %d, a: %s\n", t, c, r, a); return r; } +#define CHECK4(s) ::check(cardIndex, 0, s, ::now()) +#define CHECK3(s) ::check(cardIndex, s, #s, ::now()) +#define CHECK2(s) CHECK(::check(cardIndex, s, #s, ::now())) + bool cDvbTuner::SetFrontend(void) { dvb_frontend_parameters Frontend; @@ -195,12 +202,12 @@ bool cDvbTuner::SetFrontend(void) for (char *CurrentAction = NULL; (da = diseqc->Execute(&CurrentAction)) != cDiseqc::daNone; ) { switch (da) { case cDiseqc::daNone: break; - case cDiseqc::daToneOff: CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); break; - case cDiseqc::daToneOn: CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)); break; - case cDiseqc::daVoltage13: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); break; - case cDiseqc::daVoltage18: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break; - case cDiseqc::daMiniA: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break; - case cDiseqc::daMiniB: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break; + case cDiseqc::daToneOff: CHECK2(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); break; + case cDiseqc::daToneOn: CHECK2(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)); break; + case cDiseqc::daVoltage13: CHECK2(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); break; + case cDiseqc::daVoltage18: CHECK2(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break; + case cDiseqc::daMiniA: CHECK2(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break; + case cDiseqc::daMiniB: CHECK2(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break; case cDiseqc::daCodes: { int n = 0; uchar *codes = diseqc->Codes(n); @@ -208,7 +215,7 @@ bool cDvbTuner::SetFrontend(void) struct dvb_diseqc_master_cmd cmd; memcpy(cmd.msg, codes, min(n, int(sizeof(cmd.msg)))); cmd.msg_len = n; - CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); + CHECK2(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); } } break; @@ -285,7 +292,7 @@ bool cDvbTuner::SetFrontend(void) esyslog("ERROR: attempt to set channel with unknown DVB frontend type"); return false; } - if (ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend) < 0) { + if (CHECK3(ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend)) < 0) { esyslog("ERROR: frontend %d: %m", cardIndex); return false; } @@ -306,11 +313,13 @@ void cDvbTuner::Action(void) case tsIdle: break; case tsSet: +CHECK4("----------------------------------------------"); tunerStatus = SetFrontend() ? tsTuned : tsIdle; Timer.Set(tuneTimeout); continue; case tsTuned: if (Timer.TimedOut()) { +CHECK4("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); tunerStatus = tsSet; diseqcCommands = NULL; if (time(NULL) - lastTimeoutReport > 60) { // let's not get too many of these @@ -328,6 +337,7 @@ void cDvbTuner::Action(void) continue; } else if (Status & FE_HAS_LOCK) { +if (tunerStatus != tsLocked) CHECK4("=============================================="); if (LostLock) { isyslog("frontend %d regained lock on channel %d, tp %d", cardIndex, channel.Number(), channel.Transponder());