]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: add 'Higher LNB voltage' option to the satconf, fixes #5199
authorJaroslav Kysela <perex@perex.cz>
Wed, 12 Sep 2018 06:59:29 +0000 (08:59 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 12 Sep 2018 06:59:37 +0000 (08:59 +0200)
src/input/mpegts/linuxdvb/linuxdvb_private.h
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index 41b9845b87a44454b750d7b19e7b8d224b552c53..b60481297ce732442b5a87e04c339a33995f9925 100644 (file)
@@ -252,6 +252,7 @@ struct linuxdvb_satconf
    * LNB settings
    */
   int                    ls_lnb_poweroff;
+  int                    ls_lnb_highvol;
   uint32_t               ls_max_rotor_move;
   uint32_t               ls_min_rotor_move;
   double                 ls_site_lat;
index be41fcbd41e15d985c6e391addd43f9b6b1d6986..0a55d318e73ff2096b1f998c3959a44109c5c78b 100644 (file)
@@ -224,6 +224,17 @@ linuxdvb_satconf_class_get_childs ( idnode_t *o )
   return is;
 }
 
+static htsmsg_t *
+linuxdvb_satconf_class_highvol_list ( void *o, const char *lang )
+{
+  static const struct strtab tab[] = {
+    { N_("Do not set"),  0 },
+    { N_("Normal"), 1 },
+    { N_("Higher"), 2 }
+  };
+  return strtab2htsmsg(tab, 1, lang);
+}
+
 /*
  * Generic satconf
  */
@@ -295,6 +306,21 @@ const idclass_t linuxdvb_satconf_class =
       .opts     = PO_ADVANCED,
       .def.i    = 1
     },
+    {
+      .type     = PT_INT,
+      .id       = "lnb_highvol",
+      .name     = N_("Higher LNB voltage"),
+      .desc     = N_("Some DVB devices have an optional ioctl that allows "
+                     "changing between normal voltage for LNB (13V/18V) to "
+                     "a higher voltage mode (usually, 14V/19V), meant to "
+                     "compensate for voltage loss on long cabling. "
+                     "Without that, it is not possible to properly switch "
+                     "the polarization."),
+      .list     = linuxdvb_satconf_class_highvol_list,
+      .off      = offsetof(linuxdvb_satconf_t, ls_lnb_highvol),
+      .opts     = PO_ADVANCED,
+      .def.i    = 1
+    },
     {}
   }
 };
@@ -1777,6 +1803,13 @@ linuxdvb_diseqc_set_volt ( linuxdvb_satconf_t *ls, int vol )
   /* Already set ? */
   if (vol >= 0 && ls->ls_last_vol == vol + 1)
     return 0;
+  /* High voltage handling */
+  if (ls->ls_lnb_highvol > 0) {
+    int v = ls->ls_lnb_highvol > 1 ? 1 : 0;
+    tvhtrace(LS_DISEQC, "set hight voltage %d", v);
+    if (ioctl(linuxdvb_satconf_fe_fd(ls), FE_ENABLE_HIGH_LNB_VOLTAGE, v))
+      tvherror(LS_DISEQC, "failed to set high voltage %d (e=%s)", v, strerror(errno));
+  }
   /* Set voltage */
   tvhtrace(LS_DISEQC, "set voltage %dV", vol ? (vol < 0 ? 0 : 18) : 13);
   if (ioctl(linuxdvb_satconf_fe_fd(ls), FE_SET_VOLTAGE,