From: Maksym Veremeyenko <verem@m1stereo.tv>
To: linux-media@vger.kernel.org
Subject: [PATCH/RFC] not use a DiSEqC switch
Date: Fri, 24 Nov 2017 10:52:04 +0200 [thread overview]
Message-ID: <b5573a09-f841-d126-df19-0ecc76d15511@m1stereo.tv> (raw)
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
Hi,
there is a code in function *dvbsat_diseqc_set_input*:
[...]
/* Negative numbers means to not use a DiSEqC switch */
if (parms->p.sat_number < 0)
return 0;
[...]
if it mean /there is no DiSEqC switch/ then LNB's *polarity* and *band*
settings still should be applied - attached patch fixes that behavior.
if it mean /current DVB is a slave/ i.e. it is connected to LOOP OUT of
another DVB, so no need to configure anything, then statement above is
correct and no patches from this email should be applied.
--
Maksym Veremeyenko
[-- Attachment #2: 0003-Fix-setting-band-and-polarity-if-sat_number-is-negat.patch --]
[-- Type: text/plain, Size: 1413 bytes --]
From 57ac346433720c0c9b8ce30a32bdfa1df075fede Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <verem@m1.tv>
Date: Fri, 24 Nov 2017 08:59:41 +0100
Subject: [PATCH 3/4] Fix setting band and polarity if sat_number is negative
---
lib/libdvbv5/dvb-sat.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index a01db72e..8b2fcf7d 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -523,10 +523,6 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
struct diseqc_cmd cmd;
const struct dvb_sat_lnb_priv *lnb = (void *)parms->p.lnb;
- /* Negative numbers means to not use a DiSEqC switch */
- if (parms->p.sat_number < 0)
- return 0;
-
dvb_fe_retrieve_parm(&parms->p, DTV_POLARIZATION, &pol);
pol_v = (pol == POLARIZATION_V) || (pol == POLARIZATION_R);
@@ -558,6 +554,9 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
usleep(15 * 1000);
+ /* Negative numbers means to not use a DiSEqC switch */
+ if (parms->p.sat_number >= 0)
+ {
if (!t)
rc = dvbsat_diseqc_write_to_port_group(parms, &cmd, high_band,
pol_v, sat_number);
@@ -578,6 +577,7 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
return rc;
}
usleep(15 * 1000);
+ }
rc = dvb_fe_sec_tone(&parms->p, tone_on ? SEC_TONE_ON : SEC_TONE_OFF);
--
2.13.6
[-- Attachment #3: 0004-Fix-indention-from-last-commit.patch --]
[-- Type: text/plain, Size: 1855 bytes --]
From c700e3db0c855a2675b340e1ee1646678b19bcc6 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <verem@m1.tv>
Date: Fri, 24 Nov 2017 09:02:26 +0100
Subject: [PATCH 4/4] Fix indention from last commit
---
lib/libdvbv5/dvb-sat.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index 8b2fcf7d..8383cdf7 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -557,26 +557,26 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
/* Negative numbers means to not use a DiSEqC switch */
if (parms->p.sat_number >= 0)
{
- if (!t)
- rc = dvbsat_diseqc_write_to_port_group(parms, &cmd, high_band,
- pol_v, sat_number);
- else
- rc = dvbsat_scr_odu_channel_change(parms, &cmd, high_band,
- pol_v, sat_number, t);
-
- if (rc) {
- dvb_logerr(_("sending diseq failed"));
- return rc;
- }
- usleep((15 + parms->p.diseqc_wait) * 1000);
-
- /* miniDiSEqC/Toneburst commands are defined only for up to 2 sattelites */
- if (parms->p.sat_number < 2) {
- rc = dvb_fe_diseqc_burst(&parms->p, parms->p.sat_number);
- if (rc)
+ if (!t)
+ rc = dvbsat_diseqc_write_to_port_group(parms, &cmd, high_band,
+ pol_v, sat_number);
+ else
+ rc = dvbsat_scr_odu_channel_change(parms, &cmd, high_band,
+ pol_v, sat_number, t);
+
+ if (rc) {
+ dvb_logerr(_("sending diseq failed"));
return rc;
- }
- usleep(15 * 1000);
+ }
+ usleep((15 + parms->p.diseqc_wait) * 1000);
+
+ /* miniDiSEqC/Toneburst commands are defined only for up to 2 sattelites */
+ if (parms->p.sat_number < 2) {
+ rc = dvb_fe_diseqc_burst(&parms->p, parms->p.sat_number);
+ if (rc)
+ return rc;
+ }
+ usleep(15 * 1000);
}
rc = dvb_fe_sec_tone(&parms->p, tone_on ? SEC_TONE_ON : SEC_TONE_OFF);
--
2.13.6
next reply other threads:[~2017-11-24 8:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-24 8:52 Maksym Veremeyenko [this message]
2017-11-27 19:26 ` [PATCH/RFC] not use a DiSEqC switch Mauro Carvalho Chehab
2017-12-13 13:25 ` Mauro Carvalho Chehab
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=b5573a09-f841-d126-df19-0ecc76d15511@m1stereo.tv \
--to=verem@m1stereo.tv \
--cc=linux-media@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).