Ticket #5882: t5882_S2Api_3.diff
File t5882_S2Api_3.diff, 87.8 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 msyste, rolloff, 73 75 mplexid, commfree)) 74 76 { 75 77 VERBOSE(VB_IMPORTANT, loc + " " + QString( -
libs/libmythtv/dtvconfparserhelpers.h
191 191 static const DTVParamHelperStruct confTable[]; 192 192 static const DTVParamHelperStruct vdrTable[]; 193 193 static const DTVParamHelperStruct parseTable[]; 194 static const uint kDBStrCnt = 1 0;194 static const uint kDBStrCnt = 12; 195 195 static const char *dbStr[kDBStrCnt]; 196 196 197 197 public: … … 207 207 kFEC_7_8, 208 208 kFEC_8_9, 209 209 kFECAuto, 210 kFEC_3_5, 211 kFEC_9_10, 210 212 }; 211 213 212 214 DTVCodeRate(int _default = kFECAuto) : DTVParamHelper(_default) { } … … 236 238 public: 237 239 enum 238 240 { 239 kModulationQPSK = 0, 240 kModulationQAM16 = 1, 241 kModulationQAM32 = 2, 242 kModulationQAM64 = 3, 243 kModulationQAM128 = 4, 244 kModulationQAM256 = 5, 245 kModulationQAMAuto = 6, 246 kModulation8VSB = 7, 247 kModulation16VSB = 8, 248 kModulation2VSB = 9, 249 kModulation4VSB = 10, 250 kModulationBPSK = 11, 251 kModulation16APSK = 12, 252 kModulation32APSK = 13, 253 kModulation8PSK = 14, 254 kModulation16PSK = 15, 255 kModulationAnalog = 16, /* for analog channel scanner */ 241 kModulationQPSK, 242 kModulationQAM16, 243 kModulationQAM32, 244 kModulationQAM64, 245 kModulationQAM128, 246 kModulationQAM256, 247 kModulationQAMAuto, 248 kModulation8VSB, 249 kModulation16VSB, 250 kModulation16APSK, 251 kModulation32APSK, 252 kModulation8PSK, 253 kModulationDQPSK, 254 kModulationAnalog = 99, /* for analog channel scanner */ 256 255 }; 257 256 258 257 DTVModulation(int _default = kModulationQAMAuto) … … 414 413 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 415 414 }; 416 415 416 class DTVModulationSystem : public DTVParamHelper 417 { 418 protected: 419 static const DTVParamHelperStruct confTable[]; 420 static const DTVParamHelperStruct vdrTable[]; 421 static const DTVParamHelperStruct parseTable[]; 422 static const uint kDBStrCnt = 2; 423 static const char *dbStr[kDBStrCnt]; 424 425 public: 426 enum 427 { 428 kModulationSystemDVBS, 429 kModulationSystemDVBS2, 430 }; 431 432 DTVModulationSystem(int _default = kModulationSystemDVBS) 433 : DTVParamHelper(_default) { } 434 435 bool ParseConf(const QString &_value) 436 { return ParseParam(_value, value, confTable); } 437 bool ParseVDR(const QString &_value) 438 { return ParseParam(_value, value, vdrTable); } 439 bool Parse(const QString &_value) 440 { return ParseParam(_value, value, parseTable); } 441 442 QString toString() const { return toString(value); } 443 444 static QString toString(int _value) 445 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 446 }; 447 448 class DTVRollOff : public DTVParamHelper 449 { 450 protected: 451 static const DTVParamHelperStruct confTable[]; 452 static const DTVParamHelperStruct vdrTable[]; 453 static const DTVParamHelperStruct parseTable[]; 454 static const uint kDBStrCnt = 4; 455 static const char *dbStr[kDBStrCnt]; 456 457 public: 458 enum 459 { 460 kRollOff35, 461 kRollOff20, 462 kRollOff25, 463 kRollOffAuto, 464 }; 465 466 DTVRollOff(int _default = kRollOff35) 467 : DTVParamHelper(_default) { } 468 469 bool ParseConf(const QString &_value) 470 { return ParseParam(_value, value, confTable); } 471 bool ParseVDR(const QString &_value) 472 { return ParseParam(_value, value, vdrTable); } 473 bool Parse(const QString &_value) 474 { return ParseParam(_value, value, parseTable); } 475 476 QString toString() const { return toString(value); } 477 478 static QString toString(int _value) 479 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 480 }; 481 482 class DTVPilot : public DTVParamHelper 483 { 484 protected: 485 static const DTVParamHelperStruct confTable[]; 486 static const DTVParamHelperStruct vdrTable[]; 487 static const DTVParamHelperStruct parseTable[]; 488 static const uint kDBStrCnt = 3; 489 static const char *dbStr[kDBStrCnt]; 490 491 public: 492 enum 493 { 494 kPilotOn, 495 kPilotOff, 496 kPilotAuto, 497 }; 498 499 DTVPilot(int _default = kPilotAuto) 500 : DTVParamHelper(_default) { } 501 502 bool ParseConf(const QString &_value) 503 { return ParseParam(_value, value, confTable); } 504 505 QString toString() const { return toString(value); } 506 507 static QString toString(int _value) 508 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 509 }; 510 417 511 #endif // _DTVCONFPARSERHELPERS_H_ -
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
69 69 { "QAM", kTunerTypeQAM }, 70 70 { "OFDM", kTunerTypeOFDM }, 71 71 { "ATSC", kTunerTypeATSC }, 72 { "DVB_S2", kTunerTypeDVB_S2 }, 72 73 { "DVB_S", kTunerTypeDVB_S }, 73 74 { "DVB_C", kTunerTypeDVB_C }, 74 75 { "DVB_T", kTunerTypeDVB_T }, 75 { "DVB_S2", kTunerTypeDVB_S2 }, 76 76 77 { "UNKNOWN", kTunerTypeUnknown }, 77 78 { NULL, kTunerTypeUnknown }, 78 79 }; … … 145 146 146 147 const DTVParamHelperStruct DTVCodeRate::confTable[] = 147 148 { 148 { "FEC_ AUTO", kFECAuto},149 { "FEC_NONE", kFECNone }, 149 150 { "FEC_1_2", kFEC_1_2 }, 150 151 { "FEC_2_3", kFEC_2_3 }, 151 152 { "FEC_3_4", kFEC_3_4 }, … … 154 155 { "FEC_6_7", kFEC_6_7 }, 155 156 { "FEC_7_8", kFEC_7_8 }, 156 157 { "FEC_8_9", kFEC_8_9 }, 157 { "FEC_NONE", kFECNone }, 158 { "FEC_AUTO", kFECAuto }, 159 { "FEC_3_5", kFEC_3_5 }, 160 { "FEC_9_10", kFEC_9_10 }, 158 161 { NULL, kFECAuto }, 159 162 }; 160 163 … … 164 167 { "12", kFEC_1_2 }, 165 168 { "23", kFEC_2_3 }, 166 169 { "34", kFEC_3_4 }, 170 { "35", kFEC_3_5 }, 167 171 { "45", kFEC_4_5 }, 168 172 { "56", kFEC_5_6 }, 169 173 { "67", kFEC_6_7 }, 170 174 { "78", kFEC_7_8 }, 171 175 { "89", kFEC_8_9 }, 176 { "910", kFEC_9_10}, 172 177 { "0", kFECNone }, 173 178 { NULL, kFECAuto } 174 179 }; 175 180 176 181 const DTVParamHelperStruct DTVCodeRate::parseTable[] = 177 182 { 178 { " auto", kFECAuto},183 { "none", kFECNone }, 179 184 { "1/2", kFEC_1_2 }, 180 185 { "2/3", kFEC_2_3 }, 181 186 { "3/4", kFEC_3_4 }, … … 184 189 { "6/7", kFEC_6_7 }, 185 190 { "7/8", kFEC_7_8 }, 186 191 { "8/9", kFEC_8_9 }, 187 { "none", kFECNone }, 192 { "auto", kFECAuto }, 193 { "3/5", kFEC_3_5 }, 194 { "9/10", kFEC_9_10}, 188 195 { NULL, kFECAuto } 189 196 }; 190 197 … … 199 206 "6/7", ///< kFEC_6_7 200 207 "7/8", ///< kFEC_7_8 201 208 "8/9", ///< kFEC_8_9 202 "auto" ///< kFECAuto 209 "auto", ///< kFECAuto 210 "3/5", ///< kFEC_3_5 211 "9/10", ///< kFEC_9_10 203 212 }; 204 213 205 214 const DTVParamHelperStruct DTVModulation::confTable[] = … … 213 222 { "QPSK", kModulationQPSK }, 214 223 { "8VSB", kModulation8VSB }, 215 224 { "16VSB", kModulation16VSB }, 216 { "2VSB", kModulation2VSB },217 { "4VSB", kModulation4VSB },218 { "BPSK", kModulationBPSK },219 225 { "16APSK", kModulation16APSK }, 220 226 { "32APSK", kModulation32APSK }, 221 227 { "8PSK", kModulation8PSK }, 222 { " 16PSK", kModulation16PSK },228 { "DQPSK", kModulationDQPSK }, 223 229 { "analog", kModulationAnalog }, 224 230 { NULL, kModulationQAMAuto }, 225 231 }; … … 232 238 { "64", kModulationQAM64 }, 233 239 { "128", kModulationQAM128 }, 234 240 { "256", kModulationQAM256 }, 241 { "2", kModulationQPSK }, 242 { "10", kModulation8VSB }, 243 { "11", kModulation16VSB }, 244 { "6", kModulation16APSK }, 245 { "7", kModulation32APSK }, 246 { "5", kModulation8PSK }, 235 247 { "0", kModulationQPSK }, 236 248 { NULL, kModulationQAMAuto }, 237 249 }; … … 247 259 { "qpsk", kModulationQPSK }, 248 260 { "8vsb", kModulation8VSB }, 249 261 { "16vsb", kModulation16VSB }, 250 { "2vsb", kModulation2VSB }, 251 { "4vsb", kModulation4VSB }, 252 { "bpsk", kModulationBPSK }, 262 { "8psk", kModulation8PSK }, 253 263 { "16apsk", kModulation16APSK }, 254 264 { "32apsk", kModulation32APSK }, 255 { "8psk", kModulation8PSK }, 256 { "16psk", kModulation16PSK }, 265 { "dqpsk", kModulationDQPSK }, 257 266 // alternates 258 267 { "a", kModulationQAMAuto }, 259 268 { "qam_auto", kModulationQAMAuto }, … … 262 271 { "qam-64", kModulationQAM64 }, 263 272 { "qam-128", kModulationQAM128 }, 264 273 { "qam-256", kModulationQAM256 }, 265 // qpsk, no alternative266 { "8-vsb", kModulation8VSB },267 { "16-vsb", kModulation16VSB },268 { "2-vsb", kModulation2VSB },269 { "4-vsb", kModulation4VSB },270 // bpsk, no alternative271 274 { "16-apsk", kModulation16APSK }, 272 275 { "32-apsk", kModulation32APSK }, 273 276 { "8-psk", kModulation8PSK }, 274 { "16-psk", kModulation16PSK }, 277 { "16-psk", kModulationDQPSK }, 278 { "dq-psk", kModulationDQPSK }, 279 { "16psk", kModulationDQPSK }, 275 280 { NULL, kModulationQAMAuto }, 276 281 }; 277 282 … … 286 291 "auto", ///< kModulationQAMAuto 287 292 "8vsb", ///< kModulation8VSB 288 293 "16vsb", ///< kModulation16VSB 289 "2vsb", ///< kModulation2VSB 290 "4vsb", ///< kModulation4VSB 291 "bpsk", ///< kModulationBPSK 294 "8psk", ///< kModulation8PSK 292 295 "16apsk", ///< kModulation16APSK 293 296 "32apsk", ///< kModulation32APSK 294 "8psk", ///< kModulation8PSK 295 "16psk", ///< kModulation16PSK 297 "dqpsk", ///< kModulationDQPSK 296 298 }; 297 299 298 300 const DTVParamHelperStruct DTVTransmitMode::confTable[] = … … 420 422 "r", ///< kPolarityRight 421 423 "l" ///< kPolarityLeft 422 424 }; 425 426 const DTVParamHelperStruct DTVModulationSystem::confTable[] = 427 { 428 { "SYS_DVBS", kModulationSystemDVBS }, 429 { "SYS_DVBS2", kModulationSystemDVBS2 }, 430 { NULL, kModulationSystemDVBS }, 431 }; 432 433 const DTVParamHelperStruct DTVModulationSystem::vdrTable[] = 434 { 435 { "0", kModulationSystemDVBS }, 436 { "1", kModulationSystemDVBS2 }, 437 { NULL, kModulationSystemDVBS }, 438 }; 439 440 const DTVParamHelperStruct DTVModulationSystem::parseTable[] = 441 { 442 { "dvbs2", kModulationSystemDVBS2 }, 443 { "dvbs", kModulationSystemDVBS }, 444 { NULL, kModulationSystemDVBS }, 445 }; 446 447 const char *DTVModulationSystem::dbStr[DTVModulationSystem::kDBStrCnt] = 448 { 449 "dvbs", ///< kModulationSystemDVBS 450 "dvbs2", ///< kModulationSystemDVBS2 451 }; 452 453 const DTVParamHelperStruct DTVRollOff::confTable[] = 454 { 455 { "ROLLOFF_35", kRollOff35 }, 456 { "ROLLOFF_20", kRollOff20 }, 457 { "ROLLOFF_25", kRollOff25 }, 458 { "ROLLOFF_AUTO", kRollOffAuto }, 459 { NULL, kRollOffAuto }, 460 }; 461 462 const DTVParamHelperStruct DTVRollOff::vdrTable[] = 463 { 464 { "35", kRollOff35 }, 465 { "20", kRollOff20 }, 466 { "25", kRollOff25 }, 467 { "0", kRollOffAuto }, 468 { NULL, kRollOff35 }, 469 }; 470 471 const DTVParamHelperStruct DTVRollOff::parseTable[] = 472 { 473 { "0.35", kRollOff35 }, 474 { "0.20", kRollOff20 }, 475 { "0.25", kRollOff25 }, 476 { "auto", kRollOffAuto }, 477 { NULL, kRollOff35 }, 478 }; 479 480 const char *DTVRollOff::dbStr[DTVRollOff::kDBStrCnt] = 481 { 482 "0.35", ///< kRollOff35 483 "0.20", ///< kRollOff20 484 "0.25", ///< kRollOff25 485 "auto", ///< kRollOffAuto 486 }; -
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); … … 274 274 case 'R': 275 275 case 'L': 276 276 mux.polarity.ParseVDR(ori); 277 case 'S': 278 mux.msystem.ParseVDR(params); 279 case 'O': 280 mux.rolloff.ParseVDR(params); 277 281 break; 278 282 default: 279 283 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 … … 74 81 DTVHierarchy hierarchy; 75 82 DTVPolarity polarity; 76 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); … … 90 91 uint64_t &frequency, 91 92 uint &dvb_transportid, 92 93 uint &dvb_networkid, 94 QString &msystem, 95 QString &rolloff, 93 96 QString &si_std); 94 97 95 98 static bool GetATSCChannel(uint sourceid, const QString &channum, … … 159 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 &msystem, QString &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 758 ScanFrequency *pfrequency; … … 713 761 ScanFec *pfec; 714 762 ScanPolarity *ppolarity; 715 763 ScanModulation *pmodulation; 764 ScanModulationSystem *pmsystem; 765 ScanRollOff *prolloff; 716 766 }; 717 767 718 768 class QPSKPane : public HorizontalConfigurationGroup -
libs/libmythtv/dbcheck.cpp
4302 4302 return false; 4303 4303 } 4304 4304 4305 if (dbver == "1223") 4306 { 4307 const char *updates[] = { 4308 "ALTER TABLE dtv_multiplex ADD msystem VARCHAR(10) DEFAULT NULL AFTER polarity;", 4309 "ALTER TABLE dtv_multiplex ADD rolloff VARCHAR(10) DEFAULT NULL AFTER modulation;", 4310 NULL 4311 }; 4312 if (!performActualUpdate(updates, "1224", dbver)) 4313 return false; 4314 } 4315 4305 4316 return true; 4306 4317 } 4307 4318 -
libs/libmythtv/scanwizardscanner.cpp
364 364 } 365 365 else if ((ScanTypeSetting::NITAddScan_OFDM == scantype) || 366 366 (ScanTypeSetting::NITAddScan_QPSK == scantype) || 367 (ScanTypeSetting::NITAddScan_DVBS2 == scantype) || 367 368 (ScanTypeSetting::NITAddScan_QAM == scantype)) 368 369 { 369 370 VERBOSE(VB_SIPARSER, LOC + "ScanTransports()"); … … 490 491 QString sub_type = CardUtil::ProbeDVBType(device).toUpper(); 491 492 bool need_nit = (("QAM" == sub_type) || 492 493 ("QPSK" == sub_type) || 494 ("DVB_S2" == sub_type) || 493 495 ("OFDM" == sub_type)); 494 496 495 497 // Ugh, Some DVB drivers don't fully support signal monitoring... -
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; 374 QString dvb_msystem; 375 QString dvb_rolloff; 372 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
903 903 nextIt = transport_scan_items_it_t( scanTransports.end() ); 904 904 905 905 DTVMultiplex tuning; 906 906 DTVModulation modulation; 907 DTVModulationSystem msystem; 907 908 DTVTunerType type; 908 909 909 910 if (std == "dvb") 910 911 { 911 ok = type.Parse(mod); 912 if (!modulation.Parse(*(startChan.find("modulation")))) 913 { 914 VERBOSE(VB_IMPORTANT, LOC + "Wrong modulation."); 915 return false; 916 } 917 918 if (modulation == DTVModulation::kModulationQPSK) 919 { 920 type = DTVTunerType::kTunerTypeQPSK; 921 ok = true; 922 if (startChan.find("msystem") != startChan.end()) 923 { 924 if (!msystem.Parse(*(startChan.find("msystem")))) 925 { 926 VERBOSE(VB_IMPORTANT, LOC + "Wrong modulation system."); 927 return false; 928 } 929 if (msystem == DTVModulationSystem::kModulationSystemDVBS2) 930 type = DTVTunerType::kTunerTypeDVB_S2; 931 } 932 } 933 else if (modulation == DTVModulation::kModulation8PSK) 934 { 935 type = DTVTunerType::kTunerTypeDVB_S2; 936 ok = true; 937 } 938 else 939 ok = type.Parse(mod); 912 940 } 913 941 else if (std == "atsc") 914 942 { … … 926 954 startChan["coderate_hp"], startChan["coderate_lp"], 927 955 startChan["constellation"], startChan["trans_mode"], 928 956 startChan["guard_interval"], startChan["hierarchy"], 929 startChan["modulation"], startChan["bandwidth"]); 957 startChan["modulation"], startChan["bandwidth"], 958 startChan["msystem"], startChan["rolloff"]); 930 959 } 931 960 932 961 if (ok) … … 1566 1595 const uint transportid, const uint networkid) 1567 1596 { 1568 1597 uint64_t db_freq; 1569 QString tmp_modulation ;1598 QString tmp_modulation, tmp_msystem, tmp_rolloff; 1570 1599 QString tmp_si_std; 1571 1600 uint tmp_transportid, tmp_networkid; 1572 1601 int mplexid; … … 1580 1609 1581 1610 if (!ChannelUtil::GetTuningParams( 1582 1611 (uint)mplexid, tmp_modulation, 1583 db_freq, tmp_transportid, tmp_networkid, tmp_si_std)) 1612 db_freq, tmp_transportid, tmp_networkid, 1613 tmp_msystem, tmp_rolloff, tmp_si_std)) 1584 1614 { 1585 1615 return tuning_freq; 1586 1616 } -
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
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 … … 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, " 743 "msystem, rolloff " 717 744 "FROM dtv_multiplex " 718 745 "WHERE mplexid = :MPLEXID"); 719 746 query.bindValue(":MPLEXID", mplexid); … … 732 759 frequency = (uint64_t) query.value(2).toDouble(); // Qt 3.1 compat 733 760 modulation = query.value(3).toString(); 734 761 si_std = query.value(4).toString(); 762 dvb_msystem = query.value(5).toString(); 763 dvb_rolloff = query.value(6).toString(); 735 764 736 765 return true; 737 766 } … … 1483 1512 QString &dtv_si_std, int &mpeg_prog_num, 1484 1513 uint &atsc_major, uint &atsc_minor, 1485 1514 uint &dvb_transportid, uint &dvb_networkid, 1515 QString &dvb_msystem, QString &dvb_rolloff, 1486 1516 uint &mplexid, 1487 1517 bool &commfree) 1488 1518 { … … 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
745 745 bool IsLinearPolarization() const { return !((_data[8]>>6)&0x1); } 746 746 bool IsHorizontalLeftPolarization() const { return (_data[8]>>5)&0x1; } 747 747 bool IsVerticalRightPolarization() const { return !((_data[8]>>5)&0x1); } 748 // modulation 5 8.3 748 // rolloff 2 8.3 749 uint RollOff() const { return (_data[8]>>3)&0x3; } 750 QString RollOffString() const 751 { 752 static QString ps[] = { "0.35", "0.20", "0.25", "AUTO" }; 753 return ps[Polarization()]; 754 } 755 // modulation system 3 8.5 749 756 enum 750 757 { 758 kModulationSystemDVBS = 0x0, 759 kModulationSystemDVBS2 = 0x1, 760 }; 761 uint ModulationSystem() const { return _data[8]>>2&0x1; } 762 QString ModulationSystemString() const 763 { 764 static QString mss[] = { "dvbs", "dvbs2" }; 765 return (mss[ModulationSystem()]); 766 } 767 // modulation 4 8.6 768 769 enum 770 { 751 771 kModulationQPSK_NS = 0x0, // Non standard QPSK for Bell ExpressVu 752 772 kModulationQPSK = 0x1, 753 773 kModulation8PSK = 0x2, 754 774 kModulationQAM16 = 0x3, 755 775 }; 756 uint Modulation() const { return _data[8]&0x 1f; }776 uint Modulation() const { return _data[8]&0x7; } 757 777 QString ModulationString() const 758 778 { 759 779 static QString ms[] = { "qpsk", "qpsk", "8psk", "qam_16" }; … … 779 799 kInnerFEC_5_6_ConvolutionCodeRate = 0x4, 780 800 kInnerFEC_7_8_ConvolutionCodeRate = 0x5, 781 801 kInnerFEC_8_9_ConvolutionCodeRate = 0x6, 802 kInnerFEC_3_5_ConvolutionCodeRate = 0x7, 803 kInnerFEC_4_5_ConvolutionCodeRate = 0x8, 804 kInnerFEC_9_10_ConvolutionCodeRate = 0x9, 805 kInnerFEC_Auto = 0xA, 782 806 kInnerFEC_None = 0xF, 783 807 }; 784 808 uint FECInner() const { return _data[12] & 0xf; } … … 1756 1780 { 1757 1781 switch (cr) 1758 1782 { 1759 case 0x0: return " auto"; // not actually defined in spec1783 case 0x0: return "none"; // not actually defined in spec 1760 1784 case 0x1: return "1/2"; 1761 1785 case 0x2: return "2/3"; 1762 1786 case 0x3: return "3/4"; 1763 1787 case 0x4: return "5/6"; 1764 1788 case 0x5: return "7/8"; 1765 case 0x8: return "8/9"; 1789 case 0x6: return "8/9"; 1790 case 0x7: return "3/5"; 1791 case 0x8: return "4/5"; 1792 case 0x9: return "9/10"; 1766 1793 case 0xf: return "none"; 1767 1794 default: return "auto"; // not actually defined in spec 1768 1795 } -
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; 743 QString dvb_msystem; 744 QString dvb_rolloff; 741 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
19 19 #include <linux/dvb/frontend.h> 20 20 #include <linux/dvb/dmx.h> 21 21 22 #if (DVB_API_VERSION != 3 )23 # error "DVB driver includes with API version 3not found!"22 #if (DVB_API_VERSION != 3 && DVB_API_VERSION != 5) 23 # error "DVB driver includes with correct API version 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 >= 3 && DVB_API_VERSION_MINOR >= 1)30 #if ((DVB_API_VERSION >= 3 && DVB_API_VERSION_MINOR >= 1) || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 0)) 31 31 # define USE_ATSC 32 32 #else 33 33 #warning DVB API version < 3.1 … … 39 39 # define VSB_16 (fe_modulation)(QAM_AUTO+2) 40 40 #endif 41 41 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 42 #define dvb_fe_params dvb_frontend_parameters 47 43 48 44 class QString; 49 45 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 static bool dtvmultiplex_to_dtvproperties( 59 DTVTunerType, const DTVMultiplex&, struct dtv_properties*, bool do_tune); 60 61 static bool dtvmultiplex_to_dtvproperties( 62 DTVTunerType, const DTVMultiplex&, struct dtv_properties*); 63 64 static DTVMultiplex dtvproperties_to_dtvmultiplex( 65 DTVTunerType, const dtv_properties&); 66 67 57 68 #define LOC QString("DVBChan(%1:%2): ").arg(GetCardID()).arg(device) 58 69 #define LOC_WARN QString("DVBChan(%1:%2) Warning: ") \ 59 70 .arg(GetCardID()).arg(device) … … 167 178 frontend_name = master->frontend_name; 168 179 card_type = master->card_type; 169 180 capabilities = master->capabilities; 170 ext_modulations = master->ext_modulations;171 181 frequency_minimum = master->frequency_minimum; 172 182 frequency_maximum = master->frequency_maximum; 173 183 symbol_rate_minimum = master->symbol_rate_minimum; … … 210 220 return false; 211 221 } 212 222 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 223 frontend_name = info.name; 257 card_type = info.type; 224 //card_type = info.type; 225 card_type.Parse(CardUtil::ProbeDVBType(device)); 258 226 capabilities = info.caps; 259 227 frequency_minimum = info.frequency_min; 260 228 frequency_maximum = info.frequency_max; … … 309 277 bool DVBChannel::TuneMultiplex(uint mplexid, QString inputname) 310 278 { 311 279 DTVMultiplex tuning; 312 if (!tuning.FillFromDB(card_type, mplexid)) 280 bool ok = true; 281 //card_type.Parse(CardUtil::ProbeDVBType(inputname)); 282 ok = tuning.FillFromDB(card_type, mplexid); 283 if (!ok) 313 284 return false; 314 285 315 CheckOptions(tuning);286 //CheckOptions(tuning); 316 287 317 288 return Tune(tuning, inputname); 318 289 } … … 365 336 366 337 // Get the input data for the channel 367 338 QString tvformat, modulation, freqtable, freqid, si_std; 339 QString msystem, rolloff; 368 340 int finetune; 369 341 uint64_t frequency; 370 342 int mpeg_prog_num; … … 375 347 tvformat, modulation, freqtable, freqid, 376 348 finetune, frequency, 377 349 si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 350 msystem, rolloff, 378 351 mplexid, commfree)) 379 352 { 380 353 VERBOSE(VB_IMPORTANT, loc_err + … … 596 569 const DTVModulation m = modulation; 597 570 const uint64_t c = capabilities; 598 571 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 572 return 609 573 ((DTVModulation::kModulationQPSK == m) && (c & FE_CAN_QPSK)) || 610 574 ((DTVModulation::kModulationQAM16 == m) && (c & FE_CAN_QAM_16)) || … … 680 644 } 681 645 682 646 bool reset = (force_reset || first_tune); 683 struct dvb_fe_params params = dtvmultiplex_to_dvbparams(card_type, tuning);647 //struct dvb_fe_params params = dtvmultiplex_to_dvbparams(card_type, tuning); 684 648 649 struct dtv_properties cmds; 650 651 //clear card cache 652 dtv_property props[11]; 653 memset(&props, 0, sizeof(props)); 654 props[0].cmd = DTV_CLEAR; 655 cmds.num = 1; 656 cmds.props = props; 657 if (ioctl(fd_frontend, FE_SET_PROPERTY, &cmds) < 0) 658 { 659 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 660 "Clearing tuner cache failed." + ENO); 661 return false; 662 } 663 664 dtvmultiplex_to_dtvproperties(card_type, tuning, &cmds); 665 685 666 bool is_dvbs = (DTVTunerType::kTunerTypeQPSK == card_type || 686 667 DTVTunerType::kTunerTypeDVB_S2 == card_type); 687 668 … … 737 718 // make sure we tune to frequency, if the lnb has changed 738 719 reset = first_tune = true; 739 720 } 740 741 params.frequency = lnb->GetIntermediateFrequency(742 diseqc_settings, tuning);743 721 722 for (uint i = 0; i < cmds.num; i++) 723 { 724 if (cmds.props[i].cmd == DTV_FREQUENCY) 725 { 726 cmds.props[i].u.data = lnb->GetIntermediateFrequency( 727 diseqc_settings, tuning); 728 break; 729 } 730 } 731 //params.frequency = lnb->GetIntermediateFrequency( 732 // diseqc_settings, tuning); 733 744 734 // if card can auto-FEC, use it -- sometimes NITs are inaccurate 745 if (capabilities & FE_CAN_FEC_AUTO)746 params.u.qpsk.fec_inner = FEC_AUTO;735 //if (capabilities & FE_CAN_FEC_AUTO) 736 // params.u.qpsk.fec_inner = FEC_AUTO; 747 737 } 748 738 749 739 VERBOSE(VB_CHANNEL, LOC + "Old Params: " + … … 753 743 754 744 // DVB-S is in kHz, other DVB is in Hz 755 745 int freq_mult = (is_dvbs) ? 1 : 1000; 756 QString suffix = (is_dvbs) ? "kHz" : "Hz";746 //QString suffix = (is_dvbs) ? "kHz" : "Hz"; 757 747 758 748 if (reset || !prev_tuning.IsEqual(card_type, tuning, 500 * freq_mult)) 759 749 { 760 VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") 761 .arg(params.frequency).arg(suffix)); 762 763 #ifdef FE_GET_EXTENDED_INFO 764 if (card_type == DTVTunerType::kTunerTypeDVB_S2) 750 VERBOSE(VB_CHANNEL, LOC + "Tune(): Tuning ..."); 751 if (ioctl(fd_frontend, FE_SET_PROPERTY, &cmds) < 0) 765 752 { 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 } 753 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 754 "Setting Frontend tuning parameters failed." + ENO); 755 return false; 772 756 } 773 else774 #endif // FE_GET_EXTENDED_INFO775 {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 }782 }783 757 784 758 // Extra delay to add for broken DVB drivers 785 759 if (tuning_delay) … … 835 809 return false; 836 810 } 837 811 838 dvb_fe_params params; 839 return ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) >= 0; 812 //dvb_fe_params params; 813 //return ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) >= 0; 814 struct dtv_properties cmds; 815 cmds.num = 0; 816 return ioctl(fd_frontend, FE_GET_PROPERTY, &cmds) >= 0; 840 817 } 841 818 842 819 /** \fn DVBChannel::ProbeTuningParams(DTVMultiplex&) const … … 868 845 return false; 869 846 } 870 847 871 dvb_fe_params params; 872 if (ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) < 0) 848 struct dtv_properties cmds; 849 dtv_property props[11]; 850 memset(&props, 0, sizeof(props)); 851 cmds.props = props; 852 dtvmultiplex_to_dtvproperties(card_type, tuning, &cmds, false); 853 if (ioctl(fd_frontend, FE_GET_PROPERTY, &cmds) < 0) 873 854 { 874 855 VERBOSE(VB_IMPORTANT, LOC_ERR + 875 856 "Getting Frontend tuning parameters failed." + ENO); … … 880 861 uint mplex = tuning.mplex; 881 862 QString sistandard = tuning.sistandard; sistandard.detach(); 882 863 883 tuning = d vbparams_to_dtvmultiplex(card_type, params);864 tuning = dtvproperties_to_dtvmultiplex(card_type, cmds); 884 865 885 866 tuning.mplex = mplex; 886 867 tuning.sistandard = sistandard; … … 1094 1075 return true; 1095 1076 } 1096 1077 1097 static struct dvb_fe_params dtvmultiplex_to_dvbparams( 1098 DTVTunerType tuner_type, const DTVMultiplex &tuning) 1078 1079 static DTVMultiplex dtvproperties_to_dtvmultiplex( 1080 DTVTunerType tuner_type, const dtv_properties &cmds) 1099 1081 { 1100 dvb_fe_params params; 1101 bzero(¶ms, sizeof(params)); 1082 DTVMultiplex tuning; 1102 1083 1103 params.frequency = tuning.frequency; 1104 params.inversion = (fe_spectral_inversion_t) (int) tuning.inversion; 1105 1106 if (DTVTunerType::kTunerTypeQPSK == tuner_type) 1084 for (uint i = 0; i < cmds.num; i++) 1107 1085 { 1108 params.u.qpsk.symbol_rate = tuning.symbolrate; 1109 params.u.qpsk.fec_inner = (fe_code_rate_t) (int) tuning.fec; 1086 switch (cmds.props[i].cmd) 1087 { 1088 case DTV_MODULATION: 1089 tuning.modulation = cmds.props[i].u.data; 1090 break; 1091 case DTV_DELIVERY_SYSTEM: 1092 switch (cmds.props[i].u.data) 1093 { 1094 case SYS_DVBS: 1095 tuning.msystem = DTVModulationSystem::kModulationSystemDVBS; 1096 break; 1097 case SYS_DVBS2: 1098 tuning.msystem = DTVModulationSystem::kModulationSystemDVBS2; 1099 break; 1100 case SYS_DVBT: 1101 case SYS_DVBC_ANNEX_AC: 1102 case SYS_DVBC_ANNEX_B: 1103 #ifdef USE_ATSC 1104 case SYS_ATSC: 1105 #endif 1106 break; 1107 default: 1108 VERBOSE(VB_IMPORTANT, "Unknown DVB delivery system." + ENO); 1109 }; 1110 break; 1111 case DTV_FREQUENCY: 1112 if (tuning.modulation == DTVModulation::kModulationQPSK || 1113 tuning.modulation == DTVModulation::kModulation8PSK) 1114 tuning.frequency = cmds.props[i].u.data / 1000UL; 1115 else 1116 tuning.frequency = cmds.props[i].u.data; 1117 break; 1118 case DTV_SYMBOL_RATE: 1119 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1120 tuner_type == DTVTunerType::kTunerTypeDVB_S2 || 1121 tuner_type == DTVTunerType::kTunerTypeQAM) 1122 { 1123 if (tuning.modulation == DTVModulation::kModulationQPSK || 1124 tuning.modulation == DTVModulation::kModulation8PSK) 1125 tuning.symbolrate = cmds.props[i].u.data / 1000UL; 1126 else 1127 tuning.symbolrate = cmds.props[i].u.data; 1128 }; 1129 break; 1130 case DTV_INNER_FEC: 1131 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1132 tuner_type == DTVTunerType::kTunerTypeDVB_S2 || 1133 tuner_type == DTVTunerType::kTunerTypeQAM) 1134 { 1135 tuning.symbolrate = cmds.props[i].u.data; 1136 } 1137 break; 1138 case DTV_PILOT: 1139 break; 1140 case DTV_ROLLOFF: 1141 if (tuner_type == DTVTunerType::kTunerTypeDVB_S2) 1142 tuning.rolloff = cmds.props[i].u.data; 1143 break; 1144 case DTV_INVERSION: 1145 tuning.inversion = cmds.props[i].u.data; 1146 break; 1147 case DTV_BANDWIDTH_HZ: 1148 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1149 tuning.bandwidth = cmds.props[i].u.data; 1150 break; 1151 case DTV_CODE_RATE_HP: 1152 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1153 tuning.hp_code_rate = cmds.props[i].u.data; 1154 break; 1155 case DTV_CODE_RATE_LP: 1156 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1157 tuning.lp_code_rate = cmds.props[i].u.data; 1158 break; 1159 case DTV_TRANSMISSION_MODE: 1160 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1161 tuning.trans_mode = cmds.props[i].u.data; 1162 break; 1163 case DTV_GUARD_INTERVAL: 1164 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1165 tuning.guard_interval = cmds.props[i].u.data; 1166 break; 1167 case DTV_HIERARCHY: 1168 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1169 tuning.hierarchy = cmds.props[i].u.data; 1170 break; 1171 case DTV_TUNE: 1172 break; 1173 default: 1174 VERBOSE(VB_IMPORTANT, "Unknown DTV command." + ENO); 1175 } 1110 1176 } 1177 return tuning; 1178 } 1111 1179 1112 if (DTVTunerType::kTunerTypeDVB_S2 == tuner_type) 1113 { 1114 #ifdef FE_GET_EXTENDED_INFO 1115 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_INFO 1119 VERBOSE(VB_IMPORTANT, "DVBChan Error, MythTV was compiled without " 1120 "DVB-S2 headers being present so DVB-S2 tuning will fail."); 1121 #endif // !FE_GET_EXTENDED_INFO 1122 } 1180 static bool dtvmultiplex_to_dtvproperties( 1181 DTVTunerType tuner_type, 1182 const DTVMultiplex &tuning, 1183 struct dtv_properties *cmdseq) 1184 { 1185 return dtvmultiplex_to_dtvproperties(tuner_type, tuning, cmdseq, true); 1186 } 1123 1187 1124 if (DTVTunerType::kTunerTypeQAM == tuner_type) 1188 static bool dtvmultiplex_to_dtvproperties( 1189 DTVTunerType tuner_type, 1190 const DTVMultiplex &tuning, 1191 struct dtv_properties *cmdseq, 1192 bool do_tune) 1193 { 1194 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1195 (tuner_type == DTVTunerType::kTunerTypeDVB_S2 && 1196 tuning.modulation == DTVModulation::kModulationQPSK)) 1125 1197 { 1126 params.u.qam.symbol_rate = tuning.symbolrate; 1127 params.u.qam.fec_inner = (fe_code_rate_t) (int) tuning.fec; 1128 params.u.qam.modulation = (fe_modulation_t) (int) tuning.modulation; 1198 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1199 cmdseq->props[0].u.data = SYS_DVBS; 1200 cmdseq->props[1].cmd = DTV_FREQUENCY; 1201 cmdseq->props[1].u.data = tuning.frequency; 1202 cmdseq->props[2].cmd = DTV_MODULATION; 1203 cmdseq->props[2].u.data = tuning.modulation; 1204 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1205 cmdseq->props[3].u.data = tuning.symbolrate; 1206 cmdseq->props[4].cmd = DTV_INNER_FEC; 1207 cmdseq->props[4].u.data = tuning.fec; 1208 cmdseq->props[5].cmd = DTV_INVERSION; 1209 cmdseq->props[5].u.data = tuning.inversion; 1210 if (do_tune) 1211 { 1212 cmdseq->props[6].cmd = DTV_TUNE; 1213 cmdseq->num = 7; 1214 } 1215 else 1216 { 1217 cmdseq->num = 6; 1218 } 1129 1219 } 1130 1131 if (DTVTunerType::kTunerTypeOFDM == tuner_type)1220 else if (tuner_type == DTVTunerType::kTunerTypeDVB_S2 && 1221 tuning.modulation == DTVModulation::kModulation8PSK) 1132 1222 { 1133 params.u.ofdm.bandwidth = 1134 (fe_bandwidth_t) (int) tuning.bandwidth; 1135 params.u.ofdm.code_rate_HP = 1136 (fe_code_rate_t) (int) tuning.hp_code_rate; 1137 params.u.ofdm.code_rate_LP = 1138 (fe_code_rate_t) (int) tuning.lp_code_rate; 1139 params.u.ofdm.constellation = 1140 (fe_modulation_t) (int) tuning.modulation; 1141 params.u.ofdm.transmission_mode = 1142 (fe_transmit_mode_t) (int) tuning.trans_mode; 1143 params.u.ofdm.guard_interval = 1144 (fe_guard_interval_t) (int) tuning.guard_interval; 1145 params.u.ofdm.hierarchy_information = 1146 (fe_hierarchy_t) (int) tuning.hierarchy; 1223 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1224 cmdseq->props[0].u.data = SYS_DVBS2; 1225 cmdseq->props[1].cmd = DTV_FREQUENCY; 1226 cmdseq->props[1].u.data = tuning.frequency; 1227 cmdseq->props[2].cmd = DTV_MODULATION; 1228 cmdseq->props[2].u.data = tuning.modulation; 1229 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1230 cmdseq->props[3].u.data = tuning.symbolrate; 1231 cmdseq->props[4].cmd = DTV_INNER_FEC; 1232 cmdseq->props[4].u.data = tuning.fec; 1233 cmdseq->props[5].cmd = DTV_INVERSION; 1234 cmdseq->props[5].u.data = tuning.inversion; 1235 cmdseq->props[6].cmd = DTV_PILOT; 1236 cmdseq->props[6].u.data = PILOT_AUTO; 1237 cmdseq->props[7].cmd = DTV_ROLLOFF; 1238 if (tuning.msystem == DTVModulationSystem::kModulationSystemDVBS2) 1239 cmdseq->props[7].u.data = tuning.rolloff; 1240 else 1241 cmdseq->props[7].u.data = DTVRollOff::kRollOff35; 1242 if (do_tune) 1243 { 1244 cmdseq->props[8].cmd = DTV_TUNE; 1245 cmdseq->num = 9; 1246 } 1247 else 1248 cmdseq->num = 8; 1147 1249 } 1148 1149 if (DTVTunerType::kTunerTypeATSC == tuner_type) 1250 else if (tuner_type == DTVTunerType::kTunerTypeQAM) 1150 1251 { 1151 #ifdef USE_ATSC 1152 params.u.vsb.modulation = 1153 (fe_modulation_t) (int) tuning.modulation; 1154 #endif // USE_ATSC 1252 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1253 cmdseq->props[0].u.data = (fe_delivery_system_t) (int) tuning.msystem; 1254 cmdseq->props[1].cmd = DTV_FREQUENCY; 1255 cmdseq->props[1].u.data = tuning.frequency; 1256 cmdseq->props[2].cmd = DTV_MODULATION; 1257 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation; 1258 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1259 cmdseq->props[3].u.data = tuning.symbolrate; 1260 cmdseq->props[4].cmd = DTV_INNER_FEC; 1261 cmdseq->props[4].u.data = (fe_code_rate_t) (int) tuning.fec; 1262 cmdseq->props[5].cmd = DTV_INVERSION; 1263 cmdseq->props[5].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1264 if (do_tune) 1265 { 1266 cmdseq->props[6].cmd = DTV_TUNE; 1267 cmdseq->num = 7; 1268 } 1269 else 1270 cmdseq->num = 6; 1155 1271 } 1156 1157 return params; 1158 } 1159 1160 static DTVMultiplex dvbparams_to_dtvmultiplex( 1161 DTVTunerType tuner_type, const dvb_fe_params ¶ms) 1162 { 1163 DTVMultiplex tuning; 1164 1165 tuning.frequency = params.frequency; 1166 tuning.inversion = params.inversion; 1167 1168 if ((DTVTunerType::kTunerTypeQPSK == tuner_type) || 1169 (DTVTunerType::kTunerTypeDVB_S2 == tuner_type)) 1272 else if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1170 1273 { 1171 tuning.symbolrate = params.u.qpsk.symbol_rate; 1172 tuning.fec = params.u.qpsk.fec_inner; 1274 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1275 cmdseq->props[0].u.data = SYS_DVBC_ANNEX_AC; 1276 cmdseq->props[1].cmd = DTV_FREQUENCY; 1277 cmdseq->props[1].u.data = tuning.frequency; 1278 cmdseq->props[2].cmd = DTV_MODULATION; 1279 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation; 1280 cmdseq->props[3].cmd = DTV_INVERSION; 1281 cmdseq->props[3].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1282 cmdseq->props[4].cmd = DTV_BANDWIDTH_HZ; 1283 cmdseq->props[4].u.data = (fe_bandwidth_t) (int) tuning.bandwidth; 1284 cmdseq->props[5].cmd = DTV_CODE_RATE_HP; 1285 cmdseq->props[5].u.data = (fe_code_rate_t) (int) tuning.hp_code_rate; 1286 cmdseq->props[6].cmd = DTV_CODE_RATE_LP; 1287 cmdseq->props[6].u.data = (fe_code_rate_t) (int) tuning.lp_code_rate; 1288 cmdseq->props[7].cmd = DTV_TRANSMISSION_MODE; 1289 cmdseq->props[7].u.data = (fe_transmit_mode_t) (int) tuning.trans_mode; 1290 cmdseq->props[8].cmd = DTV_GUARD_INTERVAL; 1291 cmdseq->props[8].u.data = (fe_guard_interval_t) (int) tuning.guard_interval; 1292 cmdseq->props[9].cmd = DTV_HIERARCHY; 1293 cmdseq->props[9].u.data = (fe_hierarchy_t) (int) tuning.hierarchy; 1294 if (do_tune) 1295 { 1296 cmdseq->props[10].cmd = DTV_TUNE; 1297 cmdseq->num = 11; 1298 } 1299 else 1300 cmdseq->num = 10; 1173 1301 } 1174 1175 if (DTVTunerType::kTunerTypeQAM == tuner_type)1302 #ifdef USE_ATSC 1303 else if (tuner_type == DTVTunerType::kTunerTypeATSC) 1176 1304 { 1177 tuning.symbolrate = params.u.qam.symbol_rate; 1178 tuning.fec = params.u.qam.fec_inner; 1179 tuning.modulation = params.u.qam.modulation; 1305 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1306 cmdseq->props[0].u.data = SYS_ATSC; 1307 cmdseq->props[1].cmd = DTV_FREQUENCY; 1308 cmdseq->props[1].u.data = tuning.frequency * 1000UL; 1309 cmdseq->props[2].cmd = DTV_MODULATION; 1310 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation;; 1311 cmdseq->props[3].cmd = DTV_INVERSION; 1312 cmdseq->props[3].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1313 if (do_tune) 1314 { 1315 cmdseq->props[4].cmd = DTV_TUNE; 1316 cmdseq->num = 5; 1317 } 1318 else 1319 cmdseq->num = 4; 1180 1320 } 1181 1182 if (DTVTunerType::kTunerTypeOFDM == tuner_type)1321 #endif 1322 else 1183 1323 { 1184 tuning.bandwidth = params.u.ofdm.bandwidth; 1185 tuning.hp_code_rate = params.u.ofdm.code_rate_HP; 1186 tuning.lp_code_rate = params.u.ofdm.code_rate_LP; 1187 tuning.modulation = params.u.ofdm.constellation; 1188 tuning.trans_mode = params.u.ofdm.transmission_mode; 1189 tuning.guard_interval = params.u.ofdm.guard_interval; 1190 tuning.hierarchy = params.u.ofdm.hierarchy_information; 1324 VERBOSE(VB_IMPORTANT, "Unknown tuner type." + ENO); 1191 1325 } 1326 return true; 1327 } 1192 1328 1193 if (DTVTunerType::kTunerTypeATSC == tuner_type)1194 {1195 #ifdef USE_ATSC1196 tuning.modulation = params.u.vsb.modulation;1197 #endif // USE_ATSC1198 }1199 1200 return tuning;1201 } -
libs/libmythtv/cardutil.cpp
242 242 VERBOSE(VB_IMPORTANT, "FE_GET_INFO ioctl failed (" + dvbdev + ")."); 243 243 return ret; 244 244 } 245 DTVTunerType type(info.type); 246 if (type == DTVTunerType::kTunerTypeQPSK) 247 { 248 /* XXX TODO 249 * there is currently no way to detect if the frontend supports DVB-S2 250 * so every DVB-S frontend is handled as DVB-S2 */ 251 type = DTVTunerType::kTunerTypeDVB_S2; 252 } 245 253 close(fd_frontend); 246 254 247 DTVTunerType type(info.type);248 255 ret = (type.toString() != "UNKNOWN") ? type.toString().toUpper() : ret; 249 256 #endif // USING_DVB 250 257 … … 337 344 { 338 345 QString ct = card_type.toUpper(); 339 346 return (ct == "DVB") || (ct == "QAM") || (ct == "QPSK") || 340 (ct == "OFDM") || (ct == "ATSC") ;347 (ct == "OFDM") || (ct == "ATSC") || (ct == "DVB_S2"); 341 348 } 342 349 343 350 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()); 72 73 } 73 74 74 75 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 addSelection(tr("Import channels.conf"), 456 456 QString::number(DVBUtilsImport)); 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; 458 464 case CardUtil::QAM: 459 465 addSelection(tr("Full Scan (Tuned)"), 460 466 QString::number(NITAddScan_QAM)); … … 574 580 paneQAM); 575 581 addTarget(QString::number(ScanTypeSetting::NITAddScan_QPSK), 576 582 paneQPSK); 583 addTarget(QString::number(ScanTypeSetting::NITAddScan_DVBS2), 584 paneDVBS2); 577 585 addTarget(QString::number(ScanTypeSetting::NITAddScan_OFDM), 578 586 paneOFDM); 579 587 addTarget(QString::number(ScanTypeSetting::FullScan_ATSC), … … 766 774 startChan["modulation"] = "qpsk"; 767 775 startChan["polarity"] = pane->polarity(); 768 776 } 777 else if (ScanTypeSetting::NITAddScan_DVBS2 == st) 778 { 779 const DVBS2Pane *pane = paneDVBS2; 780 781 startChan["std"] = "dvb"; 782 startChan["frequency"] = pane->frequency(); 783 startChan["inversion"] = pane->inversion(); 784 startChan["symbolrate"] = pane->symbolrate(); 785 startChan["fec"] = pane->fec(); 786 startChan["msystem"] = pane->msystem(); 787 startChan["modulation"] = pane->modulation(); 788 startChan["polarity"] = pane->polarity(); 789 startChan["rolloff"] = pane->rolloff(); 790 } 769 791 else if (ScanTypeSetting::NITAddScan_QAM == st) 770 792 { 771 793 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; … … 182 189 return ok; 183 190 } 184 191 192 bool DTVMultiplex::ParseDVB_S2( 193 const QString &_frequency, const QString &_inversion, 194 const QString &_symbol_rate, const QString &_fec_inner, 195 const QString &_modulation, const QString &_polarity, 196 const QString &_msystem, const QString &_rolloff) 197 { 198 bool ok = inversion.Parse(_inversion); 199 if (!ok) 200 { 201 VERBOSE(VB_GENERAL, LOC_WARN + 202 "Invalid inversion, falling back to 'auto'"); 203 204 ok = true; 205 } 206 207 symbolrate = _symbol_rate.toInt(); 208 if (!symbolrate) 209 { 210 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid symbol rate " + 211 QString("parameter '%1', aborting.").arg(_symbol_rate)); 212 213 return false; 214 } 215 216 ok &= fec.Parse(_fec_inner); 217 ok &= modulation.Parse(_modulation); 218 219 if (!_polarity.isEmpty()) 220 ok &= polarity.Parse(_polarity.toLower()); 221 222 ok &= msystem.Parse(_msystem); 223 224 if (!ok) 225 { 226 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid S2 modulation system " + 227 QString("parameter '%1', aborting.").arg(_symbol_rate)); 228 return false; 229 } 230 231 if (!_rolloff.isEmpty()) 232 ok &= rolloff.Parse(_rolloff); 233 234 if (ok) 235 frequency = _frequency.toInt(&ok); 236 237 return ok; 238 } 239 185 240 bool DTVMultiplex::ParseTuningParams( 186 241 DTVTunerType type, 187 242 QString _frequency, QString _inversion, QString _symbolrate, 188 243 QString _fec, QString _polarity, 189 244 QString _hp_code_rate, QString _lp_code_rate, QString _ofdm_modulation, 190 245 QString _trans_mode, QString _guard_interval, QString _hierarchy, 191 QString _modulation, QString _bandwidth) 246 QString _modulation, QString _bandwidth, 247 QString _msystem, QString _rolloff) 192 248 { 193 249 if (DTVTunerType::kTunerTypeOFDM == type) 194 250 { … … 199 255 } 200 256 201 257 if ((DTVTunerType::kTunerTypeQPSK == type) || 202 (DTVTunerType::kTunerTypeDVB_S2 == type) ||203 258 (DTVTunerType::kTunerTypeQAM == type)) 204 259 { 205 260 return ParseDVB_S_and_C( … … 207 262 _fec, _modulation, _polarity); 208 263 } 209 264 265 if (DTVTunerType::kTunerTypeDVB_S2 == type) 266 { 267 return ParseDVB_S2( 268 _frequency, _inversion, _symbolrate, 269 _fec, _modulation, _polarity, 270 _msystem, _rolloff); 271 } 272 210 273 if (DTVTunerType::kTunerTypeATSC == type) 211 274 return ParseATSC(_frequency, _modulation); 212 275 … … 223 286 " fec, polarity, " 224 287 " hp_code_rate, lp_code_rate, constellation, " 225 288 " transmission_mode, guard_interval, hierarchy, " 226 " modulation, bandwidth, sistandard " 289 " modulation, bandwidth, sistandard, " 290 " msystem, rolloff " 227 291 "FROM dtv_multiplex " 228 292 "WHERE dtv_multiplex.mplexid = :MPLEXID"); 229 293 query.bindValue(":MPLEXID", mplexid); … … 256 320 query.value(6).toString(), query.value(7).toString(), 257 321 query.value(8).toString(), query.value(9).toString(), 258 322 query.value(10).toString(), query.value(11).toString(), 259 query.value(12).toString()); 323 query.value(12).toString(), query.value(14).toString(), 324 query.value(15).toString()); 260 325 } 261 326 262 327 //////////////////////////////////////////////////////////////////////////// … … 318 383 " mplexid, frequency, inversion, " 319 384 " symbolrate, fec, polarity, " 320 385 " hp_code_rate, lp_code_rate, modulation, " 386 " msystem, rolloff, " 321 387 " transmission_mode, guard_interval, hierarchy, " 322 388 " bandwidth, sistandard, tuner_type " 323 389 " ) " … … 326 392 " :MPLEXID, :FREQUENCY, :INVERSION, " 327 393 " :SYMBOLRATE, :FEC, :POLARITY, " 328 394 " :HP_CODE_RATE, :LP_CODE_RATE, :MODULATION, " 395 " :MSYSTEM, :ROLLOFF, " 329 396 " :TRANSMISSION_MODE, :GUARD_INTERVAL, :HIERARCHY, " 330 397 " :BANDWIDTH, :SISTANDARD, :TUNER_TYPE " 331 398 " );"); … … 340 407 query.bindValue(":HP_CODE_RATE", hp_code_rate.toString()); 341 408 query.bindValue(":LP_CODE_RATE", lp_code_rate.toString()); 342 409 query.bindValue(":MODULATION", modulation.toString()); 410 query.bindValue(":MSYSTEM", msystem.toString()); 411 query.bindValue(":ROLLOFF", rolloff.toString()); 343 412 query.bindValue(":TRANSMISSION_MODE", trans_mode.toString()); 344 413 query.bindValue(":GUARD_INTERVAL", guard_interval.toString()); 345 414 query.bindValue(":HIERARCHY", hierarchy.toString());