From patchwork Thu Feb 1 21:30:13 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinhard Nissl X-Patchwork-Id: 12434 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.50) id 1HCjWs-00075t-VS for vdr@linuxtv.org; Thu, 01 Feb 2007 22:31:38 +0100 Received: (qmail invoked by alias); 01 Feb 2007 21:30:16 -0000 Received: from p549332BD.dip0.t-ipconnect.de (EHLO [192.168.101.15]) [84.147.50.189] by mail.gmx.net (mp009) with SMTP; 01 Feb 2007 22:30:16 +0100 X-Authenticated: #527675 Message-ID: <45C25BE5.1050304@gmx.de> Date: Thu, 01 Feb 2007 22:30:13 +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] vdr diseqc equivalence of szap diseqc n ? References: <20070130232829.GC5436@gmail.com> <45C1051A.3070202@gmx.de> <20070131214243.GD6391@gmail.com> In-Reply-To: <20070131214243.GD6391@gmail.com> 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: Thu, 01 Feb 2007 21:31:39 -0000 Status: O X-Status: X-Keywords: X-UID: 11958 Hi, Gregoire Favre wrote: > Thank you very much for taking a look at VDR diseqc commands sequence :) Attached is a patch which adds some output to the tuning process. t: 1170360811.082, c: 0, r: 0, a: ---------------------------------------------- t: 1170360811.082, c: 0, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF) t: 1170360811.085, c: 0, r: 0, a: ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18) t: 1170360811.169, c: 0, r: 0, a: ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd) t: 1170360811.205, c: 0, r: 0, a: ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A) t: 1170360811.225, c: 0, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON) t: 1170360811.225, c: 0, r: 0, a: ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend) t: 1170360811.237, c: 0, r: 0, a: ============================================== t: 1170360870.235, c: 1, r: 0, a: ---------------------------------------------- t: 1170360870.236, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF) t: 1170360870.237, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18) t: 1170360870.319, c: 1, r: 0, a: ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd) t: 1170360870.355, c: 1, r: 0, a: ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B) t: 1170360870.375, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF) t: 1170360870.375, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend) t: 1170360870.443, c: 1, r: 0, a: ============================================== t: 1170360891.319, c: 1, r: 0, a: ---------------------------------------------- t: 1170360891.319, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend) t: 1170360891.331, c: 1, r: 0, a: ============================================== Legend: t: current time in seconds c: card index r: result of action a: action in the tuning code -: start tuning ~: failed tuning (didn't locked) =: succeeded tuning (locked) As you can see in the above output, VDR tunes card 0 to some channel and after 60 seconds, the EPG scan starts using card 1. After 20 seconds, it tunes to a different transponder on the same "band", so there is just FE_SET_FRONTEND reported. I'll now add the same output to szap. 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());