[vlc-devel] [PATCH] dtv multisat: Extend support for up to 16 uncommitted ports.
Rémi Denis-Courmont
remi at remlab.net
Wed Nov 23 10:09:21 CET 2016
On November 20, 2016 7:12:30 PM GMT+02:00, Zoran Turalija <zoran.turalija at gmail.com> wrote:
>This will allow support for up to 64 satellites.
>
>There are some 8/10 port DiSEqC switches, that act
>as an uncommitted switch or a combination of committed
>and uncommitted switches. Later is already supported,
>and with this change we support former.
>
>If used switch acts as eg. 10-port uncommitted switch,
>one can now tune to a satellite on port 6 using vlc
>switch:
>
> :dvb-uncommitted=6
>
>Of course, using more conventional equipment or a switch
>that combines committed and uncommitted switches within
>itself, a setup would consist of 4 committed ports located
>under first two uncommitted ports, and 2 more committed
>ports under third uncommitted port.
>
>This kind of setup is already supported, and tuning to
>satellite on "port 6" was/is possible using vlc switches:
>
> :dvb-uncommitted=2 :dvb-satno=2
>---
> modules/access/dtv/access.c | 17 ++++++++++++-----
> modules/access/dtv/linux.c | 6 ++----
> 2 files changed, 14 insertions(+), 9 deletions(-)
>
>diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
>index 4623ad3..c0b02c2 100644
>--- a/modules/access/dtv/access.c
>+++ b/modules/access/dtv/access.c
>@@ -208,13 +208,20 @@ static const char *const satno_user[] = {
>N_("Unspecified"),
> "A/1", "B/2", "C/3", "D/4" };
> #endif
>
>-#define UNCOMMITTED_TEXT N_("Uncommitted DiSEqC LNB number")
>+#define UNCOMMITTED_TEXT N_("Uncommitted DiSEqC port number")
> #define UNCOMMITTED_LONGTEXT N_( \
> "If the satellite receiver is connected to multiple " \
>- "low noise block-downconverters (LNB) through a cascade formed
>from " \
>- "DiSEqC 1.1 uncommitted switch and DiSEqC 1.0 committed switch, "
>\
>- "the correct uncommitted LNB can be selected (1 to 4). " \
>+ "low noise block-downconverters (LNB) through a cascade(s) formed
>from " \
>+ "DiSEqC 1.1 uncommitted switch and DiSEqC 1.0 committed
>switch(es), " \
>+ "the correct uncommitted port can be selected (1 to 16). " \
> "If there is no uncommitted switch, this parameter should be 0.")
>+#ifdef HAVE_LINUX_DVB
>+static const int uncommitted_vlc[] = { 0,
>+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
>+static const char *const uncommitted_user[] = { N_("Unspecified"),
>+ "1", "2", "3", "4", "5", "6", "7", "8",
>+ "9", "10", "11", "12", "13", "14", "15", "16" };
>+#endif
>
> /* BDA module additional DVB-S Parameters */
> #define NETID_TEXT N_("Network identifier")
>@@ -403,7 +410,7 @@ vlc_module_begin ()
> change_integer_list (satno_vlc, satno_user)
> change_safe ()
>add_integer ("dvb-uncommitted", 0, UNCOMMITTED_TEXT,
>UNCOMMITTED_LONGTEXT, true)
>- change_integer_list (satno_vlc, satno_user)
>+ change_integer_list (uncommitted_vlc, uncommitted_user)
> change_safe ()
> add_integer ("dvb-tone", -1, TONE_TEXT, TONE_LONGTEXT, true)
> change_integer_list (auto_off_on_vlc, auto_off_on_user)
>diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
>index 6e21e72..41ddcb9 100644
>--- a/modules/access/dtv/linux.c
>+++ b/modules/access/dtv/linux.c
>@@ -848,14 +848,12 @@ known:
> unsigned uncommitted = var_InheritInteger (d->obj, "dvb-uncommitted");
> if (uncommitted > 0)
> {
>- uncommitted = (uncommitted - 1) & 3;
>+ uncommitted = (uncommitted - 1) & 15;
> uncmd.msg[0] = 0xE0; /* framing: master, no reply, 1st TX */
> uncmd.msg[1] = 0x10; /* address: all LNB/switch */
> uncmd.msg[2] = 0x39; /* command: Write Port Group 1 (uncommitted) */
> uncmd.msg[3] = 0xF0 /* data[0]: clear all bits */
>- | (uncommitted << 2) /* LNB (A, B, C or D) */
>- | ((voltage == SEC_VOLTAGE_18) << 1) /*
>polarization */
>- | (tone == SEC_TONE_ON); /* option */
>+ | uncommitted; /* port (1..16) */
> uncmd.msg[4] = uncmd.msg[5] = 0; /* unused */
> uncmd.msg_len = 4; /* length */
> if (ioctl (d->frontend, FE_DISEQC_SEND_MASTER_CMD, &uncmd) < 0)
>--
>2.7.4
>
>
>--
>Kind regards,
>Zoran Turalija
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
Hello,
Use an integer range instead of a table of contiguous values... ?
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list