From 285cf87671c7a1697730ad22830a06edbcfd86d6 Mon Sep 17 00:00:00 2001 From: John Klimek Date: Sun, 2 Sep 2012 20:52:50 -0400 Subject: [PATCH] Added support for DBS Bandstacked LNBFs --- src/dvb/dvb.h | 1 - src/dvb/dvb_fe.c | 25 +++++++++++++++++-------- src/dvb/dvb_satconf.c | 5 +++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/dvb/dvb.h b/src/dvb/dvb.h index 528df4e6..7ac8260d 100644 --- a/src/dvb/dvb.h +++ b/src/dvb/dvb.h @@ -24,7 +24,6 @@ #include #include "htsmsg.h" - #define DVB_VER_INT(maj,min) (((maj) << 16) + (min)) #define DVB_VER_ATLEAST(maj, min) \ diff --git a/src/dvb/dvb_fe.c b/src/dvb/dvb_fe.c index 34a379f6..7ef2b3b0 100644 --- a/src/dvb/dvb_fe.c +++ b/src/dvb/dvb_fe.c @@ -466,20 +466,29 @@ dvb_fe_tune(th_dvb_mux_instance_t *tdmi, const char *reason) dvb_lnb_get_frequencies(sc->sc_lnb, &lowfreq, &hifreq, &switchfreq); } - hiband = switchfreq && p->frequency > switchfreq; - - pol = tdmi->tdmi_conf.dmc_polarisation; + if(!strcmp(sc->sc_id, "DBS Bandstacked")) { + hiband = 0; + if(tdmi->tdmi_conf.dmc_polarisation == POLARISATION_HORIZONTAL || + tdmi->tdmi_conf.dmc_polarisation == POLARISATION_CIRCULAR_LEFT) + p->frequency = abs(p->frequency - hifreq); + else + p->frequency = abs(p->frequency - lowfreq); + pol = POLARISATION_CIRCULAR_LEFT; + } else { + hiband = switchfreq && p->frequency > switchfreq; + pol = tdmi->tdmi_conf.dmc_polarisation; + if(hiband) + p->frequency = abs(p->frequency - hifreq); + else + p->frequency = abs(p->frequency - lowfreq); + } + if ((r = diseqc_setup(tda->tda_fe_fd, port, pol == POLARISATION_HORIZONTAL || pol == POLARISATION_CIRCULAR_LEFT, hiband, tda->tda_diseqc_version)) != 0) tvhlog(LOG_ERR, "dvb", "diseqc setup failed %d\n", r); - - if(hiband) - p->frequency = abs(p->frequency - hifreq); - else - p->frequency = abs(p->frequency - lowfreq); } dvb_mux_nicename(buf, sizeof(buf), tdmi); diff --git a/src/dvb/dvb_satconf.c b/src/dvb/dvb_satconf.c index 6a41e35c..4c15be78 100644 --- a/src/dvb/dvb_satconf.c +++ b/src/dvb/dvb_satconf.c @@ -290,6 +290,7 @@ dvb_lnblist_get(void) add_to_lnblist(array, "Universal"); add_to_lnblist(array, "DBS"); + add_to_lnblist(array, "DBS Bandstacked"); add_to_lnblist(array, "Standard"); add_to_lnblist(array, "Enhanced"); add_to_lnblist(array, "C-Band"); @@ -313,6 +314,10 @@ dvb_lnb_get_frequencies(const char *id, int *f_low, int *f_hi, int *f_switch) *f_low = 11250000; *f_hi = 0; *f_switch = 0; + } else if(!strcmp(id, "DBS Bandstacked")) { + *f_low = 11250000; + *f_hi = 14350000; + *f_switch = 0; } else if(!strcmp(id, "Standard")) { *f_low = 10000000; *f_hi = 0;