All of lore.kernel.org
 help / color / mirror / Atom feed
From: tskd08@gmail.com
To: linux-media@vger.kernel.org
Cc: m.chehab@samsung.com, Akihiro Tsukada <tskd08@gmail.com>
Subject: [PATCH v3 3/7] v4l-utils/libdvbv5: wrong frequency in the output of satellite delsys scans
Date: Fri, 31 Oct 2014 22:13:40 +0900	[thread overview]
Message-ID: <1414761224-32761-4-git-send-email-tskd08@gmail.com> (raw)
In-Reply-To: <1414761224-32761-1-git-send-email-tskd08@gmail.com>

From: Akihiro Tsukada <tskd08@gmail.com>

In the output of satellite delsys's scanning,
channel frequencies were offset by the LNB's LO frequency,
which should be not.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
---
 lib/libdvbv5/dvb-fe.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
index f535311..01b2848 100644
--- a/lib/libdvbv5/dvb-fe.c
+++ b/lib/libdvbv5/dvb-fe.c
@@ -604,8 +604,12 @@ int dvb_fe_get_parms(struct dvb_v5_fe_parms *p)
 		}
 
 		/* copy back params from temporary fe_prop */
-		for (i = 0; i < n; i++)
+		for (i = 0; i < n; i++) {
+			if (dvb_fe_is_satellite(p->current_sys)
+			    && fe_prop[i].cmd == DTV_FREQUENCY)
+				fe_prop[i].u.data += parms->freq_offset;
 			dvb_fe_store_parm(&parms->p, fe_prop[i].cmd, fe_prop[i].u.data);
+		}
 
 		if (parms->p.verbose) {
 			dvb_log("Got parameters for %s:",
@@ -683,8 +687,19 @@ int dvb_fe_set_parms(struct dvb_v5_fe_parms *p)
 			dvb_logdbg("LNA is %s", parms->p.lna ? "ON" : "OFF");
 	}
 
-	if (dvb_fe_is_satellite(tmp_parms.p.current_sys))
+	if (dvb_fe_is_satellite(tmp_parms.p.current_sys)) {
 		dvb_sat_set_parms(&tmp_parms.p);
+		/*
+		 * even though the frequncy prop is kept un-modified here,
+		 * a later call to dvb_fe_get_parms() issues FE_GET_PROPERTY
+		 * ioctl and overwrites it with the offset-ed value from
+		 * the FE. So we need to save the offset here and
+		 * re-add it in dvb_fe_get_parms().
+		 * note that dvbv5-{scan,zap} utilities call dvb_fe_get_parms()
+		 * indirectly from check_frontend() via dvb_fe_get_stats().
+		 */
+		parms->freq_offset = tmp_parms.freq_offset;
+	}
 
 	/* Filter out any user DTV_foo property such as DTV_POLARIZATION */
 	tmp_parms.n_props = dvb_copy_fe_props(tmp_parms.dvb_prop,
-- 
2.1.3


  parent reply	other threads:[~2014-10-31 13:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 13:13 [PATCH v3 0/7] v4l-utils/libdvbv5,dvb: add support for ISDB-S tskd08
2014-10-31 13:13 ` [PATCH v3 1/7] v4l-utils/libdvbv5, dvbv5-scan: generalize channel duplication check tskd08
2014-10-31 13:13 ` [PATCH v3 2/7] v4l-utils/libdvbv5: add as many channels as possible in scanning DVB-T2 tskd08
2014-10-31 13:13 ` tskd08 [this message]
2014-10-31 13:13 ` [PATCH v3 4/7] v4l-utils/libdvbv5: add support for ISDB-S tuning tskd08
2014-10-31 13:13 ` [PATCH v3 5/7] v4l-utils/libdvbv5: add support for ISDB-S scanning tskd08
2014-10-31 13:13 ` [PATCH v3 6/7] v4l-utils/dvb: add COUNTRY property tskd08
2014-11-02 10:14   ` Gregor Jasny
2014-10-31 13:13 ` [PATCH v3 7/7] v4l-utils/libdvbv5: add gconv module for the text conversions of ISDB-S/T tskd08
2014-10-31 19:47   ` Mauro Carvalho Chehab
2014-11-01 11:37     ` Akihiro TSUKADA
2014-11-01 11:40   ` [PATCH v4] " tskd08
2014-11-02 14:17     ` Gregor Jasny
2014-11-02 15:49       ` Akihiro TSUKADA
2014-11-05 13:06     ` [PATCH v5] v4l-utils/libdvbv5: move gconv modules to contrib and autotoolize tskd08

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414761224-32761-4-git-send-email-tskd08@gmail.com \
    --to=tskd08@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.