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


From 57ac346433720c0c9b8ce30a32bdfa1df075fede Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@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

From c700e3db0c855a2675b340e1ee1646678b19bcc6 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@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

Reply via email to