diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index f23414f5e..d20deb1cf 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -221,6 +221,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) TP.feparams.fec_inner = (fe_code_rate_t) scansettings.sat_TP_fec; TP.feparams.polarization = scansettings.sat_TP_pol; TP.feparams.delsys = (delivery_system_t)scansettings.sat_TP_delsys; + TP.feparams.modulation = (fe_modulation_t) scansettings.sat_TP_mod; } else if (CFrontend::isTerr(delsys)) { /* DVB-T. TODO: proper menu and parameter setup, not all "AUTO" */ TP.feparams.frequency = atoi(scansettings.terrestrial_TP_freq.c_str()); diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 5743ceaea..8e907bc92 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1875,6 +1875,7 @@ void CScanSetup::updateManualSettings() scansettings.sat_TP_fec = tI->second.feparams.fec_inner; scansettings.sat_TP_pol = tI->second.feparams.polarization; scansettings.sat_TP_delsys = tI->second.feparams.delsys; + scansettings.sat_TP_mod = tI->second.feparams.modulation; scansettings.satName = CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()); } else if (CFrontend::isCable(tI->second.feparams.delsys)) { scansettings.cable_TP_freq = to_string(tI->second.feparams.frequency); @@ -1974,33 +1975,22 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) tmpI = tmplist.find(select); - + tmpI->second.dump("CTPSelectHandler::exec: selected TP:"); if (CFrontend::isSat(tmpI->second.feparams.delsys)) { - printf("CTPSelectHandler::exec: selected TP: freq %d pol %d SR %d\n", - tmpI->second.feparams.frequency, - tmpI->second.feparams.polarization, - tmpI->second.feparams.symbol_rate); scansettings.sat_TP_freq = to_string(tmpI->second.feparams.frequency); scansettings.sat_TP_rate = to_string(tmpI->second.feparams.symbol_rate); scansettings.sat_TP_fec = tmpI->second.feparams.fec_inner; scansettings.sat_TP_pol = tmpI->second.feparams.polarization; + scansettings.sat_TP_delsys = tmpI->second.feparams.delsys; + scansettings.sat_TP_mod = tmpI->second.feparams.modulation; } else if (CFrontend::isCable(tmpI->second.feparams.delsys)) { - printf("CTPSelectHandler::exec: selected TP: freq %d SR %d FEC %d\n", - tmpI->second.feparams.frequency, - tmpI->second.feparams.symbol_rate, - tmpI->second.feparams.fec_inner); - scansettings.cable_TP_freq = to_string(tmpI->second.feparams.frequency); scansettings.cable_TP_rate = to_string(tmpI->second.feparams.symbol_rate); scansettings.cable_TP_fec = tmpI->second.feparams.fec_inner; scansettings.cable_TP_mod = tmpI->second.feparams.modulation; } else if (CFrontend::isTerr(tmpI->second.feparams.delsys)) { - printf("CTPSelectHandler::exec: selected TP: freq %d BW %d CON %d\n", - tmpI->second.feparams.frequency, - tmpI->second.feparams.bandwidth, - tmpI->second.feparams.modulation); scansettings.terrestrial_TP_freq = to_string(tmpI->second.feparams.frequency); scansettings.terrestrial_TP_bw = tmpI->second.feparams.bandwidth; scansettings.terrestrial_TP_constel = tmpI->second.feparams.modulation; @@ -2010,9 +2000,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) scansettings.terrestrial_TP_coderate_HP = tmpI->second.feparams.code_rate_HP; scansettings.terrestrial_TP_coderate_LP = tmpI->second.feparams.code_rate_LP; //scansettings.terrestrialName = CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()); - } - } if (retval == menu_return::RETURN_EXIT_ALL) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index cfd08c1ff..aa3b49df0 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -589,7 +589,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) ypos += iheight; scaling = 27000; - if (CFrontend::isSat(t.feparams.delsys) && t.feparams.fec_inner < FEC_S2_QPSK_1_2) + if (CFrontend::isSat(t.feparams.delsys) && t.feparams.delsys == DVB_S) scaling = 15000; sprintf (buf, "%s",g_Locale->getText (LOCALE_SCANTS_FREQDATA)); diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index aca1da92f..20d49571d 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -293,7 +293,7 @@ class CFrontend uint32_t getSupportedDeliverySystems(void) const; static uint32_t getXMLDeliverySystem(delivery_system_t delsys); static delivery_system_t getZapitDeliverySystem(uint32_t); - static void getXMLDelsysFEC(fe_code_rate_t xmlfec, delivery_system_t & delsys, fe_code_rate_t & fec); + static void getXMLDelsysFEC(fe_code_rate_t xmlfec, delivery_system_t & delsys, fe_modulation_t &mod, fe_code_rate_t & fec); static fe_delivery_system_t getFEDeliverySystem(delivery_system_t Delsys); static uint32_t getFEBandwidth(fe_bandwidth_t bandwidth); const char* getName(void) const { return info.name; } diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index c1fa57d2b..57315c5ca 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -718,14 +718,18 @@ void CFrontend::getDelSys(int f, int m, char *&fec, char *&sys, char *&mod) return getDelSys(getCurrentDeliverySystem(), f, m, fec, sys, mod); } -void CFrontend::getXMLDelsysFEC(fe_code_rate_t xmlfec, delivery_system_t & delsys, fe_code_rate_t & fec) +void CFrontend::getXMLDelsysFEC(fe_code_rate_t xmlfec, delivery_system_t & delsys, fe_modulation_t &mod, fe_code_rate_t & fec) { - if ((int)xmlfec < FEC_S2_QPSK_1_2) + if ((int)xmlfec < FEC_S2_QPSK_1_2) { delsys = DVB_S; - else if ((int)xmlfec < FEC_S2_8PSK_1_2) + mod = QPSK; + } else if ((int)xmlfec < FEC_S2_8PSK_1_2) { delsys = DVB_S2; - else + mod = QPSK; + } else { delsys = DVB_S2; + mod = PSK_8; + } switch ((int)xmlfec) { case FEC_1_2: @@ -787,16 +791,21 @@ void CFrontend::getDelSys(delivery_system_t delsys, int f, int m, char *&fec, ch { switch (delsys) { case DVB_S: + sys = (char *)"DVB"; + mod = (char *)"QPSK"; + break; case DVB_S2: - if (f < FEC_S2_QPSK_1_2) { - sys = (char *)"DVB"; + sys = (char *)"DVB-S2"; + switch (m) { + case QPSK: mod = (char *)"QPSK"; - } else if (f < FEC_S2_8PSK_1_2) { - sys = (char *)"DVB-S2"; - mod = (char *)"QPSK"; - } else { - sys = (char *)"DVB-S2"; + break; + case PSK_8: mod = (char *)"8PSK"; + break; + default: + printf("[frontend] unknown modulation %d!\n", m); + mod = (char *)"UNKNOWN"; } break; case DVB_C: @@ -861,54 +870,40 @@ void CFrontend::getDelSys(delivery_system_t delsys, int f, int m, char *&fec, ch switch (f) { case FEC_1_2: - case FEC_S2_QPSK_1_2: - case FEC_S2_8PSK_1_2: fec = (char *)"1/2"; break; case FEC_2_3: - case FEC_S2_QPSK_2_3: - case FEC_S2_8PSK_2_3: fec = (char *)"2/3"; break; case FEC_3_4: - case FEC_S2_QPSK_3_4: - case FEC_S2_8PSK_3_4: fec = (char *)"3/4"; break; - case FEC_S2_QPSK_3_5: - case FEC_S2_8PSK_3_5: - fec = (char *)"3/5"; - break; case FEC_4_5: - case FEC_S2_QPSK_4_5: - case FEC_S2_8PSK_4_5: fec = (char *)"4/5"; break; case FEC_5_6: - case FEC_S2_QPSK_5_6: - case FEC_S2_8PSK_5_6: fec = (char *)"5/6"; break; case FEC_6_7: fec = (char *)"6/7"; break; case FEC_7_8: - case FEC_S2_QPSK_7_8: - case FEC_S2_8PSK_7_8: fec = (char *)"7/8"; break; case FEC_8_9: - case FEC_S2_QPSK_8_9: - case FEC_S2_8PSK_8_9: fec = (char *)"8/9"; break; - case FEC_S2_QPSK_9_10: - case FEC_S2_8PSK_9_10: + case FEC_3_5: + fec = (char *)"3/5"; + break; + case FEC_9_10: fec = (char *)"9/10"; break; + case FEC_2_5: + fec = (char *)"2/3"; + break; default: printf("[frontend] getDelSys: unknown FEC: %d !!!\n", f); - case FEC_S2_AUTO: case FEC_AUTO: fec = (char *)"AUTO"; break; @@ -1053,38 +1048,22 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p * properly defined in the enum, thus the compiler complains... :-( */ switch ((int)fec_inner) { case FEC_1_2: - case FEC_S2_QPSK_1_2: - case FEC_S2_8PSK_1_2: fec = FEC_1_2; break; case FEC_2_3: - case FEC_S2_QPSK_2_3: - case FEC_S2_8PSK_2_3: fec = FEC_2_3; if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) pilot = PILOT_ON; break; case FEC_3_4: - case FEC_S2_QPSK_3_4: - case FEC_S2_8PSK_3_4: fec = FEC_3_4; if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) pilot = PILOT_ON; break; - case FEC_S2_QPSK_3_5: - case FEC_S2_8PSK_3_5: - fec = FEC_3_5; - if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) - pilot = PILOT_ON; - break; case FEC_4_5: - case FEC_S2_QPSK_4_5: - case FEC_S2_8PSK_4_5: fec = FEC_4_5; break; case FEC_5_6: - case FEC_S2_QPSK_5_6: - case FEC_S2_8PSK_5_6: fec = FEC_5_6; if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) pilot = PILOT_ON; @@ -1093,23 +1072,25 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p fec = FEC_6_7; break; case FEC_7_8: - case FEC_S2_QPSK_7_8: - case FEC_S2_8PSK_7_8: fec = FEC_7_8; break; case FEC_8_9: - case FEC_S2_QPSK_8_9: - case FEC_S2_8PSK_8_9: fec = FEC_8_9; break; - case FEC_S2_QPSK_9_10: - case FEC_S2_8PSK_9_10: + case FEC_3_5: + fec = FEC_3_5; + if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) + pilot = PILOT_ON; + break; + case FEC_9_10: fec = FEC_9_10; break; + case FEC_2_5: + fec = FEC_2_5; + break; default: printf("[fe%d] DEMOD: unknown FEC: %d\n", fenumber, fec_inner); case FEC_AUTO: - case FEC_S2_AUTO: fec = FEC_AUTO; break; } @@ -1123,7 +1104,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p nrOfProps = FE_DVBS2_PROPS; memcpy(cmdseq.props, dvbs2_cmdargs, sizeof(dvbs2_cmdargs)); - cmdseq.props[MODULATION].u.data = dvbs_get_modulation(feparams->fec_inner); + cmdseq.props[MODULATION].u.data = feparams->modulation; cmdseq.props[ROLLOFF].u.data = feparams->rolloff; cmdseq.props[PILOTS].u.data = pilot; diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 4e4cdf72a..c2a34a0f3 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -354,7 +354,7 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa fe_code_rate_t fec = (fe_code_rate_t)xmlGetNumericAttribute(node, "fec", 0); if (CFrontend::isSat(delsys)) // translate old fec enum to new. - CFrontend::getXMLDelsysFEC(fec, feparams.delsys, feparams.fec_inner); + CFrontend::getXMLDelsysFEC(fec, feparams.delsys, feparams.modulation, feparams.fec_inner); else if (CFrontend::isCable(delsys)) feparams.delsys = DVB_C; @@ -365,10 +365,15 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa if (CFrontend::isSat(delsys)) { feparams.symbol_rate = xmlGetNumericAttribute(node, "sr", 0); - feparams.modulation = (fe_modulation_t) xmlGetNumericAttribute(node, "mod", 0); + feparams.polarization = xmlGetNumericAttribute(node, "pol", 0); - if (feparams.frequency > 1000*1000) - feparams.frequency = feparams.frequency/1000; //transponderlist was read from tuxbox + if(feparams.symbol_rate < 50000) + feparams.symbol_rate = feparams.symbol_rate * 1000; + + if(feparams.frequency < 20000) + feparams.frequency = feparams.frequency*1000; + else + feparams.frequency = (int) 1000 * (int) round ((double) feparams.frequency / (double) 1000); } else if (CFrontend::isTerr(delsys)) { // @@ -387,24 +392,18 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa else if (CFrontend::isCable(delsys)) { feparams.fec_inner = (fe_code_rate_t) xmlGetNumericAttribute(node, "fec", 0); feparams.symbol_rate = xmlGetNumericAttribute(node, "sr", 0); - feparams.polarization = xmlGetNumericAttribute(node, "pol", 0); feparams.modulation = (fe_modulation_t) xmlGetNumericAttribute(node, "mod", 0); - if(feparams.symbol_rate < 50000) - feparams.symbol_rate = feparams.symbol_rate * 1000; - - if(feparams.frequency < 20000) - feparams.frequency = feparams.frequency*1000; - else - feparams.frequency = (int) 1000 * (int) round ((double) feparams.frequency / (double) 1000); + if (feparams.frequency > 1000*1000) + feparams.frequency = feparams.frequency/1000; //transponderlist was read from tuxbox } freq_id_t freq = CREATE_FREQ_ID(feparams.frequency, !CFrontend::isSat(delsys)); transponder_id_t tid = CREATE_TRANSPONDER_ID64(freq, satellitePosition,original_network_id,transport_stream_id); transponder t(tid, feparams); - pair::iterator,bool> ret; + pair::iterator,bool> ret; ret = transponders.insert(transponder_pair_t(tid, t)); if (ret.second == false) t.dump("[zapit] duplicate in all transponders:"); @@ -653,8 +652,10 @@ void CServiceManager::ParseSatTransponders(delivery_system_t delsys, xmlNodePtr int xml_fec = xmlGetNumericAttribute(tps, "fec_inner", 0); xml_fec = CFrontend::getCodeRate(xml_fec, feparams.delsys); +#if 0 if(modulation == 2 && ((fe_code_rate_t) xml_fec != FEC_AUTO)) xml_fec += 9; +#endif feparams.fec_inner = (fe_code_rate_t) xml_fec; feparams.frequency = (int) 1000 * (int) round ((double) feparams.frequency / (double) 1000); } diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index 1a3b2423e..eecbe2ace 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -259,19 +259,9 @@ _repeat: failedtransponders.insert(transponder_pair_t(t.transponder_id, t)); continue; } - scanedtransponders.insert(transponder_pair_t(t.transponder_id, t)); if(abort_scan) return false; - /* partial compare with existent transponders, update params if found */ - for (stiterator ttI = transponders.begin(); ttI != transponders.end(); ++ttI) { - if(t == ttI->second) { - ttI->second.dump("[scan] similar tp, old"); - t.dump("[scan] similar tp, new"); - ttI->second.feparams = t.feparams; - break; - } - } freq_id_t freq = CREATE_FREQ_ID(tI->second.feparams.frequency, !CFrontend::isSat(tI->second.feparams.delsys)); @@ -310,8 +300,20 @@ _repeat: #endif if(!sdt_parsed) { printf("[scan] SDT failed !\n"); + failed_transponders++; + failedtransponders.insert(transponder_pair_t(t.transponder_id, t)); continue; } + scanedtransponders.insert(transponder_pair_t(t.transponder_id, t)); + /* partial compare with existent transponders, update params if found */ + for (stiterator ttI = transponders.begin(); ttI != transponders.end(); ++ttI) { + if(t == ttI->second) { + ttI->second.dump("[scan] similar tp, old"); + t.dump("[scan] similar tp, new"); + ttI->second.feparams = t.feparams; + break; + } + } transponder_id_t TsidOnid = CREATE_TRANSPONDER_ID64(freq, satellitePosition, tI->second.original_network_id, tI->second.transport_stream_id); diff --git a/src/zapit/src/transponder.cpp b/src/zapit/src/transponder.cpp index 8c4852805..8aaca5a1c 100644 --- a/src/zapit/src/transponder.cpp +++ b/src/zapit/src/transponder.cpp @@ -84,6 +84,8 @@ bool transponder::compare(const transponder& t) const ret = ( (t == (*this)) && (getFEParams()->symbol_rate == t.getFEParams()->symbol_rate) && + (getFEParams()->delsys == t.getFEParams()->delsys) && + (getFEParams()->modulation == t.getFEParams()->modulation) && (getFEParams()->fec_inner == t.getFEParams()->fec_inner || getFEParams()->fec_inner == FEC_AUTO || t.getFEParams()->fec_inner == FEC_AUTO) ); @@ -149,15 +151,16 @@ void transponder::dump(std::string label) getFEParams()->symbol_rate, getFEParams()->fec_inner, getFEParams()->modulation, - CFrontend::getXMLDeliverySystem(getFEParams()->delsys)); + getFEParams()->delsys); } else if (CFrontend::isSat(feparams.delsys)) { - printf("%s tp-id %016" PRIx64 " freq %d rate %d fec %d pol %d sys %d\n", label.c_str(), + printf("%s tp-id %016" PRIx64 " freq %d rate %d fec %d pol %d mod %d sys %d\n", label.c_str(), transponder_id, getFEParams()->frequency, getFEParams()->symbol_rate, getFEParams()->fec_inner, getFEParams()->polarization, - CFrontend::getXMLDeliverySystem(getFEParams()->delsys)); + getFEParams()->modulation, + getFEParams()->delsys); } else if (CFrontend::isTerr(feparams.delsys)) { printf("%s tp-id %016llx freq %d bw %d coderate_HP %d coderate_LP %d const %d guard %d %d\n", label.c_str(), transponder_id, @@ -167,7 +170,7 @@ void transponder::dump(std::string label) getFEParams()->code_rate_LP, getFEParams()->modulation, getFEParams()->guard_interval, - CFrontend::getXMLDeliverySystem(getFEParams()->delsys)); + getFEParams()->delsys); } }