fix DVB-T2 transponders

Origin commit data
------------------
Branch: ni/coolstream
Commit: 8ba4a58554
Author: TangoCash <eric@loxat.de>
Date: 2017-12-03 (Sun, 03 Dec 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2017-12-03 17:59:08 +01:00
committed by Thilo Graf
parent 9915ec8785
commit b684d8dce6
3 changed files with 20 additions and 15 deletions

View File

@@ -147,9 +147,9 @@ static const struct dtv_property dvbt2_cmdargs[] = {
{ DTV_GUARD_INTERVAL, {}, { GUARD_INTERVAL_AUTO}, 0}, { DTV_GUARD_INTERVAL, {}, { GUARD_INTERVAL_AUTO}, 0},
{ DTV_HIERARCHY, {}, { HIERARCHY_AUTO }, 0}, { DTV_HIERARCHY, {}, { HIERARCHY_AUTO }, 0},
#if defined DTV_STREAM_ID #if defined DTV_STREAM_ID
{ DTV_STREAM_ID, {}, { 0 } ,0}, { DTV_STREAM_ID, {}, { NO_STREAM_ID_FILTER } ,0},
#elif defined DTV_DVBT2_PLP_ID #elif defined DTV_DVBT2_PLP_ID
{ DTV_DVBT2_PLP_ID, {}, { 0 } ,0}, { DTV_DVBT2_PLP_ID, {}, { NO_STREAM_ID_FILTER } ,0},
#endif #endif
{ DTV_TUNE, {}, { 0 }, 0} { DTV_TUNE, {}, { 0 }, 0}
}; };
@@ -1802,8 +1802,8 @@ int CFrontend::setParameters(transponder *TP, bool nowait)
break; break;
} }
printf("[fe%d] tune to %d %s %s %s %s srate %d (tuner %d offset %d timeout %d)\n", fenumber, freq, s, m, f, printf("[fe%d] tune to %d %s %s %s %s srate %d pli %d (tuner %d offset %d timeout %d)\n", fenumber, freq, s, m, f,
feparams.polarization & 1 ? "V/R" : "H/L", feparams.symbol_rate, feparams.frequency, freq_offset, TIMEOUT_MAX_MS); feparams.polarization & 1 ? "V/R" : "H/L", feparams.symbol_rate, feparams.plp_id, feparams.frequency, freq_offset, TIMEOUT_MAX_MS);
setFrontend(&feparams, nowait); setFrontend(&feparams, nowait);
return tuned; return tuned;

View File

@@ -380,6 +380,7 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa
t_original_network_id original_network_id = xmlGetNumericAttribute(node, "on", 16); t_original_network_id original_network_id = xmlGetNumericAttribute(node, "on", 16);
feparams.frequency = xmlGetNumericAttribute(node, "frq", 0); feparams.frequency = xmlGetNumericAttribute(node, "frq", 0);
feparams.inversion = (fe_spectral_inversion) xmlGetNumericAttribute(node, "inv", 0); feparams.inversion = (fe_spectral_inversion) xmlGetNumericAttribute(node, "inv", 0);
feparams.plp_id = (uint8_t) xmlGetNumericAttribute(node, "pli", 0);
const char *system = xmlGetAttribute(node, "sys"); const char *system = xmlGetAttribute(node, "sys");
if (system) { if (system) {
@@ -397,7 +398,7 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa
feparams.delsys = DVB_C; feparams.delsys = DVB_C;
} else if (CFrontend::isTerr(delsys)) { } else if (CFrontend::isTerr(delsys)) {
feparams.delsys = DVB_T; feparams.delsys = delsys;
} }
} }
@@ -426,8 +427,8 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa
feparams.guard_interval = (fe_guard_interval_t) xmlGetNumericAttribute(node, "gi", 0); feparams.guard_interval = (fe_guard_interval_t) xmlGetNumericAttribute(node, "gi", 0);
feparams.hierarchy = (fe_hierarchy_t) xmlGetNumericAttribute(node, "hi", 0); feparams.hierarchy = (fe_hierarchy_t) xmlGetNumericAttribute(node, "hi", 0);
if (feparams.frequency > 1000*1000) if (feparams.frequency < 1000*1000)
feparams.frequency = feparams.frequency/1000; //transponderlist was read from tuxbox feparams.frequency = feparams.frequency*1000;
} }
else if (CFrontend::isCable(delsys)) { else if (CFrontend::isCable(delsys)) {
feparams.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(node, "fec", 0); feparams.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(node, "fec", 0);
@@ -728,7 +729,7 @@ void CServiceManager::ParseSatTransponders(delivery_system_t delsys, xmlNodePtr
} }
} else { } else {
// Set some sane defaults. // Set some sane defaults.
feparams.delsys = DVB_T; feparams.delsys = DVB_T2;
} }
feparams.bandwidth = (fe_bandwidth_t) xmlGetNumericAttribute(tps, "bandwidth", 0); feparams.bandwidth = (fe_bandwidth_t) xmlGetNumericAttribute(tps, "bandwidth", 0);
@@ -746,8 +747,8 @@ void CServiceManager::ParseSatTransponders(delivery_system_t delsys, xmlNodePtr
xmlGetNumericAttribute(tps, "hierarchy", 0); xmlGetNumericAttribute(tps, "hierarchy", 0);
feparams.plp_id = (uint8_t) feparams.plp_id = (uint8_t)
xmlGetNumericAttribute(tps, "plp_id", 0); xmlGetNumericAttribute(tps, "plp_id", 0);
if (feparams.frequency > 1000*1000) if (feparams.frequency < 1000*1000)
feparams.frequency /= 1000; // old transponder list feparams.frequency *= 1000;
} }
else /* we'll probably crash sooner or later, so write to STDERR... */ else /* we'll probably crash sooner or later, so write to STDERR... */
fprintf(stderr, "[getservices] %s: unknown delivery system %d!\n", __func__, delsys); fprintf(stderr, "[getservices] %s: unknown delivery system %d!\n", __func__, delsys);

View File

@@ -62,7 +62,8 @@ bool transponder::operator==(const transponder& t) const
//(transport_stream_id == t.transport_stream_id) && //(transport_stream_id == t.transport_stream_id) &&
//(original_network_id == t.original_network_id) && //(original_network_id == t.original_network_id) &&
((getFEParams()->polarization & 1) == (t.getFEParams()->polarization & 1)) && ((getFEParams()->polarization & 1) == (t.getFEParams()->polarization & 1)) &&
(abs((int) getFEParams()->frequency - (int)t.getFEParams()->frequency) <= 100) (abs((int) getFEParams()->frequency - (int)t.getFEParams()->frequency) <= 100) &&
(getFEParams()->plp_id == t.getFEParams()->plp_id)
); );
} }
@@ -98,7 +99,8 @@ bool transponder::compare(const transponder& t) const
(getFEParams()->code_rate_LP == t.getFEParams()->code_rate_LP || (getFEParams()->code_rate_LP == t.getFEParams()->code_rate_LP ||
getFEParams()->code_rate_LP == FEC_AUTO || t.getFEParams()->code_rate_LP == FEC_AUTO) && getFEParams()->code_rate_LP == FEC_AUTO || t.getFEParams()->code_rate_LP == FEC_AUTO) &&
(getFEParams()->modulation == t.getFEParams()->modulation || (getFEParams()->modulation == t.getFEParams()->modulation ||
getFEParams()->modulation == QAM_AUTO || t.getFEParams()->modulation == QAM_AUTO) getFEParams()->modulation == QAM_AUTO || t.getFEParams()->modulation == QAM_AUTO) &&
(getFEParams()->plp_id == t.getFEParams()->plp_id)
); );
} }
@@ -127,7 +129,7 @@ void transponder::dumpServiceXml(FILE * fd)
getFEParams()->modulation, getFEParams()->modulation,
CFrontend::getXMLDeliverySystem(getFEParams()->delsys)); CFrontend::getXMLDeliverySystem(getFEParams()->delsys));
} else if (CFrontend::isTerr(feparams.delsys)) { } else if (CFrontend::isTerr(feparams.delsys)) {
fprintf(fd, "\t\t<TS id=\"%04x\" on=\"%04x\" frq=\"%u\" inv=\"%hu\" bw=\"%u\" hp=\"%hu\" lp=\"%hu\" con=\"%u\" tm=\"%u\" gi=\"%u\" hi=\"%u\" sys=\"%hu\">\n", fprintf(fd, "\t\t<TS id=\"%04x\" on=\"%04x\" frq=\"%u\" inv=\"%hu\" bw=\"%u\" hp=\"%hu\" lp=\"%hu\" con=\"%u\" tm=\"%u\" gi=\"%u\" hi=\"%u\" pli=\"%u\" sys=\"%hu\">\n",
transport_stream_id, original_network_id, transport_stream_id, original_network_id,
getFEParams()->frequency, getFEParams()->frequency,
getFEParams()->inversion, getFEParams()->inversion,
@@ -138,6 +140,7 @@ void transponder::dumpServiceXml(FILE * fd)
getFEParams()->transmission_mode, getFEParams()->transmission_mode,
getFEParams()->guard_interval, getFEParams()->guard_interval,
getFEParams()->hierarchy, getFEParams()->hierarchy,
getFEParams()->plp_id,
CFrontend::getXMLDeliverySystem(getFEParams()->delsys)); CFrontend::getXMLDeliverySystem(getFEParams()->delsys));
} }
} }
@@ -162,7 +165,7 @@ void transponder::dump(std::string label)
getFEParams()->modulation, getFEParams()->modulation,
getFEParams()->delsys); getFEParams()->delsys);
} else if (CFrontend::isTerr(feparams.delsys)) { } else if (CFrontend::isTerr(feparams.delsys)) {
printf("%s tp-id %016" PRIx64 " freq %d bw %d coderate_HP %d coderate_LP %d const %d guard %d %d\n", label.c_str(), printf("%s tp-id %016" PRIx64 " freq %d bw %d coderate_HP %d coderate_LP %d const %d guard %d pli %d delsys %d\n", label.c_str(),
transponder_id, transponder_id,
getFEParams()->frequency, getFEParams()->frequency,
getFEParams()->bandwidth, getFEParams()->bandwidth,
@@ -170,6 +173,7 @@ void transponder::dump(std::string label)
getFEParams()->code_rate_LP, getFEParams()->code_rate_LP,
getFEParams()->modulation, getFEParams()->modulation,
getFEParams()->guard_interval, getFEParams()->guard_interval,
getFEParams()->plp_id,
getFEParams()->delsys); getFEParams()->delsys);
} }
} }
@@ -209,7 +213,7 @@ std::string transponder::description()
} else if (CFrontend::isTerr(feparams.delsys)) { } else if (CFrontend::isTerr(feparams.delsys)) {
CFrontend::getDelSys(feparams.delsys, getFEParams()->code_rate_HP, getFEParams()->modulation, f, s, m); CFrontend::getDelSys(feparams.delsys, getFEParams()->code_rate_HP, getFEParams()->modulation, f, s, m);
CFrontend::getDelSys(feparams.delsys, getFEParams()->code_rate_LP, getFEParams()->modulation, f2, s, m); CFrontend::getDelSys(feparams.delsys, getFEParams()->code_rate_LP, getFEParams()->modulation, f2, s, m);
snprintf(buf, sizeof(buf), "%d %d %s %s %s ", getFEParams()->frequency, CFrontend::getFEBandwidth(getFEParams()->bandwidth)/1000, f, f2, m); snprintf(buf, sizeof(buf), "%d %d %s %s %s %d ", getFEParams()->frequency, CFrontend::getFEBandwidth(getFEParams()->bandwidth)/1000, f, f2, m, getFEParams()->plp_id);
} }
return std::string(buf); return std::string(buf);