From: Jaroslav Kysela Date: Wed, 12 Sep 2018 06:59:29 +0000 (+0200) Subject: linuxdvb: add 'Higher LNB voltage' option to the satconf, fixes #5199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36e93e178c3a7134f26b12c1197b7b9f49d9cd57;p=thirdparty%2Ftvheadend.git linuxdvb: add 'Higher LNB voltage' option to the satconf, fixes #5199 --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_private.h b/src/input/mpegts/linuxdvb/linuxdvb_private.h index 6341bf848..5956c08fc 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_private.h +++ b/src/input/mpegts/linuxdvb/linuxdvb_private.h @@ -260,6 +260,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; diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index a6f37b06e..f50b7d207 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -225,6 +225,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 */ @@ -296,6 +307,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 + }, {} } }; @@ -1780,6 +1806,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,