Commit 04bb8e32 authored by Zoran Turalija's avatar Zoran Turalija Committed by Rémi Denis-Courmont

Add support for uncommitted diseqc switch. - Take #2

This supports configurations that use uncommitted diseqc switch
in front of committed diseqc switch to allow 8/16 satellites...

Example of such cascade:

      19.2E  13E    16E  1W      5E 28.2E  23.5E 30W
          \   |      |   /        \   |      |   /
           \1  \2  3/  4/          \1  \2  3/  4/
         +--o---o--o---o--+      +--o---o--o---o--+ LNB (:dvb-satno n)
         | SPAUN SAR 411F |      | SPAUN SAR 411F |
         |    committed   |      |    committed   |
         +-----------o----+      +----o-----------+
                      \              /
                       \1          2/     sat:  switches:
         PORT        +--o----------o--+ 19.2E:  :dvb-uncommitted=1 :dvb-satno=1
(:dvb-uncommitted=n) | SPAUN SUR 211F |   13E:  :dvb-uncommitted=1 :dvb-satno=2
                     |  uncommitted   |   16E:  :dvb-uncommitted=1 :dvb-satno=3
                     +-------o--------+    1W:  :dvb-uncommitted=1 :dvb-satno=4
                             |             5E:  :dvb-uncommitted=2 :dvb-satno=1
                      +------o------+   28.2E:  :dvb-uncommitted=2 :dvb-satno=2
                      | skystar HD2 |   23.5E:  :dvb-uncommitted=2 :dvb-satno=3
                      +-------------+     30W:  :dvb-uncommitted=2 :dvb-satno=4

Reception of 16 satellites is possible using eg. SPAUN SUR 420F as uncommitted
diseqc switch instead of SPAUN SUR 211F, and 2 more SPAUN SAR 411F committed
diseqc switches.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent f03a6073
...@@ -206,6 +206,14 @@ static const char *const satno_user[] = { N_("Unspecified"), ...@@ -206,6 +206,14 @@ static const char *const satno_user[] = { N_("Unspecified"),
"A/1", "B/2", "C/3", "D/4" }; "A/1", "B/2", "C/3", "D/4" };
#endif #endif
#define UNCOMMITTED_TEXT N_("Uncommitted DiSEqC LNB 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). " \
"If there is no uncommitted switch, this parameter should be 0.")
/* BDA module additional DVB-S Parameters */ /* BDA module additional DVB-S Parameters */
#define NETID_TEXT N_("Network identifier") #define NETID_TEXT N_("Network identifier")
#define AZIMUTH_TEXT N_("Satellite azimuth") #define AZIMUTH_TEXT N_("Satellite azimuth")
...@@ -388,6 +396,8 @@ vlc_module_begin () ...@@ -388,6 +396,8 @@ vlc_module_begin ()
#ifdef __linux__ #ifdef __linux__
add_integer ("dvb-satno", 0, SATNO_TEXT, SATNO_LONGTEXT, true) add_integer ("dvb-satno", 0, SATNO_TEXT, SATNO_LONGTEXT, true)
change_integer_list (satno_vlc, satno_user) change_integer_list (satno_vlc, satno_user)
add_integer ("dvb-uncommitted", 0, UNCOMMITTED_TEXT, UNCOMMITTED_LONGTEXT, true)
change_integer_list (satno_vlc, satno_user)
add_integer ("dvb-tone", -1, TONE_TEXT, TONE_LONGTEXT, true) add_integer ("dvb-tone", -1, TONE_TEXT, TONE_LONGTEXT, true)
change_integer_list (auto_off_on_vlc, auto_off_on_user) change_integer_list (auto_off_on_vlc, auto_off_on_user)
#endif #endif
......
...@@ -772,21 +772,56 @@ known: ...@@ -772,21 +772,56 @@ known:
unsigned satno = var_InheritInteger (d->obj, "dvb-satno"); unsigned satno = var_InheritInteger (d->obj, "dvb-satno");
if (satno > 0) if (satno > 0)
{ {
/* DiSEqC 1.0 */
#undef msleep /* we know what we are doing! */ #undef msleep /* we know what we are doing! */
/* DiSEqC Bus Specification:
http://www.eutelsat.com/satellites/pdf/Diseqc/Reference%20docs/bus_spec.pdf */
/* DiSEqC 1.1 */
struct dvb_diseqc_master_cmd uncmd;
/* DiSEqC 1.0 */
struct dvb_diseqc_master_cmd cmd; struct dvb_diseqc_master_cmd cmd;
satno = (satno - 1) & 3; satno = (satno - 1) & 3;
cmd.msg[0] = 0xE0; /* framing: master, no reply, 1st TX */ cmd.msg[0] = 0xE0; /* framing: master, no reply, 1st TX */
cmd.msg[1] = 0x10; /* address: all LNB/switch */ cmd.msg[1] = 0x10; /* address: all LNB/switch */
cmd.msg[2] = 0x38; /* command: Write Port Group 0 */ cmd.msg[2] = 0x38; /* command: Write Port Group 0 (committed) */
cmd.msg[3] = 0xF0 /* data[0]: clear all bits */ cmd.msg[3] = 0xF0 /* data[0]: clear all bits */
| (satno << 2) /* LNB (A, B, C or D) */ | (satno << 2) /* LNB (A, B, C or D) */
| ((voltage == SEC_VOLTAGE_18) << 1) /* polarization */ | ((voltage == SEC_VOLTAGE_18) << 1) /* polarization */
| (tone == SEC_TONE_ON); /* option */ | (tone == SEC_TONE_ON); /* option */
cmd.msg[4] = cmd.msg[5] = 0; /* unused */ cmd.msg[4] = cmd.msg[5] = 0; /* unused */
cmd.msg_len = 4; /* length*/ cmd.msg_len = 4; /* length*/
msleep (15000); /* wait 15 ms before DiSEqC command */ msleep (15000); /* wait 15 ms before DiSEqC command */
unsigned uncommitted = var_InheritInteger (d->obj, "dvb-uncommitted");
if (uncommitted > 0)
{
uncommitted = (uncommitted - 1) & 3;
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 */
uncmd.msg[4] = uncmd.msg[5] = 0; /* unused */
uncmd.msg_len = 4; /* length*/
if (ioctl (d->frontend, FE_DISEQC_SEND_MASTER_CMD, &uncmd) < 0)
{
msg_Err (d->obj, "cannot send DiSEqC command: %m");
return -1;
}
/* Repeat uncommitted command */
uncmd.msg[0] = 0xE1; /* framing: master, no reply, repeated TX */
if (ioctl (d->frontend, FE_DISEQC_SEND_MASTER_CMD, &uncmd) < 0)
{
msg_Err (d->obj, "cannot send DiSEqC command: %m");
return -1;
}
msleep(125000); /* wait 125 ms before committed DiSEqC command */
}
if (ioctl (d->frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd) < 0) if (ioctl (d->frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd) < 0)
{ {
msg_Err (d->obj, "cannot send DiSEqC command: %m"); msg_Err (d->obj, "cannot send DiSEqC command: %m");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment