minisatip/minisatip5: add unicable groups, -Z option for quattro lo/hi filter

This commit is contained in:
Jaroslav Kysela 2016-02-20 23:11:40 +01:00
parent 385e26f04d
commit 250605a442
2 changed files with 175 additions and 106 deletions

View File

@ -1,5 +1,5 @@
diff --git a/adapter.c b/adapter.c
index 285faea..da18c74 100755
index 285faea..97cb45d 100755
--- a/adapter.c
+++ b/adapter.c
@@ -29,10 +29,15 @@
@ -246,7 +246,7 @@ index 285faea..da18c74 100755
char buf[100], *arg[20], *sep1, *sep2;
strncpy(buf, o, sizeof(buf));
@@ -839,17 +920,47 @@ void set_unicable_adapters(char *o, int type)
@@ -839,17 +920,67 @@ void set_unicable_adapters(char *o, int type)
sep2 = strchr(arg[i], '-');
if( !sep1 || !sep2)
continue;
@ -291,11 +291,31 @@ index 285faea..da18c74 100755
+ a[b_id].slave = a_id + 1;
+ LOG("Setting adapter %d as master for adapter %d", a_id, b_id);
+ }
+}
+
+void set_unicable_input(char *o)
+{
+ int i, la, input, input2;
+ char buf[100], *arg[20], *sep1;
+
+ strncpy(buf, o, sizeof(buf)-1);
+ buf[sizeof(buf)-1] = '\0';
+ la = split(arg, buf, sizeof(arg), ',');
+ for (i=input=0; i < 4; i++)
+ {
+ if (i < la) {
+ input2=map_intd(arg[i], NULL, -1);
+ if (input2 >= 0 && input2 < 4)
+ input = input2;
+ }
+ opts.axe_unicinp[i] = input;
+ LOG("Setting input %d for unicable adapter %d", input, i);
+ }
+}
int delsys_match(adapter *ad, int del_sys)
{
@@ -866,3 +977,71 @@ int delsys_match(adapter *ad, int del_sys)
@@ -866,3 +997,71 @@ int delsys_match(adapter *ad, int del_sys)
return 0;
}
@ -368,7 +388,7 @@ index 285faea..da18c74 100755
+}
+#endif
diff --git a/adapter.h b/adapter.h
index 629bd9c..d95e59a 100755
index 629bd9c..2b435fb 100755
--- a/adapter.h
+++ b/adapter.h
@@ -45,6 +45,7 @@ typedef struct struct_adapter
@ -379,14 +399,16 @@ index 629bd9c..d95e59a 100755
} adapter;
int init_hw ();
@@ -65,6 +66,7 @@ void dump_pids (int aid);
@@ -65,7 +66,8 @@ void dump_pids (int aid);
void sort_pids (int aid);
void enable_adapters(char *o);
void set_unicable_adapters(char *o, int type);
-
+void set_link_adapters(char *o);
+void set_unicable_input(char *o);
int delsys_match(adapter *ad, int del_sys);
#define get_adapter(a) get_adapter1(a, __FILE__, __LINE__)
diff --git a/axe.h b/axe.h
new file mode 100644
index 0000000..cfc1927
@ -543,7 +565,7 @@ index 0000000..cfc1927
+
+#endif
diff --git a/dvb.c b/dvb.c
index 5701bd2..32fd683 100755
index 5701bd2..d143387 100755
--- a/dvb.c
+++ b/dvb.c
@@ -41,6 +41,10 @@
@ -662,7 +684,7 @@ index 5701bd2..32fd683 100755
if (freq < SLOF)
{
freq = (freq - LOF1);
@@ -330,12 +371,100 @@ int setup_switch (int frontend_fd, transponder *tp)
@@ -330,12 +371,108 @@ int setup_switch (int frontend_fd, transponder *tp)
hiband = 1;
}
@ -721,6 +743,14 @@ index 5701bd2..32fd683 100755
+ }
+ }
+ if (ad && opts.quattro) {
+ if (opts.quattro_hiband == 1 && hiband) {
+ LOG("axe_fe: hiband is not allowed for quattro config (adapter %d)", input);
+ return 0;
+ }
+ if (opts.quattro_hiband == 2 && !hiband) {
+ LOG("axe_fe: lowband is not allowed for quattro config (adapter %d)", input);
+ return 0;
+ }
+ input = ((hiband ^ 1) << 1) | (pol ^ 1);
+ adm = get_adapter(input);
+ if (adm == NULL) {
@ -735,7 +765,7 @@ index 5701bd2..32fd683 100755
+ }
+ }
+ } else {
+ input = opts.axe_unicinp;
+ input = opts.axe_unicinp[input & 3];
+ ad = get_adapter(input);
+ if (ad == NULL) {
+ LOGL(3, "axe setup: unable to find adapter %d", input);
@ -763,7 +793,7 @@ index 5701bd2..32fd683 100755
}else
{
if(tp->old_pol != pol || tp->old_hiband != hiband || tp->old_diseqc != diseqc)
@@ -343,6 +472,16 @@ int setup_switch (int frontend_fd, transponder *tp)
@@ -343,6 +480,16 @@ int setup_switch (int frontend_fd, transponder *tp)
else
LOGL(3, "Skip sending diseqc commands since the switch position doesn't need to be changed: pol %d, hiband %d, switch position %d", pol, hiband, diseqc);
}
@ -780,7 +810,7 @@ index 5701bd2..32fd683 100755
tp->old_pol = pol;
tp->old_hiband = hiband;
@@ -383,8 +522,10 @@ tune_it_s2 (int fd_frontend, transponder * tp)
@@ -383,8 +530,10 @@ tune_it_s2 (int fd_frontend, transponder * tp)
{.cmd = DTV_INVERSION,.u.data = 0},
{.cmd = DTV_SYMBOL_RATE,.u.data = 0},
{.cmd = DTV_INNER_FEC,.u.data = 0},
@ -791,7 +821,7 @@ index 5701bd2..32fd683 100755
{.cmd = DTV_TUNE},
};
static struct dtv_properties dvbs2_cmdseq =
@@ -462,11 +603,15 @@ tune_it_s2 (int fd_frontend, transponder * tp)
@@ -462,11 +611,15 @@ tune_it_s2 (int fd_frontend, transponder * tp)
tp->mtype = QPSK;
bpol = getTick();
if_freq = setup_switch (fd_frontend, tp);
@ -807,7 +837,7 @@ index 5701bd2..32fd683 100755
p->props[INVERSION].u.data = tp->inversion;
p->props[SYMBOL_RATE].u.data = tp->sr;
p->props[FEC_INNER].u.data = tp->fec;
@@ -475,7 +620,12 @@ tune_it_s2 (int fd_frontend, transponder * tp)
@@ -475,7 +628,12 @@ tune_it_s2 (int fd_frontend, transponder * tp)
LOG("tuning to %d(%d) pol: %s (%d) sr:%d fec:%s delsys:%s mod:%s rolloff:%s pilot:%s, ts clear=%d, ts pol=%d",
tp->freq, p->props[FREQUENCY].u.data, get_pol(tp->pol), tp->pol, p->props[SYMBOL_RATE].u.data, fe_fec[p->props[FEC_INNER].u.data],
fe_delsys[p->props[DELSYS].u.data], fe_modulation[p->props[MODULATION].u.data],
@ -821,7 +851,7 @@ index 5701bd2..32fd683 100755
break;
@@ -560,6 +710,20 @@ set_pid (int hw, int ad, uint16_t i_pid)
@@ -560,6 +718,20 @@ set_pid (int hw, int ad, uint16_t i_pid)
char buf[100];
int fd;
@ -842,7 +872,7 @@ index 5701bd2..32fd683 100755
if ( i_pid > 8192 )
LOG_AND_RETURN(-1, "pid %d > 8192 for /dev/dvb/adapter%d/demux%d", i_pid, hw, ad);
@@ -585,6 +749,7 @@ set_pid (int hw, int ad, uint16_t i_pid)
@@ -585,6 +757,7 @@ set_pid (int hw, int ad, uint16_t i_pid)
}
LOG ("setting filter on PID %d for fd %d", i_pid, fd);
@ -850,7 +880,7 @@ index 5701bd2..32fd683 100755
return fd;
}
@@ -592,6 +757,17 @@ set_pid (int hw, int ad, uint16_t i_pid)
@@ -592,6 +765,17 @@ set_pid (int hw, int ad, uint16_t i_pid)
int del_filters (int fd, int pid)
{
@ -868,7 +898,7 @@ index 5701bd2..32fd683 100755
if (fd < 0)
LOG_AND_RETURN(0, "DMX_STOP on an invalid handle %d, pid %d", fd, pid);
if (ioctl (fd, DMX_STOP) < 0)
@@ -599,6 +775,7 @@ int del_filters (int fd, int pid)
@@ -599,6 +783,7 @@ int del_filters (int fd, int pid)
else
LOG ("clearing filters on PID %d FD %d", pid, fd);
close (fd);
@ -876,7 +906,7 @@ index 5701bd2..32fd683 100755
return 0;
}
@@ -606,6 +783,15 @@ int del_filters (int fd, int pid)
@@ -606,6 +791,15 @@ int del_filters (int fd, int pid)
fe_delivery_system_t
dvb_delsys (int aid, int fd, fe_delivery_system_t *sys)
{
@ -892,7 +922,7 @@ index 5701bd2..32fd683 100755
int i, res, rv = 0;
struct dvb_frontend_info fe_info;
@@ -703,6 +889,7 @@ dvb_delsys (int aid, int fd, fe_delivery_system_t *sys)
@@ -703,6 +897,7 @@ dvb_delsys (int aid, int fd, fe_delivery_system_t *sys)
LOG ("returning default from dvb_delsys => %s (count %d)", fe_delsys[rv] , nsys);
return (fe_delivery_system_t) rv;
@ -901,7 +931,7 @@ index 5701bd2..32fd683 100755
}
diff --git a/minisatip.c b/minisatip.c
index d4076ba..dad15ae 100755
index d4076ba..fcf5a5c 100755
--- a/minisatip.c
+++ b/minisatip.c
@@ -36,6 +36,7 @@
@ -912,7 +942,7 @@ index d4076ba..dad15ae 100755
#include "socketworks.h"
#include "stream.h"
#include "adapter.h"
@@ -62,10 +63,16 @@ usage ()
@@ -62,10 +63,17 @@ usage ()
-c X: bandwidth capping for the output to the network (default: unlimited)\n\
-b X: set the DVR buffer to X KB (default: %dKB)\n\
-l increases the verbosity (you can use multiple -l), logging to stdout in foreground mode or in /tmp/log when a daemon\n\
@ -924,12 +954,13 @@ index d4076ba..dad15ae 100755
-j jess_string: same format as unicable_string \n\
+ -L link adapters (identical src,lo/hi,h/v), the format is M:S (master:slave)\n\
+ -Q quattro LNB config (H/H,H/V,L/H,L/V)\n\
+ -X AXE unicable/jess input (0-3)\n\
+ -Z X: enable loband (0) or hiband (1) only for quattro LNB\n\
+ -X X[,Y]: AXE unicable/jess input (0-3) for all tuners\n\
+ -M X: skip initial MPEG-TS packets for AXE demuxer (default 35)\n\
",
DVR_BUFFER / 1024);
exit (1);
@@ -97,11 +104,12 @@ set_options (int argc, char *argv[])
@@ -97,11 +105,12 @@ set_options (int argc, char *argv[])
opts.device_id = 0;
opts.bootid = 0;
opts.force_scan = 0;
@ -940,11 +971,11 @@ index d4076ba..dad15ae 100755
memset(opts.playlist, sizeof(opts.playlist), 0);
- while ((opt = getopt (argc, argv, "flr:a:t:d:w:p:shc:b:m:p:e:x:u:j:")) != -1)
+ while ((opt = getopt (argc, argv, "flr:a:t:d:w:p:shc:b:m:p:e:x:u:j:gL:QX:S:")) != -1)
+ while ((opt = getopt (argc, argv, "flr:a:t:d:w:p:shc:b:m:p:e:x:u:j:gL:QZ:X:S:")) != -1)
{
// printf("options %d %c %s\n",opt,opt,optarg);
switch (opt)
@@ -143,6 +151,12 @@ set_options (int argc, char *argv[])
@@ -143,6 +152,12 @@ set_options (int argc, char *argv[])
break;
}
@ -957,7 +988,7 @@ index d4076ba..dad15ae 100755
case HELP_OPT:
{
usage ();
@@ -164,6 +178,10 @@ set_options (int argc, char *argv[])
@@ -164,6 +179,10 @@ set_options (int argc, char *argv[])
case DVRBUFFER_OPT:
{
opts.dvr = atoi (optarg) * 1024;
@ -968,7 +999,7 @@ index d4076ba..dad15ae 100755
break;
}
@@ -209,6 +227,37 @@ set_options (int argc, char *argv[])
@@ -209,6 +228,39 @@ set_options (int argc, char *argv[])
break;
}
@ -984,13 +1015,15 @@ index d4076ba..dad15ae 100755
+ break;
+ }
+
+ case QUATTRO_HIBAND_OPT:
+ {
+ opts.quattro_hiband = atoi(optarg) + 1;
+ break;
+ }
+
+ case AXE_UNICINP_OPT:
+ {
+ opts.axe_unicinp = atoi(optarg);
+ if (opts.axe_unicinp < 0 || opts.axe_unicinp > 3) {
+ LOG("unicable input %d out of range, using 0", opts.axe_unicinp);
+ opts.axe_unicinp = 0;
+ }
+ set_unicable_input(optarg);
+ break;
+ }
+
@ -1006,7 +1039,7 @@ index d4076ba..dad15ae 100755
}
}
@@ -483,6 +532,11 @@ http_response (sockets *s, int rc, char *ah, char *desc, int cseq, int lr)
@@ -483,6 +535,11 @@ http_response (sockets *s, int rc, char *ah, char *desc, int cseq, int lr)
#define RBUF 4000
@ -1018,7 +1051,7 @@ index d4076ba..dad15ae 100755
int
read_rtsp (sockets * s)
{
@@ -507,8 +561,7 @@ read_rtsp (sockets * s)
@@ -507,8 +564,7 @@ read_rtsp (sockets * s)
}
}
@ -1028,7 +1061,7 @@ index d4076ba..dad15ae 100755
{
if( s->rlen > RBUF - 10 )
{
@@ -524,6 +577,9 @@ read_rtsp (sockets * s)
@@ -524,6 +580,9 @@ read_rtsp (sockets * s)
return 0;
}
@ -1038,7 +1071,7 @@ index d4076ba..dad15ae 100755
rlen = s->rlen;
s->rlen = 0;
@@ -726,8 +782,7 @@ read_http (sockets * s)
@@ -726,8 +785,7 @@ read_http (sockets * s)
"%s"
"</device></root>";
@ -1048,7 +1081,7 @@ index d4076ba..dad15ae 100755
{
if( s->rlen > RBUF - 10 )
{
@@ -749,6 +804,9 @@ read_http (sockets * s)
@@ -749,6 +807,9 @@ read_http (sockets * s)
return 0;
}
@ -1058,7 +1091,7 @@ index d4076ba..dad15ae 100755
rlen = s->rlen;
s->rlen = 0;
@@ -781,6 +839,15 @@ read_http (sockets * s)
@@ -781,6 +842,15 @@ read_http (sockets * s)
return 0;
}
@ -1074,7 +1107,7 @@ index d4076ba..dad15ae 100755
if (strncmp (arg[1], "/icons/", 7) == 0)
{
char *ctype = NULL;
@@ -904,6 +971,9 @@ ssdp_reply (sockets * s)
@@ -904,6 +974,9 @@ ssdp_reply (sockets * s)
return 0;
}
@ -1084,7 +1117,7 @@ index d4076ba..dad15ae 100755
// not my uuid
LOG("Received SSDP packet from %s:%d -> handle %d", inet_ntoa(s->sa.sin_addr), ntohs(s->sa.sin_port), s->sock);
LOGL(3, "%s", s->buf);
@@ -987,7 +1057,13 @@ main (int argc, char *argv[])
@@ -987,7 +1060,13 @@ main (int argc, char *argv[])
set_options (argc, argv);
if (opts.daemon)
becomeDaemon ();
@ -1098,7 +1131,7 @@ index d4076ba..dad15ae 100755
readBootID();
if ((ssdp = udp_bind (NULL, 1900)) < 1)
FAIL ("SSDP: Could not bind on udp port 1900");
@@ -1021,7 +1097,9 @@ main (int argc, char *argv[])
@@ -1021,7 +1100,9 @@ main (int argc, char *argv[])
select_and_execute ();
unlink(PID_FILE);
free_all ();
@ -1109,7 +1142,7 @@ index d4076ba..dad15ae 100755
}
@@ -1247,12 +1325,16 @@ void _log(int level, char * file, int line, const char *fmt, ...) {
@@ -1247,12 +1328,16 @@ void _log(int level, char * file, int line, const char *fmt, ...) {
idx = 1;
else if ( idx < 0)
idx = 0;
@ -1129,7 +1162,7 @@ index d4076ba..dad15ae 100755
both = 0;
va_start(arg, fmt);
len += vsnprintf(output[idx] + len, sizeof(output[0]) - len, fmt, arg);
@@ -1271,9 +1353,9 @@ void _log(int level, char * file, int line, const char *fmt, ...) {
@@ -1271,9 +1356,9 @@ void _log(int level, char * file, int line, const char *fmt, ...) {
}
if(both){
@ -1142,7 +1175,7 @@ index d4076ba..dad15ae 100755
fflush(stdout);
}
diff --git a/minisatip.h b/minisatip.h
index 821e756..44ca0c9 100755
index 821e756..485be5d 100755
--- a/minisatip.h
+++ b/minisatip.h
@@ -9,7 +9,7 @@
@ -1154,19 +1187,20 @@ index 821e756..44ca0c9 100755
void set_options (int argc, char *argv[]);
@@ -30,6 +30,11 @@ void set_options (int argc, char *argv[]);
@@ -30,6 +30,12 @@ void set_options (int argc, char *argv[]);
#define ENABLE_ADAPTERS_OPT 'e'
#define UNICABLE_OPT 'u'
#define JESS_OPT 'j'
+#define SYSLOG_OPT 'g'
+#define LINK_OPT 'L'
+#define QUATTRO_OPT 'Q'
+#define QUATTRO_HIBAND_OPT 'Z'
+#define AXE_UNICINP_OPT 'X'
+#define AXE_SKIP_PKT 'M'
#define PID_FILE "/var/run/minisatip.pid"
struct struct_opts
@@ -39,6 +44,7 @@ struct struct_opts
@@ -39,6 +45,7 @@ struct struct_opts
char *disc_host; //discover host
char mac[13];
unsigned int log,
@ -1174,12 +1208,13 @@ index 821e756..44ca0c9 100755
start_rtp,
http_port;
int timeout_sec;
@@ -50,6 +56,9 @@ struct struct_opts
@@ -50,6 +57,10 @@ struct struct_opts
int dvr;
int force_scan;
int file_line;
+ int quattro;
+ int axe_unicinp;
+ int quattro_hiband;
+ int axe_unicinp[4];
+ int axe_skippkt;
char *last_log;
char playlist[200];

View File

@ -1,5 +1,5 @@
diff --git a/adapter.c b/adapter.c
index 033490a..36b3dfd 100644
index 033490a..d5ae166 100644
--- a/adapter.c
+++ b/adapter.c
@@ -49,6 +49,31 @@ extern struct struct_opts opts;
@ -312,7 +312,7 @@ index 033490a..36b3dfd 100644
}
}
@@ -1152,16 +1271,43 @@ void set_slave_adapters(char *o)
@@ -1152,16 +1271,63 @@ void set_slave_adapters(char *o)
for (j = a_id; j <= a_id2; j++)
{
if (!a[j])
@ -354,11 +354,31 @@ index 033490a..36b3dfd 100644
+ LOG("Setting adapter %d as master for adapter %d", a_id, b_id);
+ }
+}
+
+void set_unicable_input(char *o)
+{
+ int i, la, input, input2;
+ char buf[100], *arg[20], *sep1;
+
+ strncpy(buf, o, sizeof(buf)-1);
+ buf[sizeof(buf)-1] = '\0';
+ la = split(arg, buf, sizeof(arg), ',');
+ for (i=input=0; i < 4; i++)
+ {
+ if (i < la) {
+ input2=map_intd(arg[i], NULL, -1);
+ if (input2 >= 0 && input2 < 4)
+ input = input2;
+ }
+ opts.axe_unicinp[i] = input;
+ LOG("Setting input %d for unicable adapter %d", input, i);
+ }
+}
+
extern char *fe_delsys[];
void set_adapters_delsys(char *o)
{
@@ -1186,7 +1332,7 @@ void set_adapters_delsys(char *o)
@@ -1186,7 +1352,7 @@ void set_adapters_delsys(char *o)
ds = map_intd(sep + 1, fe_delsys, 0);
if (!a[a_id])
@ -367,7 +387,7 @@ index 033490a..36b3dfd 100644
ad = a[a_id];
ad->sys[0] = ds;
@@ -1371,42 +1517,24 @@ char *get_all_delsys(int aid, char *dest, int max_size)
@@ -1371,42 +1537,24 @@ char *get_all_delsys(int aid, char *dest, int max_size)
return dest;
}
@ -427,7 +447,7 @@ index 033490a..36b3dfd 100644
{ "ad_pids", VAR_FUNCTION_STRING, (void *) &get_adapter_pids, 0, 0, 0 },
{ "tuner_s2", VAR_INT, &tuner_s2, 1, 0, 0 },
diff --git a/adapter.h b/adapter.h
index e693479..b37c238 100644
index e693479..10b9b93 100644
--- a/adapter.h
+++ b/adapter.h
@@ -6,7 +6,11 @@
@ -471,13 +491,14 @@ index e693479..b37c238 100644
int set_adapter_for_stream(int i, int a);
void close_adapter_for_stream(int sid, int aid);
int set_adapter_parameters(int aid, int sid, transponder * tp);
@@ -128,7 +132,9 @@ void sort_pids(int aid);
@@ -128,7 +132,10 @@ void sort_pids(int aid);
void enable_adapters(char *o);
void set_unicable_adapters(char *o, int type);
void set_diseqc_adapters(char *o);
+void set_diseqc_timing(char *o);
void set_slave_adapters(char *o);
+void set_link_adapters(char *o);
+void set_unicable_input(char *o);
void reset_pids_type(int aid, int clear_pat);
void reset_ecm_type_for_key(int aid, int key);
int delsys_match(adapter *ad, int del_sys);
@ -637,7 +658,7 @@ index 0000000..d8b06bc
+
+#endif
diff --git a/dvb.c b/dvb.c
index 259b93d..8040849 100644
index 259b93d..3d6ef66 100644
--- a/dvb.c
+++ b/dvb.c
@@ -42,6 +42,11 @@
@ -898,7 +919,7 @@ index 259b93d..8040849 100644
{
int hiband = 0;
int diseqc = (tp->diseqc > 0) ? tp->diseqc - 1 : 0;
@@ -550,35 +583,129 @@ int setup_switch(int frontend_fd, transponder *tp)
@@ -550,35 +583,137 @@ int setup_switch(int frontend_fd, transponder *tp)
hiband = 1;
}
@ -950,6 +971,14 @@ index 259b93d..8040849 100644
+ }
+ }
+ if (ad && opts.quattro) {
+ if (opts.quattro_hiband == 1 && hiband) {
+ LOG("axe_fe: hiband is not allowed for quattro config (adapter %d)", input);
+ return 0;
+ }
+ if (opts.quattro_hiband == 2 && !hiband) {
+ LOG("axe_fe: lowband is not allowed for quattro config (adapter %d)", input);
+ return 0;
+ }
+ input = ((hiband ^ 1) << 1) | (pol ^ 1);
+ adm = get_adapter(input);
+ if (adm == NULL) {
@ -964,7 +993,7 @@ index 259b93d..8040849 100644
+ }
+ }
+ } else {
+ input = opts.axe_unicinp;
+ input = opts.axe_unicinp[ad->id & 3];
+ ad = get_adapter(input);
+ if (ad == NULL) {
+ LOGL(3, "axe setup: unable to find adapter %d", input);
@ -1044,7 +1073,7 @@ index 259b93d..8040849 100644
return freq;
}
@@ -611,6 +738,14 @@ int dvb_tune(int aid, transponder * tp)
@@ -611,6 +746,14 @@ int dvb_tune(int aid, transponder * tp)
memset(p_cmd, 0, sizeof(p_cmd));
bclear = getTick();
@ -1059,7 +1088,7 @@ index 259b93d..8040849 100644
if ((ioctl(fd_frontend, FE_SET_PROPERTY, &cmdseq_clear)) == -1)
{
LOG("FE_SET_PROPERTY DTV_CLEAR failed for fd %d: %s", fd_frontend,
@@ -624,14 +759,16 @@ int dvb_tune(int aid, transponder * tp)
@@ -624,14 +767,16 @@ int dvb_tune(int aid, transponder * tp)
case SYS_DVBS2:
bpol = getTick();
@ -1077,7 +1106,7 @@ index 259b93d..8040849 100644
#if DVBAPIVERSION >= 0x0502
ADD_PROP(DTV_STREAM_ID, tp->plp)
#endif
@@ -640,7 +777,12 @@ int dvb_tune(int aid, transponder * tp)
@@ -640,7 +785,12 @@ int dvb_tune(int aid, transponder * tp)
"tuning to %d(%d) pol: %s (%d) sr:%d fec:%s delsys:%s mod:%s rolloff:%s pilot:%s, ts clear=%d, ts pol=%d",
tp->freq, freq, get_pol(tp->pol), tp->pol, tp->sr,
fe_fec[tp->fec], fe_delsys[tp->sys], fe_modulation[tp->mtype],
@ -1091,7 +1120,7 @@ index 259b93d..8040849 100644
break;
case SYS_DVBT:
@@ -741,29 +883,46 @@ int dvb_tune(int aid, transponder * tp)
@@ -741,29 +891,46 @@ int dvb_tune(int aid, transponder * tp)
if (ioctl(fd_frontend, FE_SET_PROPERTY, &p) == -1)
{
LOG("dvb_tune: set property failed %d %s", errno, strerror(errno));
@ -1143,7 +1172,7 @@ index 259b93d..8040849 100644
return -1;
}
@@ -789,10 +948,22 @@ int dvb_set_pid(adapter *a, uint16_t i_pid)
@@ -789,10 +956,22 @@ int dvb_set_pid(adapter *a, uint16_t i_pid)
LOG("setting filter on PID %d for fd %d", i_pid, fd);
return fd;
@ -1166,7 +1195,7 @@ index 259b93d..8040849 100644
if (fd < 0)
LOG_AND_RETURN(0, "DMX_STOP on an invalid handle %d, pid %d", fd, pid);
if (ioctl(fd, DMX_STOP, NULL) < 0)
@@ -801,10 +972,20 @@ int dvb_del_filters(int fd, int pid)
@@ -801,10 +980,20 @@ int dvb_del_filters(int fd, int pid)
LOG("clearing filter on PID %d FD %d", pid, fd);
close(fd);
return 0;
@ -1187,7 +1216,7 @@ index 259b93d..8040849 100644
int i, res, rv = 0;
struct dvb_frontend_info fe_info;
@@ -893,6 +1074,7 @@ fe_delivery_system_t dvb_delsys(int aid, int fd, fe_delivery_system_t *sys)
@@ -893,6 +1082,7 @@ fe_delivery_system_t dvb_delsys(int aid, int fd, fe_delivery_system_t *sys)
fe_delsys[sys[i]], sys[i]);
return (fe_delivery_system_t) rv;
@ -1195,7 +1224,7 @@ index 259b93d..8040849 100644
}
@@ -1005,6 +1187,7 @@ void dvb_get_signal(adapter *ad)
@@ -1005,6 +1195,7 @@ void dvb_get_signal(adapter *ad)
ad->max_strength = (ad->strength > 0) ? ad->strength : 1;
if (ad->max_snr <= ad->snr)
ad->max_snr = (ad->snr > 0) ? ad->snr : 1;
@ -1203,7 +1232,7 @@ index 259b93d..8040849 100644
if (ad->snr > 4096)
new_gs = 0;
if (new_gs)
@@ -1017,6 +1200,14 @@ void dvb_get_signal(adapter *ad)
@@ -1017,6 +1208,14 @@ void dvb_get_signal(adapter *ad)
ad->strength = ad->strength >> 8;
ad->snr = ad->snr >> 8;
}
@ -1218,7 +1247,7 @@ index 259b93d..8040849 100644
}
void dvb_commit(adapter *a)
@@ -1024,6 +1215,33 @@ void dvb_commit(adapter *a)
@@ -1024,6 +1223,33 @@ void dvb_commit(adapter *a)
return;
}
@ -1252,7 +1281,7 @@ index 259b93d..8040849 100644
void find_dvb_adapter(adapter **a)
{
int na = 0;
@@ -1032,9 +1250,21 @@ void find_dvb_adapter(adapter **a)
@@ -1032,9 +1258,21 @@ void find_dvb_adapter(adapter **a)
int i = 0, j = 0;
adapter *ad;
@ -1274,7 +1303,7 @@ index 259b93d..8040849 100644
sprintf(buf, "/dev/dvb/adapter%d/frontend%d", i, j);
fd = open(buf, O_RDONLY | O_NONBLOCK);
if (fd < 0)
@@ -1042,7 +1272,8 @@ void find_dvb_adapter(adapter **a)
@@ -1042,7 +1280,8 @@ void find_dvb_adapter(adapter **a)
sprintf(buf, "/dev/dvb/adapter%d/ca%d", i, j);
fd = open(buf, O_RDONLY | O_NONBLOCK);
}
@ -1284,7 +1313,7 @@ index 259b93d..8040849 100644
if (fd >= 0)
{
// if (is_adapter_disabled(na))
@@ -1051,7 +1282,7 @@ void find_dvb_adapter(adapter **a)
@@ -1051,7 +1290,7 @@ void find_dvb_adapter(adapter **a)
// continue;
// }
if (!a[na])
@ -1293,7 +1322,7 @@ index 259b93d..8040849 100644
ad = a[na];
ad->pa = i;
@@ -1064,7 +1295,7 @@ void find_dvb_adapter(adapter **a)
@@ -1064,7 +1303,7 @@ void find_dvb_adapter(adapter **a)
ad->tune = (Tune) dvb_tune;
ad->delsys = (Dvb_delsys) dvb_delsys;
ad->post_init = NULL;
@ -1302,7 +1331,7 @@ index 259b93d..8040849 100644
ad->get_signal = (Device_signal) dvb_get_signal;
ad->type = ADAPTER_DVB;
close(fd);
@@ -1073,6 +1304,14 @@ void find_dvb_adapter(adapter **a)
@@ -1073,6 +1312,14 @@ void find_dvb_adapter(adapter **a)
if (na == MAX_ADAPTERS)
return;
}
@ -1520,7 +1549,7 @@ index c4c91c0..5ec0d29 100644
for(var j=0;j<max_streams;j++)
if(st_enabled[j]==1 && st_adapter[j]==i)
diff --git a/minisatip.c b/minisatip.c
index d6b26d3..b26be53 100644
index d6b26d3..7eb4ded 100644
--- a/minisatip.c
+++ b/minisatip.c
@@ -66,6 +66,7 @@ static const struct option long_options[] =
@ -1531,20 +1560,21 @@ index d6b26d3..b26be53 100644
#ifndef DISABLE_DVBCSA
{ "dvbapi", required_argument, NULL, 'o' },
#endif
@@ -86,6 +87,12 @@ static const struct option long_options[] =
@@ -86,6 +87,13 @@ static const struct option long_options[] =
{ "xml", required_argument, NULL, 'X' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
+#ifdef AXE
+ { "link_adapters", required_argument, NULL, 'L' },
+ { "quattro", required_argument, NULL, 'Q' },
+ { "quattro", no_argument, NULL, 'Q' },
+ { "quattro-hiband", required_argument, NULL, 'Z' },
+ { "axe-uinput", required_argument, NULL, 'U' },
+ { "skip-mpegts", required_argument, NULL, 'M' },
+#endif
{ 0, 0, 0, 0 } };
#define RRTP_OPT 'r'
@@ -105,6 +112,7 @@ static const struct option long_options[] =
@@ -105,6 +113,7 @@ static const struct option long_options[] =
#define UNICABLE_OPT 'u'
#define JESS_OPT 'j'
#define DISEQC_OPT 'd'
@ -1552,12 +1582,13 @@ index d6b26d3..b26be53 100644
#define SLAVE_OPT 'S'
#define DELSYS_OPT 'Y'
#define DVBAPI_OPT 'o'
@@ -117,12 +125,20 @@ static const struct option long_options[] =
@@ -117,12 +126,21 @@ static const struct option long_options[] =
#define DOCUMENTROOT_OPT 'R'
#define XML_OPT 'X'
#define THREADS_OPT 'T'
+#define LINK_OPT 'L'
+#define QUATTRO_OPT 'Q'
+#define QUATTRO_HIBAND_OPT 'Z'
+#define AXE_UNICINP_OPT 'U'
+#define AXE_SKIP_PKT 'M'
+
@ -1575,7 +1606,7 @@ index d6b26d3..b26be53 100644
if (!use_log)
puts(buf);
else
@@ -133,10 +149,19 @@ void usage()
@@ -133,10 +151,19 @@ void usage()
{
print_version(0);
printf(
@ -1599,7 +1630,7 @@ index d6b26d3..b26be53 100644
Help\n\
-------\n\
\n\
@@ -150,10 +175,16 @@ Help\n\
@@ -150,10 +177,16 @@ Help\n\
* -c X: bandwidth capping for the output to the network [default: unlimited]\n\
* eg: -c 2048 (does not allow minisatip to send more than 2048KB/s to all remote servers)\n\
\n\
@ -1620,7 +1651,7 @@ index d6b26d3..b26be53 100644
\n\
* -D --device-id DVC_ID: specify the device id (in case there are multiple SAT>IP servers in the network)\n \
* eg: -D 4 \n\
@@ -179,13 +210,23 @@ Help\n\
@@ -179,13 +212,23 @@ Help\n\
* -m xx: simulate xx as local mac address, generates UUID based on mac\n\
* eg: -m 001122334455 \n\
\n\
@ -1644,7 +1675,7 @@ index d6b26d3..b26be53 100644
* -p url: specify playlist url using X_SATIPM3U header \n\
* eg: -p http://192.168.2.3:8080/playlist\n\
- this will add X_SATIPM3U tag into the satip description xml\n\
@@ -195,6 +236,9 @@ Help\n\
@@ -195,6 +238,9 @@ Help\n\
\n\
* -R --document-root directory: document root for the minisatip web page and images\n\
\n\
@ -1654,7 +1685,7 @@ index d6b26d3..b26be53 100644
* -s --satip-servers DELSYS:host:port - specify the remote satip host and port with delivery system DELSYS, it is possible to use multiple -s \n\
* DELSYS - can be one of: dvbs, dvbs2, dvbt, dvbt2, dvbc, dvbc2, isdbt, atsc, dvbcb ( - DVBC_ANNEX_B ) [default: dvbs2]\n\
host - the server of the satip server\n\
@@ -204,6 +248,9 @@ Help\n\
@@ -204,6 +250,9 @@ Help\n\
- specifies 1 dvbt satip server with address 192.168.1.3:554\n\
- specifies 1 dvbc satip server with address 192.168.1.4:554\n\
\n\
@ -1664,15 +1695,11 @@ index d6b26d3..b26be53 100644
* -S --slave ADAPTER1,ADAPTER2-ADAPTER4[,..] - specify slave adapters \n\
* Allows specifying bonded adapters (multiple adapters connected with a splitter to the same LNB)\n\
Only one adapter needs to be master all others needs to have this parameter specified\n\
@@ -237,7 +284,26 @@ Help\n\
@@ -237,7 +286,28 @@ Help\n\
* eg: -y 5544 \n\
- changing this to a port > 1024 removes the requirement for minisatip to run as root\n\
\n\
-",
+* -L --link-adapters mapping_string: link adapters (identical src,lo/hi,h/v)\n\
+\t* The format is: M1:S1[,[M2:S2]] - master:slave\n\
+ * eg: 0:1,0:2,0:3 \n\
+\n\
+"
+#ifdef AXE
+"\
@ -1682,7 +1709,13 @@ index d6b26d3..b26be53 100644
+\n\
+* -Q --quattro quattro LNB config (H/H,H/V,L/H,L/V)\n\
+\n\
+* -U --axe-uinput adapterno: AXE unicable/jess input (0-3)\n\
+* -Z --quattro-hiband hiband\n\
+ * if hiband is 0, do not allow hiband\n\
+ * if hiband is 1, allow hiband\n\
+\n\
+* -U --axe-uinput adapterno[,adapterno2]: AXE unicable/jess input (0-3)\n\
+ * eg: 0,0,2,2 (two unicable connections at inputs 0 and 2)\n\
+ * (tuners 0,1: unicable input 0, tuners 2,3: unicable input 2)\n\
+\n\
+* -M --skip-mpegts packets: skip initial MPEG-TS packets for AXE demuxer (default 35)\n\
+\n\
@ -1692,7 +1725,7 @@ index d6b26d3..b26be53 100644
app_name,
ADAPTER_BUFFER,
DVR_BUFFER, opts.no_threads ? "DISABLED" : "ENABLED");
@@ -277,17 +343,24 @@ void set_options(int argc, char *argv[])
@@ -277,17 +347,24 @@ void set_options(int argc, char *argv[])
opts.satip_setup_pids = 0;
opts.output_buffer = 512 * 1024;
opts.satip_servers[0] = 0;
@ -1715,11 +1748,11 @@ index d6b26d3..b26be53 100644
while ((opt = getopt_long(argc, argv,
- "flr:a:td:w:p:s:n:hc:b:m:p:e:x:u:j:o:gy:i:D:VR:S:TX:Y:",
+ "flr:a:td:w:p:s:n:hc:b:m:p:e:x:u:j:o:gy:i:q:D:VR:S:TX:Y:L:QU:M:",
+ "flr:a:td:w:p:s:n:hc:b:m:p:e:x:u:j:o:gy:i:q:D:VR:S:TX:Y:L:QZ:U:M:",
long_options, NULL)) != -1)
{
// printf("options %d %c %s\n",opt,opt,optarg);
@@ -359,9 +432,12 @@ void set_options(int argc, char *argv[])
@@ -359,9 +436,12 @@ void set_options(int argc, char *argv[])
opts.adapter_buffer = (opts.adapter_buffer / 188) * 188;
if (opts.adapter_buffer < ADAPTER_BUFFER)
opts.adapter_buffer = ADAPTER_BUFFER;
@ -1733,7 +1766,7 @@ index d6b26d3..b26be53 100644
break;
}
@@ -410,6 +486,12 @@ void set_options(int argc, char *argv[])
@@ -410,6 +490,12 @@ void set_options(int argc, char *argv[])
break;
}
@ -1746,7 +1779,7 @@ index d6b26d3..b26be53 100644
case SLAVE_OPT:
{
set_slave_adapters(optarg);
@@ -508,6 +590,33 @@ void set_options(int argc, char *argv[])
@@ -508,6 +594,33 @@ void set_options(int argc, char *argv[])
LOGL(0, "Not a valid path for the xml file")
;
break;
@ -1759,14 +1792,14 @@ index d6b26d3..b26be53 100644
+ opts.quattro = 1;
+ break;
+
+ case AXE_UNICINP_OPT:
+ opts.axe_unicinp = atoi(optarg);
+ if (opts.axe_unicinp < 0 || opts.axe_unicinp > 3) {
+ LOG("unicable input %d out of range, using 0", opts.axe_unicinp);
+ opts.axe_unicinp = 0;
+ }
+ case QUATTRO_HIBAND_OPT:
+ opts.quattro_hiband = atoi(optarg) + 1;
+ break;
+
+ case AXE_UNICINP_OPT:
+ set_unicable_input(optarg);
+ break;
+
+ case AXE_SKIP_PKT:
+ {
+ opts.axe_skippkt = atoi(optarg);
@ -1780,7 +1813,7 @@ index d6b26d3..b26be53 100644
}
}
@@ -676,7 +785,6 @@ int read_rtsp(sockets * s)
@@ -676,7 +789,6 @@ int read_rtsp(sockets * s)
if (transport)
{
int s_timeout;
@ -1788,7 +1821,7 @@ index d6b26d3..b26be53 100644
if (sid->timeout == 1)
sid->timeout = opts.timeout_sec;
@@ -1003,6 +1111,9 @@ int ssdp_reply(sockets * s)
@@ -1003,6 +1115,9 @@ int ssdp_reply(sockets * s)
return 0;
}
@ -1798,7 +1831,7 @@ index d6b26d3..b26be53 100644
// not my uuid
LOG("Received SSDP packet from %s:%d -> handle %d",
get_socket_rhost(s->id, ra, sizeof(ra)), get_socket_rport(s->id),
@@ -1138,7 +1249,11 @@ int main(int argc, char *argv[])
@@ -1138,7 +1253,11 @@ int main(int argc, char *argv[])
if (!opts.no_threads)
set_socket_thread(sock_signal, start_new_thread("signal"));
@ -1813,7 +1846,7 @@ index d6b26d3..b26be53 100644
diff --git a/minisatip.h b/minisatip.h
old mode 100644
new mode 100755
index 403af34..3cd6977
index 403af34..cbdc23c
--- a/minisatip.h
+++ b/minisatip.h
@@ -10,13 +10,15 @@
@ -1833,17 +1866,18 @@ index 403af34..3cd6977
#define copy32(a,i,v) { a[i] = ((v)>>24) & 0xFF;\
a[i+1] = ((v)>>16) & 0xFF;\
a[i+2] = ((v)>>8) & 0xFF;\
@@ -48,6 +50,9 @@ struct struct_opts
@@ -48,6 +50,10 @@ struct struct_opts
int force_scan;
int clean_psi;
int file_line;
+ int quattro;
+ int axe_unicinp;
+ int quattro_hiband;
+ int axe_unicinp[4];
+ int axe_skippkt;
char *last_log;
int dvbapi_port;
char *dvbapi_host;
@@ -62,6 +67,15 @@ struct struct_opts
@@ -62,6 +68,15 @@ struct struct_opts
char *xml_path;
char no_threads;
int th_priority;