Ticket #5882: s2api.riky.r0.patch
File s2api.riky.r0.patch, 96.0 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/firewirechannel.cpp
60 60 61 61 // Fetch tuning data from the database. 62 62 QString tvformat, modulation, freqtable, freqid, dtv_si_std; 63 QString msystem, rolloff; 63 64 int finetune; 64 65 uint64_t frequency; 65 66 int mpeg_prog_num; … … 70 71 tvformat, modulation, freqtable, freqid, 71 72 finetune, frequency, 72 73 dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 74 msystem, rolloff, 73 75 mplexid, commfree)) 74 76 { 75 77 VERBOSE(VB_IMPORTANT, loc + " " + QString( -
libs/libmythtv/dtvconfparserhelpers.h
74 74 public: 75 75 enum 76 76 { 77 kTunerTypeQPSK = 0, 78 kTunerTypeQAM = 1, 79 kTunerTypeOFDM = 2, 77 kTunerTypeQPSK = 0, // DVB-S 78 kTunerTypeQAM = 1, // DVB-C 79 kTunerTypeOFDM = 2, // DVB-T 80 80 kTunerTypeATSC = 3, 81 kTunerTypeDVB_S = (1 << 2), // same as QPSK but for new API 82 kTunerTypeDVB_C = (1 << 3), // same as QAM but for new API 83 kTunerTypeDVB_T = (1 << 4), // same as OFDM but for new API 84 kTunerTypeDVB_S2 = (1 << 5), 81 kTunerTypeDVB_S2 = (1 << 30), // In S2API DVB-S2 is only a capability 85 82 kTunerTypeUnknown = (1 << 31), 86 83 }; 87 84 … … 95 92 { 96 93 return ((kTunerTypeQPSK == value) || 97 94 (kTunerTypeQAM == value) || 98 (kTunerTypeDVB_S == value) ||99 (kTunerTypeDVB_C == value) ||100 95 (kTunerTypeDVB_S2 == value)); 101 96 } 102 97 … … 191 186 static const DTVParamHelperStruct confTable[]; 192 187 static const DTVParamHelperStruct vdrTable[]; 193 188 static const DTVParamHelperStruct parseTable[]; 194 static const uint kDBStrCnt = 1 0;189 static const uint kDBStrCnt = 12; 195 190 static const char *dbStr[kDBStrCnt]; 196 191 197 192 public: … … 207 202 kFEC_7_8, 208 203 kFEC_8_9, 209 204 kFECAuto, 205 kFEC_3_5, 206 kFEC_9_10, 210 207 }; 211 208 212 209 DTVCodeRate(int _default = kFECAuto) : DTVParamHelper(_default) { } … … 245 242 kModulationQAMAuto = 6, 246 243 kModulation8VSB = 7, 247 244 kModulation16VSB = 8, 248 kModulation 2VSB= 9,249 kModulation 4VSB= 10,250 kModulation BPSK= 11,251 kModulation 16APSK= 12,252 kModulation 32APSK= 13,253 kModulation 8PSK= 14,254 kModulation 16PSK= 15,245 kModulation8PSK = 9, 246 kModulation16APSK = 10, 247 kModulation32APSK = 11, 248 kModulationDQPSK = 12, 249 kModulation2VSB = 13, 250 kModulation4VSB = 14, 251 kModulationBPSK = 15, 255 252 kModulationAnalog = 16, /* for analog channel scanner */ 253 kModulation16PSK = 17, 256 254 }; 257 255 258 256 DTVModulation(int _default = kModulationQAMAuto) … … 414 412 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 415 413 }; 416 414 415 class DTVModulationSystem : public DTVParamHelper 416 { 417 protected: 418 static const DTVParamHelperStruct confTable[]; 419 static const DTVParamHelperStruct vdrTable[]; 420 static const DTVParamHelperStruct parseTable[]; 421 static const uint kDBStrCnt = 2; 422 static const char *dbStr[kDBStrCnt]; 423 424 public: 425 enum 426 { 427 kModulationSystemDVBS, 428 kModulationSystemDVBS2, 429 }; 430 431 DTVModulationSystem(int _default = kModulationSystemDVBS) 432 : DTVParamHelper(_default) { } 433 434 bool ParseConf(const QString &_value) 435 { return ParseParam(_value, value, confTable); } 436 bool ParseVDR(const QString &_value) 437 { return ParseParam(_value, value, vdrTable); } 438 bool Parse(const QString &_value) 439 { return ParseParam(_value, value, parseTable); } 440 441 QString toString() const { return toString(value); } 442 443 static QString toString(int _value) 444 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 445 }; 446 447 class DTVRollOff : public DTVParamHelper 448 { 449 protected: 450 static const DTVParamHelperStruct confTable[]; 451 static const DTVParamHelperStruct vdrTable[]; 452 static const DTVParamHelperStruct parseTable[]; 453 static const uint kDBStrCnt = 4; 454 static const char *dbStr[kDBStrCnt]; 455 456 public: 457 enum 458 { 459 kRollOff35, 460 kRollOff20, 461 kRollOff25, 462 kRollOffAuto, 463 }; 464 465 DTVRollOff(int _default = kRollOff35) 466 : DTVParamHelper(_default) { } 467 468 bool ParseConf(const QString &_value) 469 { return ParseParam(_value, value, confTable); } 470 bool ParseVDR(const QString &_value) 471 { return ParseParam(_value, value, vdrTable); } 472 bool Parse(const QString &_value) 473 { return ParseParam(_value, value, parseTable); } 474 475 QString toString() const { return toString(value); } 476 477 static QString toString(int _value) 478 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 479 }; 480 481 class DTVPilot : public DTVParamHelper 482 { 483 protected: 484 static const DTVParamHelperStruct confTable[]; 485 static const DTVParamHelperStruct vdrTable[]; 486 static const DTVParamHelperStruct parseTable[]; 487 static const uint kDBStrCnt = 3; 488 static const char *dbStr[kDBStrCnt]; 489 490 public: 491 enum 492 { 493 kPilotOn, 494 kPilotOff, 495 kPilotAuto, 496 }; 497 498 DTVPilot(int _default = kPilotAuto) 499 : DTVParamHelper(_default) { } 500 501 bool ParseConf(const QString &_value) 502 { return ParseParam(_value, value, confTable); } 503 504 QString toString() const { return toString(value); } 505 506 static QString toString(int _value) 507 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 508 }; 509 417 510 #endif // _DTVCONFPARSERHELPERS_H_ -
libs/libmythtv/channelscan/channelimporter.cpp
468 468 469 469 bool is_dvbs = 470 470 (DTVTunerType::kTunerTypeQPSK == tuner_type) || 471 (DTVTunerType::kTunerTypeDVB_S == tuner_type) ||472 471 (DTVTunerType::kTunerTypeDVB_S2 == tuner_type); 473 472 474 473 uint freq_mult = (is_dvbs) ? 1 : 1000; -
libs/libmythtv/channelscan/scaninfo.cpp
76 76 " hp_code_rate, lp_code_rate, modulation, " 77 77 " transmission_mode, guard_interval, hierarchy, " 78 78 " modulation, bandwidth, sistandard, " 79 " tuner_type, transportid " 79 " tuner_type, transportid, " 80 " msystem, rolloff " 80 81 "FROM channelscan_dtv_multiplex " 81 82 "WHERE scanid = :SCANID"); 82 83 query.bindValue(":SCANID", scanid); … … 97 98 query.value(6).toString(), query.value(7).toString(), 98 99 query.value(8).toString(), query.value(9).toString(), 99 100 query.value(10).toString(), query.value(11).toString(), 100 query.value(12).toString()); 101 query.value(12).toString(), query.value(16).toString(), 102 query.value(17).toString()); 101 103 102 104 query2.prepare( 103 105 "SELECT " -
libs/libmythtv/channelscan/channelscan_sm.cpp
1439 1439 startChan["coderate_hp"], startChan["coderate_lp"], 1440 1440 startChan["constellation"], startChan["trans_mode"], 1441 1441 startChan["guard_interval"], startChan["hierarchy"], 1442 startChan["modulation"], startChan["bandwidth"]); 1442 startChan["modulation"], startChan["bandwidth"], 1443 startChan["msystem"], startChan["rolloff"]); 1443 1444 } 1444 1445 1445 1446 if (ok) -
libs/libmythtv/channelscan/modulationsetting.h
58 58 { 59 59 addSelection(QObject::tr("Auto"),"auto",true); 60 60 addSelection("QPSK","qpsk"); 61 #ifdef FE_GET_EXTENDED_INFO62 61 addSelection("8PSK","8psk"); 63 #endif64 62 addSelection("QAM 16","qam_16"); 65 63 addSelection("QAM 32","qam_32"); 66 64 addSelection("QAM 64","qam_64"); -
libs/libmythtv/channelscan/channelscanmiscsettings.h
146 146 addSelection("1/2"); 147 147 addSelection("2/3"); 148 148 addSelection("3/4"); 149 addSelection("3/5"); 149 150 addSelection("4/5"); 150 151 addSelection("5/6"); 151 152 addSelection("6/7"); 152 153 addSelection("7/8"); 153 154 addSelection("8/9"); 155 addSelection("9/10"); 154 156 } 155 157 }; 156 158 … … 165 167 } 166 168 }; 167 169 170 class ScanModulationSystem: public ComboBoxSetting, public TransientStorage 171 { 172 public: 173 ScanModulationSystem() : ScanModulationSystemSetting(this) 174 { 175 setLabel(QObject::tr("Modul. System")); 176 setHelpText(QObject::tr("Modulation System (Default: DVB-S)")); 177 addSelection("DVB-S","dvbs",true); 178 addSelection("DVB-S2","dvbs2"); 179 }; 180 }; 181 182 183 class ScanRollOff: public ComboBoxSetting 184 { 185 public: 186 ScanRollOff(Storage *_storage) : ComboBoxSetting(_storage) 187 { 188 setLabel(QObject::tr("Roll-off")); 189 setHelpText(QObject::tr( 190 "Roll-off (Default: Auto):\n" 191 "The DVB-S2 standard in addition \n" 192 " to the single DVB-S 35% roll-off\n" 193 " factor, provides two additional roll-off\n" 194 " factors to further increase transponder efficiency")); 195 addSelection(QObject::tr("Auto"),"auto"); 196 addSelection("0.35","0.35",true); 197 addSelection("0.20"); 198 addSelection("0.25"); 199 } 200 }; 201 168 202 class ScanCodeRateLP: public ScanFecSetting, public TransientStorage 169 203 { 170 204 public: -
libs/libmythtv/channelscan/channelscanner.cpp
143 143 } 144 144 else if ((ScanTypeSetting::NITAddScan_DVBT == scantype) || 145 145 (ScanTypeSetting::NITAddScan_DVBS == scantype) || 146 (ScanTypeSetting::NITAddScan_DVBS2 == scantype) || 146 147 (ScanTypeSetting::NITAddScan_DVBC == scantype)) 147 148 { 148 149 VERBOSE(VB_SIPARSER, LOC + "ScanTransports()"); … … 219 220 DTVConfParser::cardtype_t type = DTVConfParser::UNKNOWN; 220 221 type = (CardUtil::DVBT == cardtype) ? DTVConfParser::OFDM : type; 221 222 type = (CardUtil::QPSK == cardtype) ? DTVConfParser::QPSK : type; 223 type = (CardUtil::DVBS2 == cardtype) ? DTVConfParser::DVBS2 : type; 222 224 type = (CardUtil::DVBC == cardtype) ? DTVConfParser::QAM : type; 223 225 type = ((CardUtil::ATSC == cardtype) || 224 226 (CardUtil::HDHOMERUN == cardtype)) ? DTVConfParser::ATSC : type; … … 302 304 QString sub_type = CardUtil::ProbeDVBType(device.toUInt()).upper(); 303 305 bool need_nit = (("QAM" == sub_type) || 304 306 ("QPSK" == sub_type) || 307 ("DVB_S2" == sub_type) || 305 308 ("OFDM" == sub_type)); 306 309 307 310 // Ugh, Some DVB drivers don't fully support signal monitoring... -
libs/libmythtv/channelscan/panedvbs2.h
22 22 left->addChild( pfrequency = new ScanFrequency()); 23 23 left->addChild( ppolarity = new ScanPolarity()); 24 24 left->addChild( psymbolrate = new ScanSymbolRate()); 25 right->addChild(pfec = new ScanFec()); 25 left->addChild( pfec = new ScanFec()); 26 right->addChild(pmsystem = new ScanModulationSystem()); 26 27 right->addChild(pmodulation = new ScanModulation()); 27 28 right->addChild(pinversion = new ScanInversion()); 29 right->addChild(prolloff = new ScanRollOff()); 28 30 addChild(left); 29 31 addChild(right); 30 32 } … … 35 37 QString fec(void) const { return pfec->getValue(); } 36 38 QString polarity(void) const { return ppolarity->getValue(); } 37 39 QString modulation(void) const { return pmodulation->getValue(); } 40 QString rolloff(void) const { return prolloff->getValue(); } 41 QString msystem(void) const { return pmsystem->getValue(); } 38 42 39 43 protected: 40 44 ScanFrequency *pfrequency; … … 43 47 ScanFec *pfec; 44 48 ScanPolarity *ppolarity; 45 49 ScanModulation *pmodulation; 50 ScanRollOff *prolloff; 51 ScanModulationSystem *pmsystem; 46 52 }; 47 53 48 54 #endif // _PANE_DVBS2_H_ -
libs/libmythtv/channelscan/scanwizardconfig.cpp
133 133 addSelection(tr("Import channels.conf"), 134 134 QString::number(DVBUtilsImport)); 135 135 break; 136 case CardUtil::DVBS2: 137 addSelection(tr("Full Scan (Tuned)"), 138 QString::number(NITAddScan_DVBS2)); 139 addSelection(tr("Import channels.conf"), 140 QString::number(DVBUtilsImport)); 141 break; 136 142 case CardUtil::QAM: 137 143 addSelection(tr("Full Scan (Tuned)"), 138 144 QString::number(NITAddScan_DVBC)); … … 329 335 startChan["modulation"] = "qpsk"; 330 336 startChan["polarity"] = pane->polarity(); 331 337 } 338 else if (ScanTypeSetting::NITAddScan_DVBS2 == st) 339 { 340 const PaneDVBS2 *pane = paneDVBS2; 341 342 startChan["std"] = "dvb"; 343 startChan["frequency"] = pane->frequency(); 344 startChan["inversion"] = pane->inversion(); 345 startChan["symbolrate"] = pane->symbolrate(); 346 startChan["fec"] = pane->fec(); 347 startChan["modulation"] = pane->modulation();; 348 startChan["polarity"] = pane->polarity(); 349 startChan["rolloff"] = pane->rolloff(); 350 } 332 351 else if (ScanTypeSetting::NITAddScan_DVBC == st) 333 352 { 334 353 const PaneDVBC *pane = paneDVBC; -
libs/libmythtv/dtvconfparserhelpers.cpp
47 47 dtv_tt_canonical_str[kTunerTypeQAM] = "QAM"; 48 48 dtv_tt_canonical_str[kTunerTypeOFDM] = "OFDM"; 49 49 dtv_tt_canonical_str[kTunerTypeATSC] = "ATSC"; 50 dtv_tt_canonical_str[kTunerTypeDVB_S] = "DVB_S";51 dtv_tt_canonical_str[kTunerTypeDVB_C] = "DVB_C";52 dtv_tt_canonical_str[kTunerTypeDVB_T] = "DVB_T";53 50 dtv_tt_canonical_str[kTunerTypeDVB_S2] = "DVB_S2"; 54 51 dtv_tt_canonical_str[kTunerTypeUnknown] = "UNKNOWN"; 55 52 } … … 69 66 { "QAM", kTunerTypeQAM }, 70 67 { "OFDM", kTunerTypeOFDM }, 71 68 { "ATSC", kTunerTypeATSC }, 72 { "DVB_S", kTunerTypeDVB_S },73 { "DVB_C", kTunerTypeDVB_C },74 { "DVB_T", kTunerTypeDVB_T },75 69 { "DVB_S2", kTunerTypeDVB_S2 }, 76 70 { "UNKNOWN", kTunerTypeUnknown }, 77 71 { NULL, kTunerTypeUnknown }, … … 154 148 { "FEC_6_7", kFEC_6_7 }, 155 149 { "FEC_7_8", kFEC_7_8 }, 156 150 { "FEC_8_9", kFEC_8_9 }, 157 { "FEC_NONE", kFECNone }, 151 { "FEC_3_5", kFEC_3_5 }, 152 { "FEC_9_10", kFEC_9_10 }, 153 { "FEC_NONE", kFECNone }, 158 154 { NULL, kFECAuto }, 159 155 }; 160 156 … … 164 160 { "12", kFEC_1_2 }, 165 161 { "23", kFEC_2_3 }, 166 162 { "34", kFEC_3_4 }, 163 { "35", kFEC_3_5 }, 167 164 { "45", kFEC_4_5 }, 168 165 { "56", kFEC_5_6 }, 169 166 { "67", kFEC_6_7 }, 170 167 { "78", kFEC_7_8 }, 171 168 { "89", kFEC_8_9 }, 169 { "910", kFEC_9_10}, 172 170 { "0", kFECNone }, 173 171 { NULL, kFECAuto } 174 172 }; … … 184 182 { "6/7", kFEC_6_7 }, 185 183 { "7/8", kFEC_7_8 }, 186 184 { "8/9", kFEC_8_9 }, 185 { "3/5", kFEC_3_5 }, 186 { "9/10", kFEC_9_10}, 187 187 { "none", kFECNone }, 188 188 { NULL, kFECAuto } 189 189 }; … … 199 199 "6/7", ///< kFEC_6_7 200 200 "7/8", ///< kFEC_7_8 201 201 "8/9", ///< kFEC_8_9 202 "auto" ///< kFECAuto 202 "3/5", ///< kFEC_3_5 203 "9/10", ///< kFEC_9_10 204 "auto", ///< kFECAuto 203 205 }; 204 206 205 207 const DTVParamHelperStruct DTVModulation::confTable[] = … … 220 222 { "32APSK", kModulation32APSK }, 221 223 { "8PSK", kModulation8PSK }, 222 224 { "16PSK", kModulation16PSK }, 225 { "DQPSK", kModulationDQPSK }, 223 226 { "analog", kModulationAnalog }, 224 227 { NULL, kModulationQAMAuto }, 225 228 }; … … 232 235 { "64", kModulationQAM64 }, 233 236 { "128", kModulationQAM128 }, 234 237 { "256", kModulationQAM256 }, 238 { "2", kModulationQPSK }, 239 { "10", kModulation8VSB }, 240 { "11", kModulation16VSB }, 241 { "6", kModulation16APSK }, 242 { "7", kModulation32APSK }, 243 { "5", kModulation8PSK }, 235 244 { "0", kModulationQPSK }, 236 245 { NULL, kModulationQAMAuto }, 237 246 }; … … 254 263 { "32apsk", kModulation32APSK }, 255 264 { "8psk", kModulation8PSK }, 256 265 { "16psk", kModulation16PSK }, 266 { "dqpsk", kModulationDQPSK }, 257 267 // alternates 258 268 { "a", kModulationQAMAuto }, 259 269 { "qam_auto", kModulationQAMAuto }, … … 272 282 { "32-apsk", kModulation32APSK }, 273 283 { "8-psk", kModulation8PSK }, 274 284 { "16-psk", kModulation16PSK }, 285 { "dq-psk", kModulationDQPSK }, 275 286 { NULL, kModulationQAMAuto }, 276 287 }; 277 288 … … 293 304 "32apsk", ///< kModulation32APSK 294 305 "8psk", ///< kModulation8PSK 295 306 "16psk", ///< kModulation16PSK 307 "dqpsk", ///< kModulationDQPSK 296 308 }; 297 309 298 310 const DTVParamHelperStruct DTVTransmitMode::confTable[] = … … 420 432 "r", ///< kPolarityRight 421 433 "l" ///< kPolarityLeft 422 434 }; 435 436 const DTVParamHelperStruct DTVModulationSystem::confTable[] = 437 { 438 { "SYS_DVBS", kModulationSystemDVBS }, 439 { "SYS_DVBS2", kModulationSystemDVBS2 }, 440 { NULL, kModulationSystemDVBS }, 441 }; 442 443 const DTVParamHelperStruct DTVModulationSystem::vdrTable[] = 444 { 445 { "0", kModulationSystemDVBS }, 446 { "1", kModulationSystemDVBS2 }, 447 { NULL, kModulationSystemDVBS }, 448 }; 449 450 const DTVParamHelperStruct DTVModulationSystem::parseTable[] = 451 { 452 { "dvbs2", kModulationSystemDVBS2 }, 453 { "dvbs", kModulationSystemDVBS }, 454 { NULL, kModulationSystemDVBS }, 455 }; 456 457 const char *DTVModulationSystem::dbStr[DTVModulationSystem::kDBStrCnt] = 458 { 459 "dvbs", ///< kModulationSystemDVBS 460 "dvbs2", ///< kModulationSystemDVBS2 461 }; 462 463 const DTVParamHelperStruct DTVRollOff::confTable[] = 464 { 465 { "ROLLOFF_35", kRollOff35 }, 466 { "ROLLOFF_20", kRollOff20 }, 467 { "ROLLOFF_25", kRollOff25 }, 468 { "ROLLOFF_AUTO", kRollOffAuto }, 469 { NULL, kRollOffAuto }, 470 }; 471 472 const DTVParamHelperStruct DTVRollOff::vdrTable[] = 473 { 474 { "35", kRollOff35 }, 475 { "20", kRollOff20 }, 476 { "25", kRollOff25 }, 477 { "0", kRollOffAuto }, 478 { NULL, kRollOff35 }, 479 }; 480 481 const DTVParamHelperStruct DTVRollOff::parseTable[] = 482 { 483 { "0.35", kRollOff35 }, 484 { "0.20", kRollOff20 }, 485 { "0.25", kRollOff25 }, 486 { "auto", kRollOffAuto }, 487 { NULL, kRollOff35 }, 488 }; 489 490 const char *DTVRollOff::dbStr[DTVRollOff::kDBStrCnt] = 491 { 492 "0.35", ///< kRollOff35 493 "0.20", ///< kRollOff20 494 "0.25", ///< kRollOff25 495 "auto", ///< kRollOffAuto 496 }; -
libs/libmythtv/dtvconfparser.cpp
112 112 { 113 113 if ((type == OFDM) && (str == "T")) 114 114 ok &= ParseVDR(list, channelNo); 115 else if (( type == QPSK) && (str == "S"))115 else if (((type == QPSK) || (type == DVBS2)) && (str == "S")) 116 116 ok &= ParseVDR(list, channelNo); 117 117 else if ((type == QAM) && (str == "C")) 118 118 ok &= ParseVDR(list, channelNo); … … 121 121 ok &= ParseConfOFDM(list); 122 122 else if (type == ATSC) 123 123 ok &= ParseConfATSC(list); 124 else if ( type == QPSK)124 else if ((type == QPSK) || (type == DVBS2)) 125 125 ok &= ParseConfQPSK(list); 126 126 else if (type == QAM) 127 127 ok &= ParseConfQAM(list); … … 213 213 PARSE_SKIP(unknown); 214 214 PARSE_SKIP(unknown); 215 215 PARSE_UINT(chan.serviceid); 216 mux.modulation = DTVModulation::kModulationQPSK; 216 217 217 218 AddChannel(mux, chan); 218 219 … … 274 275 case 'R': 275 276 case 'L': 276 277 mux.polarity.ParseVDR(ori); 278 case 'S': 279 mux.msystem.ParseVDR(params); 280 case 'O': 281 mux.rolloff.ParseVDR(params); 277 282 break; 278 283 default: 279 284 return false; -
libs/libmythtv/dtvmultiplex.h
49 49 const QString &symbol_rate, const QString &fec_inner, 50 50 const QString &modulation, const QString &polarity); 51 51 52 bool ParseDVB_S2( 53 const QString &frequency, const QString &inversion, 54 const QString &symbol_rate, const QString &fec_inner, 55 const QString &modulation, const QString &polarity, 56 const QString &msystem, const QString &rolloff); 57 52 58 bool ParseTuningParams( 53 59 DTVTunerType type, 54 60 QString frequency, QString inversion, QString symbolrate, 55 61 QString fec, QString polarity, 56 62 QString hp_code_rate, QString lp_code_rate, QString constellation, 57 63 QString trans_mode, QString guard_interval, QString hierarchy, 58 QString modulation, QString bandwidth); 64 QString modulation, QString bandwidth, 65 QString msystem, QString rolloff); 59 66 60 67 QString toString() const; 61 68 62 69 public: 63 70 // Basic tuning 64 uint64_t frequency; 65 uint64_t symbolrate; 66 DTVInversion inversion; 67 DTVBandwidth bandwidth; 68 DTVCodeRate hp_code_rate; ///< High Priority FEC rate 69 DTVCodeRate lp_code_rate; ///< Low Priority FEC rate 70 //DTVModulation constellation; ///< Modulation for OFDM, TODO Remove 71 DTVModulation modulation; 72 DTVTransmitMode trans_mode; 73 DTVGuardInterval guard_interval; 74 DTVHierarchy hierarchy; 75 DTVPolarity polarity; 76 DTVCodeRate fec; ///< Inner Forward Error Correction rate 71 uint64_t frequency; 72 uint64_t symbolrate; 73 DTVInversion inversion; 74 DTVBandwidth bandwidth; 75 DTVCodeRate hp_code_rate; ///< High Priority FEC rate 76 DTVCodeRate lp_code_rate; ///< Low Priority FEC rate 77 //DTVModulation constellation; ///< Modulation for OFDM, TODO Remove 78 DTVModulation modulation; 79 DTVTransmitMode trans_mode; 80 DTVGuardInterval guard_interval; 81 DTVHierarchy hierarchy; 82 DTVPolarity polarity; 83 DTVCodeRate fec; ///< Inner Forward Error Correction rate 84 DTVModulationSystem msystem; 85 DTVRollOff rolloff; 77 86 78 87 // Optional additional info 79 88 uint mplex; -
libs/libmythtv/channelutil.h
67 67 signed char trans_mode, 68 68 QString inner_FEC, QString constellation, 69 69 signed char hierarchy, QString hp_code_rate, 70 QString lp_code_rate, QString guard_interval); 70 QString lp_code_rate, QString guard_interval, 71 QString msystem, QString rolloff); 71 72 72 73 static uint CreateMultiplex(uint sourceid, const DTVMultiplex&, 73 74 int transport_id, int network_id); … … 85 86 static int GetBetterMplexID(int current_mplexid, 86 87 int transport_id, int network_id); 87 88 88 static bool GetTuningParams(uint mplexid,89 static bool GetTuningParams(uint mplexid, 89 90 QString &modulation, 90 91 uint64_t &frequency, 91 92 uint &dvb_transportid, 92 93 uint &dvb_networkid, 94 QString &dvb_msystem, 95 QString &dvb_rolloff, 93 96 QString &si_std); 94 97 95 98 static bool GetATSCChannel(uint sourceid, const QString &channum, … … 156 159 QString &tvformat, QString &modulation, 157 160 QString &freqtable, QString &freqid, 158 161 int &finetune, uint64_t &frequency, 159 QString &dtv_si_std, int &mpeg_prog_num,162 QString &dtv_si_std, int &mpeg_prog_num, 160 163 uint &atsc_major, uint &atsc_minor, 161 164 uint &dvb_transportid, uint &dvb_networkid, 165 QString &dvb_msystem, QString &dvb_rolloff, 162 166 uint &mplexid, bool &commfree); 163 167 static bool GetChannelSettings(int chanid, bool &useonairguide, 164 168 bool &hidden); -
libs/libmythtv/cardutil.h
54 54 HDHOMERUN = 10, 55 55 FREEBOX = 11, 56 56 HDPVR = 12, 57 DVBS2 = 13, 57 58 }; 58 59 59 60 static enum CARD_TYPES toCardType(const QString &name) … … 84 85 return FREEBOX; 85 86 if ("HDPVR" == name) 86 87 return HDPVR; 88 if ("DVB_S2" == name) 89 return DVBS2; 87 90 return ERROR_UNKNOWN; 88 91 } 89 92 -
libs/libmythtv/scanwizardhelpers.h
243 243 // seen in the Network Information Tables to the scan. 244 244 NITAddScan_OFDM, 245 245 NITAddScan_QPSK, 246 NITAddScan_DVBS2, 246 247 NITAddScan_QAM, 247 248 // Scan of all transports already in the database 248 249 FullTransportScan, … … 274 275 QString GetATSCFormat(const QString&) const; 275 276 QString GetFrequencyStandard(void) const; 276 277 QString GetModulation(void) const; 278 QString GetRollOff(void) const; 277 279 QString GetFrequencyTable(void) const; 278 280 bool DoIgnoreSignalTimeout(void) const; 279 281 QString GetFilename(void) const; … … 510 512 { 511 513 addSelection(QObject::tr("Auto"),"auto",true); 512 514 addSelection("QPSK","qpsk"); 513 #ifdef FE_GET_EXTENDED_INFO514 515 addSelection("8PSK","8psk"); 515 #endif516 516 addSelection("QAM 16","qam_16"); 517 517 addSelection("QAM 32","qam_32"); 518 518 addSelection("QAM 64","qam_64"); … … 531 531 }; 532 532 }; 533 533 534 class ScanModulationSystemSetting: public ComboBoxSetting 535 { 536 public: 537 ScanModulationSystemSetting(Storage *_storage) : ComboBoxSetting(_storage) 538 { 539 addSelection("DVB-S","dvbs",true); 540 addSelection("DVB-S2","dvbs2"); 541 }; 542 }; 543 544 class ScanModulationSystem: public ScanModulationSystemSetting, public TransientStorage 545 { 546 public: 547 ScanModulationSystem() : ScanModulationSystemSetting(this) 548 { 549 setLabel(QObject::tr("Modul. System")); 550 setHelpText(QObject::tr("Modulation System (Default: DVB-S)")); 551 }; 552 }; 553 554 class ScanRollOffSetting: public ComboBoxSetting 555 { 556 public: 557 ScanRollOffSetting(Storage *_storage) : ComboBoxSetting(_storage) 558 { 559 addSelection(QObject::tr("Auto"),"auto"); 560 addSelection("0.35","0.35",true); 561 addSelection("0.20","0.20"); 562 addSelection("0.25","0.25"); 563 }; 564 }; 565 566 class ScanRollOff: public ScanRollOffSetting, public TransientStorage 567 { 568 public: 569 ScanRollOff() : ScanRollOffSetting(this) 570 { 571 setLabel(QObject::tr("RollOff")); 572 setHelpText(QObject::tr("RollOff (Default: 0.35)")); 573 }; 574 }; 575 534 576 class ScanConstellation: public ScanModulationSetting, 535 577 public TransientStorage 536 578 { … … 552 594 addSelection("1/2"); 553 595 addSelection("2/3"); 554 596 addSelection("3/4"); 597 addSelection("3/5"); 555 598 addSelection("4/5"); 556 599 addSelection("5/6"); 557 600 addSelection("6/7"); 558 601 addSelection("7/8"); 559 602 addSelection("8/9"); 603 addSelection("9/10"); 560 604 } 561 605 }; 562 606 … … 692 736 left->addChild( pfrequency = new ScanFrequency()); 693 737 left->addChild( ppolarity = new ScanPolarity()); 694 738 left->addChild( psymbolrate = new ScanSymbolRate()); 695 right->addChild(pfec = new ScanFec()); 739 left->addChild( pfec = new ScanFec()); 740 right->addChild(pmsystem = new ScanModulationSystem()); 696 741 right->addChild(pmodulation = new ScanModulation()); 697 742 right->addChild(pinversion = new ScanInversion()); 743 right->addChild(prolloff = new ScanRollOff()); 698 744 addChild(left); 699 745 addChild(right); 700 746 } … … 704 750 QString inversion(void) const { return pinversion->getValue(); } 705 751 QString fec(void) const { return pfec->getValue(); } 706 752 QString polarity(void) const { return ppolarity->getValue(); } 753 QString msystem(void) const { return pmsystem->getValue(); } 707 754 QString modulation(void) const { return pmodulation->getValue(); } 755 QString rolloff(void) const { return prolloff->getValue(); } 708 756 709 757 protected: 710 ScanFrequency *pfrequency; 711 ScanSymbolRate *psymbolrate; 712 ScanInversion *pinversion; 713 ScanFec *pfec; 714 ScanPolarity *ppolarity; 715 ScanModulation *pmodulation; 758 ScanFrequency *pfrequency; 759 ScanSymbolRate *psymbolrate; 760 ScanInversion *pinversion; 761 ScanFec *pfec; 762 ScanPolarity *ppolarity; 763 ScanModulation *pmodulation; 764 ScanModulationSystem *pmsystem; 765 ScanRollOff *prolloff; 716 766 }; 717 767 718 768 class QPSKPane : public HorizontalConfigurationGroup -
libs/libmythtv/scanwizardscanner.cpp
362 362 363 363 ok = scanner->ScanTransports(sourceid, freq_std, mod, tbl); 364 364 } 365 else if ((ScanTypeSetting::NITAddScan_OFDM == scantype) || 366 (ScanTypeSetting::NITAddScan_QPSK == scantype) || 367 (ScanTypeSetting::NITAddScan_QAM == scantype)) 365 else if ((ScanTypeSetting::NITAddScan_OFDM == scantype) || 366 (ScanTypeSetting::NITAddScan_QPSK == scantype) || 367 (ScanTypeSetting::NITAddScan_DVBS2 == scantype) || 368 (ScanTypeSetting::NITAddScan_QAM == scantype)) 368 369 { 369 370 VERBOSE(VB_SIPARSER, LOC + "ScanTransports()"); 370 371 … … 440 441 channels.clear(); 441 442 442 443 DTVConfParser::cardtype_t type = DTVConfParser::UNKNOWN; 443 type = (CardUtil::OFDM == cardtype) ? DTVConfParser::OFDM : type; 444 type = (CardUtil::QPSK == cardtype) ? DTVConfParser::QPSK : type; 445 type = (CardUtil::QAM == cardtype) ? DTVConfParser::QAM : type; 444 type = (CardUtil::OFDM == cardtype) ? DTVConfParser::OFDM : type; 445 type = (CardUtil::QPSK == cardtype) ? DTVConfParser::QPSK : type; 446 type = (CardUtil::DVBS2 == cardtype) ? DTVConfParser::DVBS2 : type; 447 type = (CardUtil::QAM == cardtype) ? DTVConfParser::QAM : type; 446 448 type = ((CardUtil::ATSC == cardtype)||(CardUtil::HDHOMERUN == cardtype)) ? 447 449 DTVConfParser::ATSC : type; 448 450 … … 488 490 if ("DVB" == card_type) 489 491 { 490 492 QString sub_type = CardUtil::ProbeDVBType(device).toUpper(); 491 bool need_nit = (("QAM" == sub_type) || 492 ("QPSK" == sub_type) || 493 ("OFDM" == sub_type)); 493 bool need_nit = (("QAM" == sub_type) || 494 ("QPSK" == sub_type) || 495 ("DVB_S2" == sub_type) || 496 ("OFDM" == sub_type)); 494 497 495 498 // Ugh, Some DVB drivers don't fully support signal monitoring... 496 499 if ((ScanTypeSetting::TransportScan == scantype) || -
libs/libmythtv/hdhrchannel.cpp
291 291 292 292 // Fetch tuning data from the database. 293 293 QString tvformat, modulation, freqtable, freqid, si_std; 294 QString msystem, rolloff; 294 295 int finetune; 295 296 uint64_t frequency; 296 297 int mpeg_prog_num; … … 301 302 tvformat, modulation, freqtable, freqid, 302 303 finetune, frequency, 303 304 si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 305 msystem, rolloff, 304 306 mplexid, commfree)) 305 307 { 306 308 return false; … … 369 371 uint64_t frequency; 370 372 uint transportid; 371 373 uint dvb_networkid; 372 374 QString dvb_msystem; 375 QString dvb_rolloff; 376 373 377 if (!ChannelUtil::GetTuningParams( 374 378 mplexid, modulation, frequency, 375 transportid, dvb_networkid, si_std)) 379 transportid, dvb_networkid, 380 dvb_msystem, dvb_rolloff, si_std)) 376 381 { 377 382 VERBOSE(VB_IMPORTANT, LOC_ERR + "TuneMultiplex(): " + 378 383 QString("Could not find tuning parameters for multiplex %1.") -
libs/libmythtv/siscan.cpp
901 901 nextIt = transport_scan_items_it_t( scanTransports.end() ); 902 902 903 903 DTVMultiplex tuning; 904 904 DTVModulation modulation; 905 DTVModulationSystem msystem; 905 906 DTVTunerType type; 906 907 907 908 if (std == "dvb") 908 909 { 909 ok = type.Parse(mod); 910 if (!modulation.Parse(*(startChan.find("modulation")))) 911 { 912 VERBOSE(VB_IMPORTANT, LOC + "Wrong modulation."); 913 return false; 914 } 915 916 if (modulation == DTVModulation::kModulationQPSK) 917 { 918 type = DTVTunerType::kTunerTypeQPSK; 919 ok = true; 920 if (startChan.find("msystem") != startChan.end()) 921 { 922 if (!msystem.Parse(*(startChan.find("msystem")))) 923 { 924 VERBOSE(VB_IMPORTANT, LOC + "Wrong modulation system."); 925 return false; 926 } 927 if (msystem == DTVModulationSystem::kModulationSystemDVBS2) 928 type = DTVTunerType::kTunerTypeDVB_S2; 929 } 930 } 931 else if (modulation == DTVModulation::kModulation8PSK) 932 { 933 type = DTVTunerType::kTunerTypeDVB_S2; 934 ok = true; 935 } 936 else 937 ok = type.Parse(mod); 910 938 } 911 939 else if (std == "atsc") 912 940 { … … 924 952 startChan["coderate_hp"], startChan["coderate_lp"], 925 953 startChan["constellation"], startChan["trans_mode"], 926 954 startChan["guard_interval"], startChan["hierarchy"], 927 startChan["modulation"], startChan["bandwidth"]); 955 startChan["modulation"], startChan["bandwidth"], 956 startChan["msystem"], startChan["rolloff"]); 928 957 } 929 958 930 959 if (ok) … … 1564 1593 const uint transportid, const uint networkid) 1565 1594 { 1566 1595 uint64_t db_freq; 1567 QString tmp_modulation ;1596 QString tmp_modulation, tmp_msystem, tmp_rolloff; 1568 1597 QString tmp_si_std; 1569 1598 uint tmp_transportid, tmp_networkid; 1570 1599 int mplexid; … … 1578 1607 1579 1608 if (!ChannelUtil::GetTuningParams( 1580 1609 (uint)mplexid, tmp_modulation, 1581 db_freq, tmp_transportid, tmp_networkid, tmp_ si_std))1610 db_freq, tmp_transportid, tmp_networkid, tmp_msystem, tmp_rolloff, tmp_si_std)) 1582 1611 { 1583 1612 return tuning_freq; 1584 1613 } -
libs/libmythtv/dtvconfparser.h
80 80 { 81 81 public: 82 82 enum return_t { ERROR_CARDTYPE, ERROR_OPEN, ERROR_PARSE, OK }; 83 enum cardtype_t { ATSC, OFDM, QPSK, QAM, UNKNOWN };83 enum cardtype_t { ATSC, OFDM, QPSK, DVBS2, QAM, UNKNOWN }; 84 84 85 85 DTVConfParser(enum cardtype_t _type, uint sourceid, const QString &_file); 86 86 virtual ~DTVConfParser() { } -
libs/libmythtv/channelbase.cpp
190 190 191 191 // Fetch tuning data from the database. 192 192 QString tvformat, modulation, freqtable, freqid, dtv_si_std; 193 QString msystem, rolloff; 193 194 int finetune; 194 195 uint64_t frequency; 195 196 int mpeg_prog_num; … … 201 202 tvformat, modulation, freqtable, freqid, 202 203 finetune, frequency, 203 204 dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 205 msystem, rolloff, 204 206 mplexid, commfree)) 205 207 { 206 208 VERBOSE(VB_IMPORTANT, loc + " " + QString( -
libs/libmythtv/dvbchannel.h
117 117 QString frontend_name; 118 118 DTVTunerType card_type; 119 119 uint64_t capabilities; 120 uint64_t ext_modulations;121 120 uint64_t frequency_minimum; 122 121 uint64_t frequency_maximum; 123 122 uint symbol_rate_minimum; -
libs/libmythtv/channelutil.cpp
77 77 "WHERE sourceid = :SOURCEID " 78 78 " AND sistandard = :SISTANDARD "; 79 79 80 if (sistandard.toLower() != "dvb")80 if (sistandard.toLower().left(3) != "dvb") 81 81 qstr += "AND frequency = :FREQUENCY "; 82 82 else 83 83 { … … 91 91 query.bindValue(":SOURCEID", db_source_id); 92 92 query.bindValue(":SISTANDARD", sistandard); 93 93 94 if (sistandard.toLower() != "dvb")94 if (sistandard.toLower().left(3) != "dvb") 95 95 query.bindValue(":FREQUENCY", frequency); 96 96 else 97 97 { … … 121 121 signed char trans_mode, 122 122 QString inner_FEC, QString constellation, 123 123 signed char hierarchy, QString hp_code_rate, 124 QString lp_code_rate, QString guard_interval) 124 QString lp_code_rate, QString guard_interval, 125 QString msystem, QString rolloff) 125 126 { 126 127 MSqlQuery query(MSqlQuery::InitCon()); 127 128 … … 135 136 // DVB specific 136 137 transport_id, network_id); 137 138 138 bool isDVB = (sistandard.toLower() == "dvb");139 bool isDVB = (sistandard.toLower().left(3) == "dvb"); 139 140 140 141 QString updateStr = 141 142 "UPDATE dtv_multiplex " … … 165 166 "lp_code_rate = :LP_CODE_RATE, " : ""; 166 167 updateStr += (!guard_interval.isNull()) ? 167 168 "guard_interval = :GUARD_INTERVAL, " : ""; 169 updateStr += (!msystem.isNull()) ? 170 "msystem = :MSYSTEM, " : ""; 171 updateStr += (!rolloff.isNull()) ? 172 "rolloff = :ROLLOFF, " : ""; 168 173 169 174 updateStr = updateStr.left(updateStr.length()-2) + " "; 170 175 … … 194 199 insertStr += (!hp_code_rate.isNull()) ? "hp_code_rate, " : ""; 195 200 insertStr += (!lp_code_rate.isNull()) ? "lp_code_rate, " : ""; 196 201 insertStr += (!guard_interval.isNull()) ? "guard_interval, " : ""; 202 insertStr += (!msystem.isNull()) ? "msystem, " : ""; 203 insertStr += (!rolloff.isNull()) ? "rolloff, " : ""; 197 204 insertStr = insertStr.left(insertStr.length()-2) + ") "; 198 205 199 206 insertStr += … … 213 220 insertStr += (!hp_code_rate.isNull()) ? ":HP_CODE_RATE, " : ""; 214 221 insertStr += (!lp_code_rate.isNull()) ? ":LP_CODE_RATE, " : ""; 215 222 insertStr += (!guard_interval.isNull()) ? ":GUARD_INTERVAL, " : ""; 223 insertStr += (!msystem.isNull()) ? ":MSYSTEM, " : ""; 224 insertStr += (!rolloff.isNull()) ? ":ROLLOFF, " : ""; 216 225 insertStr = insertStr.left(insertStr.length()-2) + ");"; 217 226 218 227 query.prepare((mplex) ? updateStr : insertStr); … … 254 263 query.bindValue(":LP_CODE_RATE", lp_code_rate); 255 264 if (!guard_interval.isNull()) 256 265 query.bindValue(":GUARD_INTERVAL",guard_interval); 266 if (!msystem.isNull()) 267 query.bindValue(":MSYSTEM", msystem); 268 if (!rolloff.isNull()) 269 query.bindValue(":ROLLOFF", rolloff); 257 270 258 271 if (!query.exec() || !query.isActive()) 259 272 { … … 292 305 { 293 306 QString dummy_mod; 294 307 QString dummy_sistd; 308 QString dummy_msystem; 309 QString dummy_rolloff; 295 310 uint dummy_tsid, dummy_netid; 296 311 ChannelUtil::GetTuningParams(mux, dummy_mod, freq, 297 dummy_tsid, dummy_netid, dummy_sistd); 312 dummy_tsid, dummy_netid, 313 dummy_msystem, dummy_rolloff, 314 dummy_sistd); 298 315 } 299 316 300 317 mux = ChannelUtil::CreateMultiplex( … … 307 324 cd.TransmissionModeString()[0].toAscii(), 308 325 QString(), cd.ConstellationString(), 309 326 cd.HierarchyString()[0].toAscii(), cd.CodeRateHPString(), 310 cd.CodeRateLPString(), cd.GuardIntervalString()); 327 cd.CodeRateLPString(), cd.GuardIntervalString(), 328 QString(), QString()); 311 329 312 330 if (mux) 313 331 muxes.push_back(mux); … … 334 352 -1, 335 353 cd.FECInnerString(), QString(), 336 354 -1, QString(), 337 QString(), QString()); 355 QString(), QString(), 356 cd.ModulationSystemString(), cd.RollOffString()); 338 357 339 358 if (mux) 340 359 muxes.push_back(mux); … … 357 376 -1, 358 377 cd.FECInnerString(), QString::null, 359 378 -1, QString::null, 379 QString::null, QString::null, 360 380 QString::null, QString::null); 361 381 362 382 if (mux) … … 377 397 -1, 378 398 QString::null, QString::null, 379 399 -1, QString::null, 400 QString::null, QString::null, 380 401 QString::null, QString::null); 381 402 } 382 403 … … 390 411 signed char trans_mode, 391 412 QString inner_FEC, QString constellation, 392 413 signed char hierarchy, QString hp_code_rate, 393 QString lp_code_rate, QString guard_interval) 414 QString lp_code_rate, QString guard_interval, 415 QString msystem, QString rolloff) 394 416 { 395 417 return insert_dtv_multiplex( 396 418 sourceid, sistandard, … … 402 424 trans_mode, 403 425 inner_FEC, constellation, 404 426 hierarchy, hp_code_rate, 405 lp_code_rate, guard_interval); 427 lp_code_rate, guard_interval, 428 msystem, rolloff); 406 429 } 407 430 408 431 uint ChannelUtil::CreateMultiplex(uint sourceid, const DTVMultiplex &mux, … … 418 441 mux.trans_mode.toChar().toAscii(), 419 442 mux.fec.toString(), mux.modulation.toString(), 420 443 mux.hierarchy.toChar().toAscii(), mux.hp_code_rate.toString(), 421 mux.lp_code_rate.toString(), mux.guard_interval.toString()); 444 mux.lp_code_rate.toString(), mux.guard_interval.toString(), 445 mux.msystem.toString(), mux.rolloff.toString()); 422 446 } 423 447 424 448 … … 706 730 uint64_t &frequency, 707 731 uint &dvb_transportid, 708 732 uint &dvb_networkid, 733 QString &dvb_msystem, 734 QString &dvb_rolloff, 709 735 QString &si_std) 710 736 { 711 737 if (!mplexid || (mplexid == 32767)) /* 32767 deals with old lineups */ … … 713 739 714 740 MSqlQuery query(MSqlQuery::InitCon()); 715 741 query.prepare( 716 "SELECT transportid, networkid, frequency, modulation, sistandard "742 "SELECT transportid, networkid, frequency, modulation, sistandard, msystem, rolloff " 717 743 "FROM dtv_multiplex " 718 744 "WHERE mplexid = :MPLEXID"); 719 745 query.bindValue(":MPLEXID", mplexid); … … 732 758 frequency = (uint64_t) query.value(2).toDouble(); // Qt 3.1 compat 733 759 modulation = query.value(3).toString(); 734 760 si_std = query.value(4).toString(); 735 761 dvb_msystem = query.value(5).toString(); 762 dvb_rolloff = query.value(6).toString(); 763 736 764 return true; 737 765 } 738 766 … … 1483 1511 QString &dtv_si_std, int &mpeg_prog_num, 1484 1512 uint &atsc_major, uint &atsc_minor, 1485 1513 uint &dvb_transportid, uint &dvb_networkid, 1514 QString &dvb_msystem, QString &dvb_rolloff, 1486 1515 uint &mplexid, 1487 1516 bool &commfree) 1488 1517 { … … 1493 1522 mpeg_prog_num = -1; 1494 1523 atsc_major = atsc_minor = mplexid = 0; 1495 1524 dvb_networkid = dvb_transportid = 0; 1525 dvb_msystem = dvb_rolloff = QString::null; 1496 1526 commfree = false; 1497 1527 1498 1528 MSqlQuery query(MSqlQuery::InitCon()); … … 1533 1563 1534 1564 if (!mplexid || (mplexid == 32767)) /* 32767 deals with old lineups */ 1535 1565 return true; 1536 1566 1537 1567 return GetTuningParams(mplexid, modulation, frequency, 1538 dvb_transportid, dvb_networkid, dtv_si_std); 1568 dvb_transportid, dvb_networkid, 1569 dvb_msystem, dvb_rolloff, dtv_si_std); 1539 1570 } 1540 1571 1541 1572 bool ChannelUtil::GetChannelSettings(int chanid, bool &useonairguide, -
libs/libmythtv/mpeg/dvbdescriptors.h
685 685 // FEC_inner 4 12.4 686 686 enum 687 687 { 688 kInnerFEC_1_2_ConvolutionCodeRate = 0x1, 689 kInnerFEC_2_3_ConvolutionCodeRate = 0x2, 690 kInnerFEC_3_4_ConvolutionCodeRate = 0x3, 691 kInnerFEC_5_6_ConvolutionCodeRate = 0x4, 692 kInnerFEC_7_8_ConvolutionCodeRate = 0x5, 693 kInnerFEC_8_9_ConvolutionCodeRate = 0x6, 694 kInnerFEC_None = 0xF, 688 kInnerFEC_1_2_ConvolutionCodeRate = 0x1, 689 kInnerFEC_2_3_ConvolutionCodeRate = 0x2, 690 kInnerFEC_3_4_ConvolutionCodeRate = 0x3, 691 kInnerFEC_5_6_ConvolutionCodeRate = 0x4, 692 kInnerFEC_7_8_ConvolutionCodeRate = 0x5, 693 kInnerFEC_8_9_ConvolutionCodeRate = 0x6, 694 kInnerFEC_3_5_ConvolutionCodeRate = 0x7, 695 kInnerFEC_4_5_ConvolutionCodeRate = 0x8, 696 kInnerFEC_9_10_ConvolutionCodeRate = 0x9, 697 kInnerFEC_None = 0xF, 695 698 }; 696 699 uint FECInner() const { return _data[12] & 0xf; } 697 700 QString FECInnerString() const { return coderate_inner(FECInner()); } … … 745 748 bool IsLinearPolarization() const { return !((_data[8]>>6)&0x1); } 746 749 bool IsHorizontalLeftPolarization() const { return (_data[8]>>5)&0x1; } 747 750 bool IsVerticalRightPolarization() const { return !((_data[8]>>5)&0x1); } 748 // modulation 5 8.3 751 // rolloff 2 8.3 752 uint RollOff() const { return (_data[8]>>3)&0x3; } 753 QString RollOffString() const 754 { 755 static QString ps[] = { "0.35", "0.20", "0.25", "auto" }; 756 return ps[RollOff()]; 757 } 758 // modulation system 3 8.5 749 759 enum 750 760 { 761 kModulationSystemDVBS = 0x0, 762 kModulationSystemDVBS2 = 0x1, 763 }; 764 uint ModulationSystem() const { return _data[8]>>2&0x1; } 765 QString ModulationSystemString() const 766 { 767 static QString mss[] = { "dvbs", "dvbs2" }; 768 return (mss[ModulationSystem()]); 769 } 770 // modulation 4 8.6 771 772 enum 773 { 751 774 kModulationQPSK_NS = 0x0, // Non standard QPSK for Bell ExpressVu 752 775 kModulationQPSK = 0x1, 753 776 kModulation8PSK = 0x2, 754 777 kModulationQAM16 = 0x3, 755 778 }; 756 uint Modulation() const { return _data[8]&0x 1f; }779 uint Modulation() const { return _data[8]&0x3; } 757 780 QString ModulationString() const 758 781 { 759 782 static QString ms[] = { "qpsk", "qpsk", "8psk", "qam_16" }; … … 773 796 // FEC_inner 4 12.4 774 797 enum 775 798 { 776 kInnerFEC_1_2_ConvolutionCodeRate = 0x1, 777 kInnerFEC_2_3_ConvolutionCodeRate = 0x2, 778 kInnerFEC_3_4_ConvolutionCodeRate = 0x3, 779 kInnerFEC_5_6_ConvolutionCodeRate = 0x4, 780 kInnerFEC_7_8_ConvolutionCodeRate = 0x5, 781 kInnerFEC_8_9_ConvolutionCodeRate = 0x6, 782 kInnerFEC_None = 0xF, 799 kInnerFEC_1_2_ConvolutionCodeRate = 0x1, 800 kInnerFEC_2_3_ConvolutionCodeRate = 0x2, 801 kInnerFEC_3_4_ConvolutionCodeRate = 0x3, 802 kInnerFEC_5_6_ConvolutionCodeRate = 0x4, 803 kInnerFEC_7_8_ConvolutionCodeRate = 0x5, 804 kInnerFEC_8_9_ConvolutionCodeRate = 0x6, 805 kInnerFEC_3_5_ConvolutionCodeRate = 0x7, 806 kInnerFEC_4_5_ConvolutionCodeRate = 0x8, 807 kInnerFEC_9_10_ConvolutionCodeRate = 0x9, 808 kInnerFEC_Auto = 0xA, 809 kInnerFEC_None = 0xF, 783 810 }; 784 811 uint FECInner() const { return _data[12] & 0xf; } 785 812 QString FECInnerString() const { return coderate_inner(FECInner()); } … … 1765 1792 case 0x3: return "3/4"; 1766 1793 case 0x4: return "5/6"; 1767 1794 case 0x5: return "7/8"; 1768 case 0x8: return "8/9"; 1795 case 0x6: return "8/9"; 1796 case 0x7: return "3/5"; 1797 case 0x8: return "4/5"; 1798 case 0x9: return "9/10"; 1769 1799 case 0xf: return "none"; 1770 1800 default: return "auto"; // not actually defined in spec 1771 1801 } -
libs/libmythtv/mpeg/dvbdescriptors.cpp
369 369 QString str = QString("SatelliteDeliverySystemDescriptor: "); 370 370 371 371 str.append(QString("Frequency: %1\n").arg(FrequencyHz())); 372 str.append(QString(" Mod=%1, SymbR=%2, FECInner=%3, Orbit=%4, Pol=%5") 372 str.append(QString(" ModSys=%1, Mod=%2, RollOff=%3. SymbR=%4, FECInner=%5, Orbit=%6, Pol=%7") 373 .arg(ModulationSystemString()) 373 374 .arg(ModulationString()) 375 .arg(RollOffString()) 374 376 .arg(SymbolRateHz()) 375 377 .arg(FECInnerString()) 376 378 .arg(OrbitalPositionString()) -
libs/libmythtv/v4lchannel.cpp
453 453 454 454 // Fetch tuning data from the database. 455 455 QString tvformat, modulation, freqtable, freqid, dtv_si_std; 456 QString msystem, rolloff; 456 457 int finetune; 457 458 uint64_t frequency; 458 459 int mpeg_prog_num; … … 463 464 tvformat, modulation, freqtable, freqid, 464 465 finetune, frequency, 465 466 dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 467 msystem, rolloff, 466 468 mplexid, commfree)) 467 469 { 468 470 return false; … … 738 740 uint64_t frequency; 739 741 uint transportid; 740 742 uint dvb_networkid; 741 743 QString dvb_msystem; 744 QString dvb_rolloff; 745 742 746 if (!ChannelUtil::GetTuningParams( 743 747 mplexid, modulation, frequency, 744 transportid, dvb_networkid, si_std)) 748 transportid, dvb_networkid, 749 dvb_msystem, dvb_rolloff, si_std)) 745 750 { 746 751 VERBOSE(VB_IMPORTANT, LOC_ERR + "TuneMultiplex(): " + 747 752 QString("Could not find tuning parameters for multiplex %1.") -
libs/libmythtv/dvbtypes.h
20 20 #include <linux/dvb/dmx.h> 21 21 22 22 #if (DVB_API_VERSION != 3 && DVB_API_VERSION != 5) 23 # error "DVB driver includes with API version 3 not found!"23 # error "DVB driver includes with API version 3 or 5 not found!" 24 24 #endif 25 25 26 26 #ifndef DVB_API_VERSION_MINOR 27 27 # define DVB_API_VERSION_MINOR 0 28 28 #endif 29 29 30 #if (DVB_API_VERSION == 5) 31 # define USE_DVB_V5 32 #endif 33 30 34 #if ((DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR >= 1) || (DVB_API_VERSION > 3)) 31 35 # define USE_ATSC 32 36 #else … … 39 43 # define VSB_16 (fe_modulation)(QAM_AUTO+2) 40 44 #endif 41 45 42 #ifdef FE_GET_EXTENDED_INFO 43 #define dvb_fe_params dvb_frontend_parameters_new 44 #else 45 #define dvb_fe_params dvb_frontend_parameters 46 #endif 46 #define dvb_fe_params dvb_frontend_parameters 47 47 48 48 class QString; 49 49 QString toString(fe_status); -
libs/libmythtv/dvbchannel.cpp
49 49 50 50 static void drain_dvb_events(int fd); 51 51 static bool wait_for_backend(int fd, int timeout_ms); 52 52 53 static struct dvb_fe_params dtvmultiplex_to_dvbparams( 53 54 DTVTunerType, const DTVMultiplex&); 54 55 static DTVMultiplex dvbparams_to_dtvmultiplex( 55 56 DTVTunerType, const dvb_fe_params&); 56 57 58 #ifdef USE_DVB_V5 59 static bool dtvmultiplex_to_dtvproperties( 60 DTVTunerType, const DTVMultiplex&, struct dtv_properties*, bool do_tune); 61 static bool dtvmultiplex_to_dtvproperties( 62 DTVTunerType, const DTVMultiplex&, struct dtv_properties*); 63 static DTVMultiplex dtvproperties_to_dtvmultiplex( 64 DTVTunerType, const dtv_properties&); 65 #endif 66 57 67 #define LOC QString("DVBChan(%1:%2): ").arg(GetCardID()).arg(device) 58 68 #define LOC_WARN QString("DVBChan(%1:%2) Warning: ") \ 59 69 .arg(GetCardID()).arg(device) … … 167 177 frontend_name = master->frontend_name; 168 178 card_type = master->card_type; 169 179 capabilities = master->capabilities; 170 ext_modulations = master->ext_modulations;171 180 frequency_minimum = master->frequency_minimum; 172 181 frequency_maximum = master->frequency_maximum; 173 182 symbol_rate_minimum = master->symbol_rate_minimum; … … 210 219 return false; 211 220 } 212 221 213 #ifdef FE_GET_EXTENDED_INFO214 if (info.caps & FE_HAS_EXTENDED_INFO)215 {216 bool ok = true;217 dvb_fe_caps_extended extinfo;218 bzero(&extinfo, sizeof(extinfo));219 if (ioctl(fd_frontend, FE_GET_EXTENDED_INFO, &extinfo) < 0)220 {221 VERBOSE(VB_IMPORTANT, LOC_ERR +222 "Failed to get frontend extended information." + ENO);223 224 ok = false;225 }226 227 if (ok && (extinfo.modulations & MOD_8PSK))228 {229 if (ioctl(fd_frontend, FE_SET_STANDARD, FE_DVB_S2) < 0)230 {231 VERBOSE(VB_IMPORTANT, LOC_ERR +232 "Failed to set frontend standard to DVB-S2." + ENO);233 234 ok = false;235 }236 else if (ioctl(fd_frontend, FE_GET_INFO, &info) < 0)237 {238 VERBOSE(VB_IMPORTANT, LOC_ERR +239 "Failed to get frontend information." + ENO);240 241 ok = false;242 }243 }244 245 if (!ok)246 {247 close(fd_frontend);248 fd_frontend = -1;249 return false;250 }251 252 ext_modulations = extinfo.modulations;253 }254 #endif255 256 222 frontend_name = info.name; 257 card_type = info.type;258 223 capabilities = info.caps; 259 224 frequency_minimum = info.frequency_min; 260 225 frequency_maximum = info.frequency_max; 261 226 symbol_rate_minimum = info.symbol_rate_min; 262 227 symbol_rate_maximum = info.symbol_rate_max; 228 card_type.Parse(CardUtil::ProbeDVBType(device)); 263 229 264 VERBOSE(VB_RECORD, LOC + QString("Using DVB card %1, with frontend '%2' .")265 .arg(device).arg(frontend_name) );230 VERBOSE(VB_RECORD, LOC + QString("Using DVB card %1, with frontend '%2', type '%3'.") 231 .arg(device).arg(frontend_name).arg(card_type)); 266 232 267 233 // Turn on the power to the LNB 268 234 if (card_type == DTVTunerType::kTunerTypeQPSK || … … 309 275 bool DVBChannel::TuneMultiplex(uint mplexid, QString inputname) 310 276 { 311 277 DTVMultiplex tuning; 312 if (!tuning.FillFromDB(card_type, mplexid)) 278 bool ok = true; 279 ok = tuning.FillFromDB(card_type, mplexid); 280 if (!ok) 313 281 return false; 314 282 315 283 CheckOptions(tuning); … … 365 333 366 334 // Get the input data for the channel 367 335 QString tvformat, modulation, freqtable, freqid, si_std; 336 QString msystem, rolloff; 368 337 int finetune; 369 338 uint64_t frequency; 370 339 int mpeg_prog_num; … … 375 344 tvformat, modulation, freqtable, freqid, 376 345 finetune, frequency, 377 346 si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 347 msystem, rolloff, 378 348 mplexid, commfree)) 379 349 { 380 350 VERBOSE(VB_IMPORTANT, loc_err + … … 394 364 if (!mplexid || !tuning.FillFromDB(card_type, mplexid)) 395 365 { 396 366 VERBOSE(VB_IMPORTANT, loc_err + 397 "Failed to initialize multiplex options"); 367 QString("Failed to initialize multiplex options (card_type=%1, mplexid=%2)"). 368 arg(card_type).arg(mplexid)); 398 369 399 370 return false; 400 371 } … … 509 480 510 481 if (card_type.IsFECVariable() && !CheckCodeRate(tuning.fec)) 511 482 { 512 VERBOSE(VB_GENERAL, LOC_WARN + "Unsupported fec_inner parameter."); 483 VERBOSE(VB_GENERAL, LOC_WARN + 484 QString("Unsupported fec_inner parameter (fec=%1, caps=%2, card_type=%3).") 485 .arg(tuning.fec) 486 .arg(capabilities) 487 .arg(card_type)); 513 488 } 514 489 515 490 if (card_type.IsModulationVariable() && !CheckModulation(tuning.modulation)) … … 575 550 bool DVBChannel::CheckCodeRate(DTVCodeRate rate) const 576 551 { 577 552 const uint64_t caps = capabilities; 553 554 /* Hmm... there are no FE_CAN_FEC_3_5 or FE_CAN_FEC_9_10 capabilities 555 * in S2API defined yet. 556 * So, let's assume that every DVB-S2 device can do them... */ 557 if (card_type == DTVTunerType::kTunerTypeDVB_S2) 558 { 559 if ((DTVCodeRate::kFEC_3_5 == rate) || 560 (DTVCodeRate::kFEC_9_10 == rate)) 561 return true; 562 } 563 578 564 return 579 ((DTVCodeRate::kFECNone == rate))||580 ((DTVCodeRate::kFEC_1_2 == rate) && (caps & FE_CAN_FEC_1_2))||581 ((DTVCodeRate::kFEC_2_3 == rate) && (caps & FE_CAN_FEC_2_3))||582 ((DTVCodeRate::kFEC_3_4 == rate) && (caps & FE_CAN_FEC_3_4))||583 ((DTVCodeRate::kFEC_4_5 == rate) && (caps & FE_CAN_FEC_4_5))||584 ((DTVCodeRate::kFEC_5_6 == rate) && (caps & FE_CAN_FEC_5_6))||585 ((DTVCodeRate::kFEC_6_7 == rate) && (caps & FE_CAN_FEC_6_7))||586 ((DTVCodeRate::kFEC_7_8 == rate) && (caps & FE_CAN_FEC_7_8))||587 ((DTVCodeRate::kFEC_8_9 == rate) && (caps & FE_CAN_FEC_8_9))||588 ((DTVCodeRate::kFECAuto == rate) && (caps & FE_CAN_FEC_AUTO));565 ((DTVCodeRate::kFECNone == rate)) || 566 ((DTVCodeRate::kFEC_1_2 == rate) && (caps & FE_CAN_FEC_1_2)) || 567 ((DTVCodeRate::kFEC_2_3 == rate) && (caps & FE_CAN_FEC_2_3)) || 568 ((DTVCodeRate::kFEC_3_4 == rate) && (caps & FE_CAN_FEC_3_4)) || 569 ((DTVCodeRate::kFEC_4_5 == rate) && (caps & FE_CAN_FEC_4_5)) || 570 ((DTVCodeRate::kFEC_5_6 == rate) && (caps & FE_CAN_FEC_5_6)) || 571 ((DTVCodeRate::kFEC_6_7 == rate) && (caps & FE_CAN_FEC_6_7)) || 572 ((DTVCodeRate::kFEC_7_8 == rate) && (caps & FE_CAN_FEC_7_8)) || 573 ((DTVCodeRate::kFEC_8_9 == rate) && (caps & FE_CAN_FEC_8_9)) || 574 ((DTVCodeRate::kFECAuto == rate) && (caps & FE_CAN_FEC_AUTO)); 589 575 } 590 576 591 577 /** … … 596 582 const DTVModulation m = modulation; 597 583 const uint64_t c = capabilities; 598 584 599 #ifdef FE_GET_EXTENDED_INFO600 if ((c & FE_HAS_EXTENDED_INFO) &&601 (DTVModulation::kModulation8PSK == m) &&602 (ext_modulations & DTVModulation::kModulation8PSK))603 {604 return true;605 }606 #endif // FE_GET_EXTENDED_INFO607 608 585 return 609 586 ((DTVModulation::kModulationQPSK == m) && (c & FE_CAN_QPSK)) || 610 587 ((DTVModulation::kModulationQAM16 == m) && (c & FE_CAN_QAM_16)) || … … 640 617 bool DVBChannel::Tune(const DTVMultiplex &tuning, QString inputname) 641 618 { 642 619 int inputid = inputname.isEmpty() ? currentInputID : GetInputByName(inputname); 620 643 621 if (inputid < 0) 644 622 { 645 623 VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Tune(): Invalid input '%1'.") … … 671 649 bool same_input) 672 650 { 673 651 QMutexLocker lock(&tune_lock); 652 uint64_t frequency = tuning.frequency; 674 653 675 654 if (master) 676 655 { … … 680 659 } 681 660 682 661 bool reset = (force_reset || first_tune); 662 #ifdef USE_DVB_V5 663 struct dtv_properties cmds; 664 665 //clear card cache 666 dtv_property props[11]; 667 memset(&props, 0, sizeof(props)); 668 props[0].cmd = DTV_CLEAR; 669 cmds.num = 1; 670 cmds.props = props; 671 if (ioctl(fd_frontend, FE_SET_PROPERTY, &cmds) < 0) 672 { 673 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 674 "Clearing tuner cache failed." + ENO); 675 return false; 676 } 677 if ((!dtvmultiplex_to_dtvproperties(card_type, tuning, &cmds)) || 678 (cmds.num < 2)) 679 return false; 680 #else 683 681 struct dvb_fe_params params = dtvmultiplex_to_dvbparams(card_type, tuning); 682 #endif 684 683 685 684 bool is_dvbs = (DTVTunerType::kTunerTypeQPSK == card_type || 686 685 DTVTunerType::kTunerTypeDVB_S2 == card_type); … … 737 736 // make sure we tune to frequency, if the lnb has changed 738 737 reset = first_tune = true; 739 738 } 740 741 params.frequency = lnb->GetIntermediateFrequency(742 diseqc_settings, tuning);743 739 740 frequency = lnb->GetIntermediateFrequency(diseqc_settings, tuning); 741 #ifdef USE_DVB_V5 742 for (uint i = 0; i < cmds.num; i++) 743 { 744 if (cmds.props[i].cmd == DTV_FREQUENCY) 745 { 746 cmds.props[i].u.data = frequency; 747 break; 748 } 749 } 750 #else 751 params.frequency = frequency; 752 744 753 // if card can auto-FEC, use it -- sometimes NITs are inaccurate 745 754 if (capabilities & FE_CAN_FEC_AUTO) 746 755 params.u.qpsk.fec_inner = FEC_AUTO; 756 #endif 747 757 } 748 758 749 759 VERBOSE(VB_CHANNEL, LOC + "Old Params: " + … … 758 768 if (reset || !prev_tuning.IsEqual(card_type, tuning, 500 * freq_mult)) 759 769 { 760 770 VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") 761 .arg( params.frequency).arg(suffix));771 .arg(frequency).arg(suffix)); 762 772 763 #ifdef FE_GET_EXTENDED_INFO 764 if (card_type == DTVTunerType::kTunerTypeDVB_S2) 773 #ifdef USE_DVB_V5 774 VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning with %1 properties...").arg(cmds.num)); 775 if (ioctl(fd_frontend, FE_SET_PROPERTY, &cmds) < 0) 765 776 { 766 if (ioctl(fd_frontend, FE_SET_FRONTEND2, ¶ms) < 0) 767 { 768 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 769 "Setting Frontend(2) tuning parameters failed." + ENO); 770 return false; 771 } 777 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 778 "Setting Frontend tuning parameters failed." + ENO); 779 return false; 772 780 } 773 774 #endif // FE_GET_EXTENDED_INFO 781 #else 782 if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 775 783 { 776 if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 777 { 778 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 779 "Setting Frontend tuning parameters failed." + ENO); 780 return false; 781 } 784 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 785 "Setting Frontend tuning parameters failed." + ENO); 786 return false; 782 787 } 788 #endif 783 789 784 790 // Extra delay to add for broken DVB drivers 785 791 if (tuning_delay) … … 835 841 return false; 836 842 } 837 843 844 #ifdef USE_DVB_V5 845 struct dtv_properties cmds; 846 cmds.num = 0; 847 return ioctl(fd_frontend, FE_GET_PROPERTY, &cmds) >= 0; 848 #else 838 849 dvb_fe_params params; 839 850 return ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) >= 0; 851 #endif 840 852 } 841 853 842 854 /** \fn DVBChannel::ProbeTuningParams(DTVMultiplex&) const … … 868 880 return false; 869 881 } 870 882 883 int fe_ok; 884 #ifdef USE_DVB_V5 885 struct dtv_properties cmds; 886 dtv_property props[11]; 887 memset(&props, 0, sizeof(props)); 888 cmds.props = props; 889 dtvmultiplex_to_dtvproperties(card_type, tuning, &cmds, false); 890 fe_ok = ioctl(fd_frontend, FE_GET_PROPERTY, &cmds); 891 #else 871 892 dvb_fe_params params; 872 if (ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) < 0) 893 fe_ok = ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms); 894 #endif 895 if (fe_ok < 0) 873 896 { 874 897 VERBOSE(VB_IMPORTANT, LOC_ERR + 875 898 "Getting Frontend tuning parameters failed." + ENO); … … 880 903 uint mplex = tuning.mplex; 881 904 QString sistandard = tuning.sistandard; sistandard.detach(); 882 905 906 #ifdef USE_DVB_V5 907 tuning = dtvproperties_to_dtvmultiplex(card_type, cmds); 908 #else 883 909 tuning = dvbparams_to_dtvmultiplex(card_type, params); 910 #endif 884 911 885 912 tuning.mplex = mplex; 886 913 tuning.sistandard = sistandard; … … 967 994 // We use uint16_t for sig because this is correct for DVB API 4.0, 968 995 // and works better than the correct int16_t for the 3.x API 969 996 uint16_t sig = 0; 970 971 997 int ret = ioctl(fd_frontend, FE_READ_SIGNAL_STRENGTH, &sig); 972 973 998 if (ok) 974 999 *ok = (0 == ret); 975 1000 … … 987 1012 988 1013 uint16_t snr = 0; 989 1014 int ret = ioctl(fd_frontend, FE_READ_SNR, &snr); 990 991 1015 if (ok) 992 1016 *ok = (0 == ret); 993 1017 … … 1002 1026 1003 1027 uint32_t ber = 0; 1004 1028 int ret = ioctl(fd_frontend, FE_READ_BER, &ber); 1005 1006 1029 if (ok) 1007 1030 *ok = (0 == ret); 1008 1031 … … 1017 1040 1018 1041 uint32_t ublocks = 0; 1019 1042 int ret = ioctl(fd_frontend, FE_READ_UNCORRECTED_BLOCKS, &ublocks); 1020 1021 1043 if (ok) 1022 1044 *ok = (0 == ret); 1023 1045 … … 1111 1133 1112 1134 if (DTVTunerType::kTunerTypeDVB_S2 == tuner_type) 1113 1135 { 1114 #ifdef FE_GET_EXTENDED_INFO1115 params.u.qpsk2.symbol_rate = tuning.symbolrate;1116 params.u.qpsk2.fec_inner = (fe_code_rate_t) (int) tuning.fec;1117 params.u.qpsk2.modulation = (fe_modulation_t) (int) tuning.modulation;1118 #else // if !FE_GET_EXTENDED_INFO1119 1136 VERBOSE(VB_IMPORTANT, "DVBChan Error, MythTV was compiled without " 1120 1137 "DVB-S2 headers being present so DVB-S2 tuning will fail."); 1121 #endif // !FE_GET_EXTENDED_INFO1122 1138 } 1123 1139 1124 1140 if (DTVTunerType::kTunerTypeQAM == tuner_type) … … 1199 1215 1200 1216 return tuning; 1201 1217 } 1218 1219 1220 #ifdef USE_DVB_V5 1221 static DTVMultiplex dtvproperties_to_dtvmultiplex( 1222 DTVTunerType tuner_type, const dtv_properties &cmds) 1223 { 1224 DTVMultiplex tuning; 1225 1226 for (uint i = 0; i < cmds.num; i++) 1227 { 1228 switch (cmds.props[i].cmd) 1229 { 1230 case DTV_MODULATION: 1231 tuning.modulation = cmds.props[i].u.data; 1232 break; 1233 case DTV_DELIVERY_SYSTEM: 1234 switch (cmds.props[i].u.data) 1235 { 1236 case SYS_DVBS: 1237 tuning.msystem = DTVModulationSystem::kModulationSystemDVBS; 1238 break; 1239 case SYS_DVBS2: 1240 tuning.msystem = DTVModulationSystem::kModulationSystemDVBS2; 1241 break; 1242 case SYS_DVBT: 1243 case SYS_DVBC_ANNEX_AC: 1244 case SYS_DVBC_ANNEX_B: 1245 #ifdef USE_ATSC 1246 case SYS_ATSC: 1247 #endif 1248 break; 1249 default: 1250 VERBOSE(VB_IMPORTANT, "Unknown DVB delivery system." + ENO); 1251 }; 1252 break; 1253 case DTV_FREQUENCY: 1254 if (tuning.modulation == DTVModulation::kModulationQPSK || 1255 tuning.modulation == DTVModulation::kModulation8PSK) 1256 tuning.frequency = cmds.props[i].u.data / 1000UL; 1257 else 1258 tuning.frequency = cmds.props[i].u.data; 1259 break; 1260 case DTV_SYMBOL_RATE: 1261 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1262 tuner_type == DTVTunerType::kTunerTypeDVB_S2 || 1263 tuner_type == DTVTunerType::kTunerTypeQAM) 1264 { 1265 if (tuning.modulation == DTVModulation::kModulationQPSK || 1266 tuning.modulation == DTVModulation::kModulation8PSK) 1267 tuning.symbolrate = cmds.props[i].u.data / 1000UL; 1268 else 1269 tuning.symbolrate = cmds.props[i].u.data; 1270 }; 1271 break; 1272 case DTV_INNER_FEC: 1273 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1274 tuner_type == DTVTunerType::kTunerTypeDVB_S2 || 1275 tuner_type == DTVTunerType::kTunerTypeQAM) 1276 { 1277 tuning.symbolrate = cmds.props[i].u.data; 1278 } 1279 break; 1280 case DTV_PILOT: 1281 break; 1282 case DTV_ROLLOFF: 1283 if (tuner_type == DTVTunerType::kTunerTypeDVB_S2) 1284 tuning.rolloff = cmds.props[i].u.data; 1285 break; 1286 case DTV_INVERSION: 1287 tuning.inversion = cmds.props[i].u.data; 1288 break; 1289 case DTV_BANDWIDTH_HZ: 1290 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1291 tuning.bandwidth = cmds.props[i].u.data; 1292 break; 1293 case DTV_CODE_RATE_HP: 1294 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1295 tuning.hp_code_rate = cmds.props[i].u.data; 1296 break; 1297 case DTV_CODE_RATE_LP: 1298 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1299 tuning.lp_code_rate = cmds.props[i].u.data; 1300 break; 1301 case DTV_TRANSMISSION_MODE: 1302 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1303 tuning.trans_mode = cmds.props[i].u.data; 1304 break; 1305 case DTV_GUARD_INTERVAL: 1306 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1307 tuning.guard_interval = cmds.props[i].u.data; 1308 break; 1309 case DTV_HIERARCHY: 1310 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1311 tuning.hierarchy = cmds.props[i].u.data; 1312 break; 1313 case DTV_TUNE: 1314 break; 1315 default: 1316 VERBOSE(VB_IMPORTANT, "Unknown DTV command." + ENO); 1317 } 1318 } 1319 return tuning; 1320 } 1321 1322 static bool dtvmultiplex_to_dtvproperties( 1323 DTVTunerType tuner_type, 1324 const DTVMultiplex &tuning, 1325 struct dtv_properties *cmdseq) 1326 { 1327 return dtvmultiplex_to_dtvproperties(tuner_type, tuning, cmdseq, true); 1328 } 1329 1330 static bool dtvmultiplex_to_dtvproperties( 1331 DTVTunerType tuner_type, 1332 const DTVMultiplex &tuning, 1333 struct dtv_properties *cmdseq, 1334 bool do_tune) 1335 { 1336 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1337 (tuner_type == DTVTunerType::kTunerTypeDVB_S2 && 1338 tuning.modulation == DTVModulation::kModulationQPSK)) 1339 { 1340 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1341 cmdseq->props[0].u.data = SYS_DVBS; 1342 cmdseq->props[1].cmd = DTV_FREQUENCY; 1343 cmdseq->props[1].u.data = tuning.frequency; 1344 cmdseq->props[2].cmd = DTV_MODULATION; 1345 cmdseq->props[2].u.data = tuning.modulation; 1346 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1347 cmdseq->props[3].u.data = tuning.symbolrate; 1348 cmdseq->props[4].cmd = DTV_INNER_FEC; 1349 cmdseq->props[4].u.data = tuning.fec; 1350 cmdseq->props[5].cmd = DTV_INVERSION; 1351 cmdseq->props[5].u.data = tuning.inversion; 1352 if (do_tune) 1353 { 1354 cmdseq->props[6].cmd = DTV_TUNE; 1355 cmdseq->num = 7; 1356 } 1357 else 1358 { 1359 cmdseq->num = 6; 1360 } 1361 } 1362 else if (tuner_type == DTVTunerType::kTunerTypeDVB_S2 && 1363 tuning.modulation == DTVModulation::kModulation8PSK) 1364 { 1365 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1366 cmdseq->props[0].u.data = SYS_DVBS2; 1367 cmdseq->props[1].cmd = DTV_FREQUENCY; 1368 cmdseq->props[1].u.data = tuning.frequency; 1369 cmdseq->props[2].cmd = DTV_MODULATION; 1370 cmdseq->props[2].u.data = tuning.modulation; 1371 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1372 cmdseq->props[3].u.data = tuning.symbolrate; 1373 cmdseq->props[4].cmd = DTV_INNER_FEC; 1374 cmdseq->props[4].u.data = tuning.fec; 1375 cmdseq->props[5].cmd = DTV_INVERSION; 1376 cmdseq->props[5].u.data = tuning.inversion; 1377 cmdseq->props[6].cmd = DTV_PILOT; 1378 cmdseq->props[6].u.data = PILOT_AUTO; 1379 cmdseq->props[7].cmd = DTV_ROLLOFF; 1380 if (tuning.msystem == DTVModulationSystem::kModulationSystemDVBS2) 1381 cmdseq->props[7].u.data = tuning.rolloff; 1382 else 1383 cmdseq->props[7].u.data = DTVRollOff::kRollOff35; 1384 if (do_tune) 1385 { 1386 cmdseq->props[8].cmd = DTV_TUNE; 1387 cmdseq->num = 9; 1388 } 1389 else 1390 cmdseq->num = 8; 1391 } 1392 else if (tuner_type == DTVTunerType::kTunerTypeQAM) 1393 { 1394 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1395 cmdseq->props[0].u.data = (fe_delivery_system_t) (int) tuning.msystem; 1396 cmdseq->props[1].cmd = DTV_FREQUENCY; 1397 cmdseq->props[1].u.data = tuning.frequency; 1398 cmdseq->props[2].cmd = DTV_MODULATION; 1399 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation; 1400 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1401 cmdseq->props[3].u.data = tuning.symbolrate; 1402 cmdseq->props[4].cmd = DTV_INNER_FEC; 1403 cmdseq->props[4].u.data = (fe_code_rate_t) (int) tuning.fec; 1404 cmdseq->props[5].cmd = DTV_INVERSION; 1405 cmdseq->props[5].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1406 if (do_tune) 1407 { 1408 cmdseq->props[6].cmd = DTV_TUNE; 1409 cmdseq->num = 7; 1410 } 1411 else 1412 cmdseq->num = 6; 1413 } 1414 else if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1415 { 1416 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1417 cmdseq->props[0].u.data = SYS_DVBC_ANNEX_AC; 1418 cmdseq->props[1].cmd = DTV_FREQUENCY; 1419 cmdseq->props[1].u.data = tuning.frequency; 1420 cmdseq->props[2].cmd = DTV_MODULATION; 1421 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation; 1422 cmdseq->props[3].cmd = DTV_INVERSION; 1423 cmdseq->props[3].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1424 cmdseq->props[4].cmd = DTV_BANDWIDTH_HZ; 1425 cmdseq->props[4].u.data = (fe_bandwidth_t) (int) tuning.bandwidth; 1426 cmdseq->props[5].cmd = DTV_CODE_RATE_HP; 1427 cmdseq->props[5].u.data = (fe_code_rate_t) (int) tuning.hp_code_rate; 1428 cmdseq->props[6].cmd = DTV_CODE_RATE_LP; 1429 cmdseq->props[6].u.data = (fe_code_rate_t) (int) tuning.lp_code_rate; 1430 cmdseq->props[7].cmd = DTV_TRANSMISSION_MODE; 1431 cmdseq->props[7].u.data = (fe_transmit_mode_t) (int) tuning.trans_mode; 1432 cmdseq->props[8].cmd = DTV_GUARD_INTERVAL; 1433 cmdseq->props[8].u.data = (fe_guard_interval_t) (int) tuning.guard_interval; 1434 cmdseq->props[9].cmd = DTV_HIERARCHY; 1435 cmdseq->props[9].u.data = (fe_hierarchy_t) (int) tuning.hierarchy; 1436 if (do_tune) 1437 { 1438 cmdseq->props[10].cmd = DTV_TUNE; 1439 cmdseq->num = 11; 1440 } 1441 else 1442 cmdseq->num = 10; 1443 } 1444 #ifdef USE_ATSC 1445 else if (tuner_type == DTVTunerType::kTunerTypeATSC) 1446 { 1447 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1448 cmdseq->props[0].u.data = SYS_ATSC; 1449 cmdseq->props[1].cmd = DTV_FREQUENCY; 1450 cmdseq->props[1].u.data = tuning.frequency * 1000UL; 1451 cmdseq->props[2].cmd = DTV_MODULATION; 1452 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation;; 1453 cmdseq->props[3].cmd = DTV_INVERSION; 1454 cmdseq->props[3].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1455 if (do_tune) 1456 { 1457 cmdseq->props[4].cmd = DTV_TUNE; 1458 cmdseq->num = 5; 1459 } 1460 else 1461 cmdseq->num = 4; 1462 } 1463 #endif 1464 else 1465 { 1466 VERBOSE(VB_IMPORTANT, "Unknown tuner type." + ENO); 1467 return false; 1468 } 1469 return true; 1470 } 1471 #endif 1472 -
libs/libmythtv/cardutil.cpp
245 245 close(fd_frontend); 246 246 247 247 DTVTunerType type(info.type); 248 #ifdef USE_DVB_V5 249 if (type == DTVTunerType::kTunerTypeQPSK) 250 { 251 /* We basically have a DVB-S device. Check capabilities to see if 252 * the device is capable of doing DVB-S2. 253 * Caution: Needs "Add missing S2 caps flag to S2API" patch in S2API. */ 254 if (info.caps & FE_CAN_2G_MODULATION) 255 type = DTVTunerType::kTunerTypeDVB_S2; 256 } 257 #endif 248 258 ret = (type.toString() != "UNKNOWN") ? type.toString().toUpper() : ret; 249 259 #endif // USING_DVB 250 260 … … 337 347 { 338 348 QString ct = card_type.toUpper(); 339 349 return (ct == "DVB") || (ct == "QAM") || (ct == "QPSK") || 340 (ct == "OFDM") || (ct == "ATSC") ;350 (ct == "OFDM") || (ct == "ATSC") || (ct == "DVB_S2"); 341 351 } 342 352 343 353 QString get_on_cardid(const QString &to_get, uint cardid) -
libs/libmythtv/videosource.cpp
2929 2929 signal_timeout->setValue(60000); 2930 2930 channel_timeout->setValue(62500); 2931 2931 break; 2932 case CardUtil::DVBS2: 2933 cardtype->setValue("DVB-S2"); 2934 cardname->setValue(frontend_name); 2935 signal_timeout->setValue(60000); 2936 channel_timeout->setValue(62500); 2937 break; 2932 2938 case CardUtil::QAM: 2933 2939 cardtype->setValue("DVB-C"); 2934 2940 cardname->setValue(frontend_name); -
libs/libmythtv/frequencytables.cpp
68 68 _tuning.lp_code_rate.toString(), _tuning.modulation.toString(), 69 69 _tuning.trans_mode.toString(), _tuning.guard_interval.toString(), 70 70 _tuning.hierarchy.toString(), _tuning.modulation.toString(), 71 _tuning.bandwidth.toString()); 71 _tuning.bandwidth.toString(), _tuning.msystem.toString(), 72 _tuning.rolloff.toString()); 73 tuning.sistandard = _tuning.sistandard; 72 74 } 73 75 74 76 TransportScanItem::TransportScanItem(uint sourceid, -
libs/libmythtv/scanwizard.cpp
98 98 start_chan = configPane->GetStartChan(); 99 99 parse_type = DTVTunerType::kTunerTypeQPSK; 100 100 } 101 else if (scantype == ScanTypeSetting::NITAddScan_DVBS2) 102 { 103 start_chan = configPane->GetStartChan(); 104 parse_type = DTVTunerType::kTunerTypeDVB_S2; 105 } 101 106 else if (scantype == ScanTypeSetting::NITAddScan_QAM) 102 107 { 103 108 start_chan = configPane->GetStartChan(); … … 139 144 start_chan["coderate_hp"], start_chan["coderate_lp"], 140 145 start_chan["constellation"], start_chan["trans_mode"], 141 146 start_chan["guard_interval"], start_chan["hierarchy"], 142 start_chan["modulation"], start_chan["bandwidth"])) 147 start_chan["modulation"], start_chan["bandwidth"], 148 start_chan["msystem"], start_chan["rolloff"])) 143 149 { 144 150 MythPopupBox::showOkPopup( 145 151 gContext->GetMainWindow(), tr("ScanWizard"), -
libs/libmythtv/transporteditor.cpp
98 98 MSqlQuery query(MSqlQuery::InitCon()); 99 99 query.prepare( 100 100 "SELECT mplexid, modulation, frequency, " 101 " symbolrate, networkid, transportid, constellation "101 " symbolrate, networkid, transportid, constellation, msystem " 102 102 "FROM dtv_multiplex, videosource " 103 103 "WHERE dtv_multiplex.sourceid = :SOURCEID AND " 104 104 " dtv_multiplex.sourceid = videosource.sourceid " … … 129 129 QString tid = query.value(5).toUInt() ? 130 130 QString("tid %1").arg(query.value(5).toUInt(), 5) : ""; 131 131 132 QString hz = (CardUtil::QPSK == cardtype) ? "kHz" : "Hz"; 132 QString hz = (CardUtil::QPSK == cardtype || 133 CardUtil::DVBS2 == cardtype) ? "kHz" : "Hz"; 133 134 134 135 QString type = ""; 135 136 if (CardUtil::OFDM == cardtype) 136 137 type = "(DVB-T)"; 137 138 if (CardUtil::QPSK == cardtype) 138 139 type = "(DVB-S)"; 140 if (CardUtil::DVBS2 == cardtype) 141 type = (query.value(7).toString() == "dvbs2")?"(DVB-S2)":"(DVB-S)"; 142 139 143 if (CardUtil::QAM == cardtype) 140 144 type = "(DVB-C)"; 141 145 … … 487 491 }; 488 492 }; 489 493 494 class DVBS2ModulationSystem: public ComboBoxSetting, public MuxDBStorage 495 { 496 public: 497 DVBS2ModulationSystem(const MultiplexID *id) : 498 ComboBoxSetting(this), MuxDBStorage(this, id, "msystem") 499 { 500 setLabel(QObject::tr("Modulation system")); 501 setHelpText(QObject::tr("Modulation system (Default: DVB-S)\n" 502 "Standard selection: DVB-S/DVB-S2")); 503 addSelection(QObject::tr("DVB-S"), "dvbs"); 504 addSelection(QObject::tr("DVB-S2"), "dvbs2"); 505 }; 506 }; 507 490 508 class Modulation : public ComboBoxSetting, public MuxDBStorage 491 509 { 492 510 public: … … 506 524 // no modulation options 507 525 setVisible(false); 508 526 } 527 if (CardUtil::QPSK == nType) 528 { 529 addSelection("QPSK", "qpsk"); 530 } 531 if (CardUtil::DVBS2 == nType) 532 { 533 addSelection("QPSK", "qpsk"); 534 addSelection("8PSK", "8psk"); 535 } 509 536 else if ((CardUtil::QAM == nType) || (CardUtil::OFDM == nType)) 510 537 { 511 538 addSelection(QObject::tr("QAM Auto"), "auto"); … … 576 603 addSelection("1/2"); 577 604 addSelection("2/3"); 578 605 addSelection("3/4"); 606 addSelection("3/5"); 579 607 addSelection("4/5"); 580 608 addSelection("5/6"); 581 609 addSelection("6/7"); 582 610 addSelection("7/8"); 583 611 addSelection("8/9"); 612 addSelection("9/10"); 584 613 }; 585 614 }; 586 615 … … 597 626 }; 598 627 }; 599 628 629 class DVBS2RollOff: public ComboBoxSetting, public MuxDBStorage 630 { 631 public: 632 DVBS2RollOff(const MultiplexID *id) : 633 ComboBoxSetting(this), MuxDBStorage(this, id, "rolloff") 634 { 635 setLabel(QObject::tr("Roll-off")); 636 setHelpText(QObject::tr("Roll-off (Default: 0.35)")); 637 addSelection(QObject::tr("0.35"), "0.35"); 638 addSelection(QObject::tr("0.20"), "0.20"); 639 addSelection(QObject::tr("0.25"), "0.25"); 640 addSelection(QObject::tr("Auto"), "auto"); 641 }; 642 }; 643 600 644 class DVBTCoderateLP : 601 645 public DVBForwardErrorCorrectionSelector, public MuxDBStorage 602 646 { … … 715 759 right->addChild(new DVBForwardErrorCorrection(id)); 716 760 right->addChild(new SignalPolarity(id)); 717 761 } 762 else if (CardUtil::DVBS2 == nType) 763 { 764 left->addChild(new DTVStandard(id, true, false)); 765 left->addChild(new Frequency(id, true)); 766 left->addChild(new DVBSymbolRate(id)); 767 left->addChild(new DVBInversion(id)); 768 left->addChild(new SignalPolarity(id)); 769 770 right = new VerticalConfigurationGroup(false, true, false, false); 771 right->addChild(new DVBS2ModulationSystem(id)); 772 right->addChild(new Modulation(id, nType)); 773 right->addChild(new DVBForwardErrorCorrection(id)); 774 right->addChild(new DVBS2RollOff(id)); 775 } 718 776 else if (CardUtil::QAM == nType) 719 777 { 720 778 left->addChild(new DTVStandard(id, true, false)); -
libs/libmythtv/scanwizardhelpers.cpp
455 455 QString::number(NITAddScan_QPSK)); 456 456 importConf = true; 457 457 break; 458 case CardUtil::DVBS2: 459 addSelection(tr("Full Scan (Tuned)"), 460 QString::number(NITAddScan_DVBS2)); 461 addSelection(tr("Import channels.conf"), 462 QString::number(DVBUtilsImport)); 463 break; 464 458 465 case CardUtil::QAM: 459 466 addSelection(tr("Full Scan (Tuned)"), 460 467 QString::number(NITAddScan_QAM)); … … 584 591 paneQAM); 585 592 addTarget(QString::number(ScanTypeSetting::NITAddScan_QPSK), 586 593 paneQPSK); 594 addTarget(QString::number(ScanTypeSetting::NITAddScan_DVBS2), 595 paneDVBS2); 587 596 addTarget(QString::number(ScanTypeSetting::NITAddScan_OFDM), 588 597 paneOFDM); 589 598 addTarget(QString::number(ScanTypeSetting::FullScan_ATSC), … … 776 785 startChan["modulation"] = "qpsk"; 777 786 startChan["polarity"] = pane->polarity(); 778 787 } 788 else if (ScanTypeSetting::NITAddScan_DVBS2 == st) 789 { 790 const DVBS2Pane *pane = paneDVBS2; 791 792 startChan["std"] = "dvb"; 793 startChan["frequency"] = pane->frequency(); 794 startChan["inversion"] = pane->inversion(); 795 startChan["symbolrate"] = pane->symbolrate(); 796 startChan["fec"] = pane->fec(); 797 startChan["msystem"] = pane->msystem(); 798 startChan["modulation"] = pane->modulation(); 799 startChan["polarity"] = pane->polarity(); 800 startChan["rolloff"] = pane->rolloff(); 801 } 779 802 else if (ScanTypeSetting::NITAddScan_QAM == st) 780 803 { 781 804 const QAMPane *pane = paneQAM; -
libs/libmythtv/dtvmultiplex.cpp
24 24 fec = other.fec; 25 25 mplex = other.mplex; 26 26 sistandard = other.sistandard; 27 msystem = other.msystem; 28 rolloff = other.rolloff; 27 29 sistandard.detach(); 28 30 return *this; 29 31 } … … 40 42 (guard_interval == m.guard_interval) && 41 43 (fec == m.fec) && 42 44 (polarity == m.polarity) && 43 (hierarchy == m.hierarchy)); 45 (hierarchy == m.hierarchy) && 46 (msystem == m.msystem) && 47 (rolloff == m.rolloff)); 44 48 } 45 49 46 50 /////////////////////////////////////////////////////////////////////////////// … … 48 52 49 53 QString DTVMultiplex::toString() const 50 54 { 51 QString ret = QString(" %1 %2 %3")52 .arg(frequency).arg(modulation.toString()).arg(inversion.toString()) ;55 QString ret = QString("f: %1 mod: %2 inv: %3 fec: %4") 56 .arg(frequency).arg(modulation.toString()).arg(inversion.toString()).arg(fec.toString()); 53 57 54 ret += QString(" %1 %2 %3 %4 %5 %6 %7")58 ret += QString("hp: %1 lp: %2 bandw: %3 transmode: %4 guardi: %5 hier: %6 polar: %7 msys: %8 rolloff: %9") 55 59 .arg(hp_code_rate.toString()).arg(lp_code_rate.toString()) 56 60 .arg(bandwidth.toString()).arg(trans_mode.toString()) 57 61 .arg(guard_interval.toString()).arg(hierarchy.toString()) 58 .arg(polarity.toString()); 62 .arg(polarity.toString()) 63 .arg(msystem.toString()).arg(rolloff.toString()); 59 64 60 65 return ret; 61 66 } … … 102 107 return 103 108 (inversion == other.inversion) && 104 109 (symbolrate == other.symbolrate) && 105 (fec == other.fec); 110 (fec == other.fec) && 111 (msystem == other.msystem) && 112 (rolloff == other.rolloff); 106 113 } 107 114 108 115 return false; … … 152 159 const QString &_symbol_rate, const QString &_fec_inner, 153 160 const QString &_modulation, const QString &_polarity) 154 161 { 155 bool ok = inversion.Parse(_inversion); 156 if (!ok) 162 if (!inversion.Parse(_inversion)) 157 163 { 158 164 VERBOSE(VB_GENERAL, LOC_WARN + 159 "Invalid inversion, falling back to 'auto'"); 160 161 ok = true; 165 QString("Invalid inversion '%1' , falling back to 'auto'.").arg(_inversion)); 162 166 } 163 167 164 168 symbolrate = _symbol_rate.toInt(); … … 166 170 { 167 171 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid symbol rate " + 168 172 QString("parameter '%1', aborting.").arg(_symbol_rate)); 169 170 173 return false; 171 174 } 172 175 173 ok &= fec.Parse(_fec_inner); 174 ok &= modulation.Parse(_modulation); 176 if (!fec.Parse(_fec_inner)) 177 { 178 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid fec_inner " + 179 QString("parameter '%1', aborting.").arg(_fec_inner)); 180 return false; 181 } 182 183 if (!modulation.Parse(_modulation)) 184 { 185 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid modulation " + 186 QString("parameter '%1', aborting.").arg(_modulation)); 187 return false; 188 } 175 189 176 190 if (!_polarity.isEmpty()) 177 polarity.Parse(_polarity.toLower()); 191 if (!polarity.Parse(_polarity.toLower())) 192 { 193 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid polarity " + 194 QString("parameter '%1', aborting.").arg(_polarity)); 195 return false; 196 } 178 197 179 if (ok) 180 frequency = _frequency.toInt(&ok); 198 bool ok; 199 frequency = _frequency.toInt(&ok); 200 if (!ok) 201 { 202 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid frequency " + 203 QString("parameter '%1', aborting.").arg(_frequency)); 204 return false; 205 206 } 181 207 182 return ok;208 return true; 183 209 } 184 210 211 bool DTVMultiplex::ParseDVB_S2( 212 const QString &_frequency, const QString &_inversion, 213 const QString &_symbol_rate, const QString &_fec_inner, 214 const QString &_modulation, const QString &_polarity, 215 const QString &_msystem, const QString &_rolloff) 216 { 217 if (!ParseDVB_S_and_C(_frequency, _inversion, 218 _symbol_rate, _fec_inner, 219 _modulation, _polarity)) 220 { 221 return false; 222 } 223 224 if (!_msystem.isEmpty()) 225 { 226 if (!msystem.Parse(_msystem)) 227 { 228 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid modulation system " + 229 QString("parameter '%1', aborting.").arg(_msystem)); 230 return false; 231 } 232 } 233 234 if (!_rolloff.isEmpty()) 235 { 236 if(!rolloff.Parse(_rolloff)) 237 { 238 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid rolloff " + 239 QString("parameter '%1', aborting.").arg(_rolloff)); 240 return false; 241 } 242 } 243 244 return true; 245 } 246 185 247 bool DTVMultiplex::ParseTuningParams( 186 248 DTVTunerType type, 187 249 QString _frequency, QString _inversion, QString _symbolrate, 188 250 QString _fec, QString _polarity, 189 251 QString _hp_code_rate, QString _lp_code_rate, QString _ofdm_modulation, 190 252 QString _trans_mode, QString _guard_interval, QString _hierarchy, 191 QString _modulation, QString _bandwidth) 253 QString _modulation, QString _bandwidth, 254 QString _msystem, QString _rolloff) 192 255 { 193 256 if (DTVTunerType::kTunerTypeOFDM == type) 194 257 { … … 198 261 _hierarchy); 199 262 } 200 263 201 if ((DTVTunerType::kTunerTypeQPSK == type) || 202 (DTVTunerType::kTunerTypeDVB_S2 == type) || 203 (DTVTunerType::kTunerTypeQAM == type)) 264 if ((DTVTunerType::kTunerTypeQPSK == type) || 265 (DTVTunerType::kTunerTypeQAM == type)) 204 266 { 205 267 return ParseDVB_S_and_C( 206 268 _frequency, _inversion, _symbolrate, 207 269 _fec, _modulation, _polarity); 208 270 } 209 271 272 if (DTVTunerType::kTunerTypeDVB_S2 == type) 273 { 274 return ParseDVB_S2( 275 _frequency, _inversion, _symbolrate, 276 _fec, _modulation, _polarity, 277 _msystem, _rolloff); 278 } 279 210 280 if (DTVTunerType::kTunerTypeATSC == type) 211 281 return ParseATSC(_frequency, _modulation); 212 282 … … 223 293 " fec, polarity, " 224 294 " hp_code_rate, lp_code_rate, constellation, " 225 295 " transmission_mode, guard_interval, hierarchy, " 226 " modulation, bandwidth, sistandard " 296 " modulation, bandwidth, sistandard, " 297 " msystem, rolloff " 227 298 "FROM dtv_multiplex " 228 299 "WHERE dtv_multiplex.mplexid = :MPLEXID"); 229 300 query.bindValue(":MPLEXID", mplexid); … … 256 327 query.value(6).toString(), query.value(7).toString(), 257 328 query.value(8).toString(), query.value(9).toString(), 258 329 query.value(10).toString(), query.value(11).toString(), 259 query.value(12).toString()); 330 query.value(12).toString(), query.value(14).toString(), 331 query.value(15).toString()); 260 332 } 261 333 262 334 //////////////////////////////////////////////////////////////////////////// … … 318 390 " mplexid, frequency, inversion, " 319 391 " symbolrate, fec, polarity, " 320 392 " hp_code_rate, lp_code_rate, modulation, " 393 " msystem, rolloff, " 321 394 " transmission_mode, guard_interval, hierarchy, " 322 395 " bandwidth, sistandard, tuner_type " 323 396 " ) " … … 326 399 " :MPLEXID, :FREQUENCY, :INVERSION, " 327 400 " :SYMBOLRATE, :FEC, :POLARITY, " 328 401 " :HP_CODE_RATE, :LP_CODE_RATE, :MODULATION, " 402 " :MSYSTEM, :ROLLOFF, " 329 403 " :TRANSMISSION_MODE, :GUARD_INTERVAL, :HIERARCHY, " 330 404 " :BANDWIDTH, :SISTANDARD, :TUNER_TYPE " 331 405 " );"); … … 340 414 query.bindValue(":HP_CODE_RATE", hp_code_rate.toString()); 341 415 query.bindValue(":LP_CODE_RATE", lp_code_rate.toString()); 342 416 query.bindValue(":MODULATION", modulation.toString()); 417 query.bindValue(":MSYSTEM", msystem.toString()); 418 query.bindValue(":ROLLOFF", rolloff.toString()); 343 419 query.bindValue(":TRANSMISSION_MODE", trans_mode.toString()); 344 420 query.bindValue(":GUARD_INTERVAL", guard_interval.toString()); 345 421 query.bindValue(":HIERARCHY", hierarchy.toString());