Ticket #1330: 8psk.2.patch
File 8psk.2.patch, 19.2 KB (added by , 20 years ago) |
---|
-
libs/libmythtv/scanwizardhelpers.h
418 418 { 419 419 addSelection(QObject::tr("Auto"),"auto",true); 420 420 addSelection("QPSK","qpsk"); 421 #ifdef FE_GET_EXTENDED_INFO 422 addSelection("8PSK","8psk"); 423 #endif 421 424 addSelection("QAM 16","qam_16"); 422 425 addSelection("QAM 32","qam_32"); 423 426 addSelection("QAM 64","qam_64"); … … 591 594 ScanGuardInterval *pguard_interval; 592 595 ScanHierarchy *phierarchy; 593 596 }; 597 #ifdef FE_GET_EXTENDED_INFO 598 class DVBS2Pane : public HorizontalConfigurationGroup 599 { 600 public: 601 DVBS2Pane() : HorizontalConfigurationGroup(false,false,true,false) 602 { 603 setUseFrame(false); 604 VerticalConfigurationGroup *left = 605 new VerticalConfigurationGroup(false,true); 606 VerticalConfigurationGroup *right = 607 new VerticalConfigurationGroup(false,true); 608 left->addChild(pfrequency = new ScanFrequency()); 609 left->addChild(ppolarity = new ScanPolarity()); 610 left->addChild(psymbolrate = new ScanSymbolRate()); 611 right->addChild(pfec = new ScanFec()); 612 right->addChild(pmodulation= new ScanModulation()); 613 right->addChild(pinversion = new ScanInversion()); 614 addChild(left); 615 addChild(right); 616 } 594 617 618 QString frequency() { return pfrequency->getValue(); } 619 QString symbolrate() { return psymbolrate->getValue(); } 620 QString inversion() { return pinversion->getValue(); } 621 QString fec() { return pfec->getValue(); } 622 QString polarity() { return ppolarity->getValue(); } 623 QString modulation() { return pmodulation->getValue(); } 624 625 protected: 626 ScanFrequency *pfrequency; 627 ScanSymbolRate *psymbolrate; 628 ScanInversion *pinversion; 629 ScanFec *pfec; 630 ScanPolarity *ppolarity; 631 ScanModulation *pmodulation; 632 }; 633 #endif 634 595 635 class QPSKPane : public HorizontalConfigurationGroup 596 636 { 597 637 public: -
libs/libmythtv/dvbtypes.cpp
156 156 {"QAM_128",QAM_128}, 157 157 {"QAM_256",QAM_256}, 158 158 {"QPSK",QPSK}, 159 #ifdef FE_GET_EXTENDED_INFO 160 {"8PSK", MOD_8PSK}, 161 #endif 159 162 {NULL,QAM_AUTO}, 160 163 }; 161 164 … … 182 185 {"qpsk",QPSK}, 183 186 {"8vsb",VSB_8}, 184 187 {"16vsb",VSB_16}, 188 #ifdef FE_GET_EXTENDED_INFO 189 {"8psk", MOD_8PSK}, 190 #endif 185 191 {NULL,QAM_AUTO}, 186 192 }; 187 193 … … 195 201 "qam_256", //QAM_256, 196 202 "auto", //QAM_AUTO, 197 203 "8vsb", //VSB_8, 198 "16vsb" //VSB_16 204 "16vsb", //VSB_16 205 #ifdef FE_GET_EXTENDED_INFO 206 "8psk", 207 #endif 199 208 }; 200 209 201 210 DVBParamHelper<fe_transmit_mode_t>::Table DVBTransmitMode::confTable[] = … … 307 316 "a" //HIERARCHY_AUTO 308 317 }; 309 318 310 bool equal_qpsk(const struct dvb_f rontend_parameters &p,311 const struct dvb_f rontend_parameters &op, uint range)319 bool equal_qpsk(const struct dvb_fe_params &p, 320 const struct dvb_fe_params &op, uint range) 312 321 { 313 322 return 314 323 p.frequency + range >= op.frequency && … … 318 327 p.u.qpsk.fec_inner == op.u.qpsk.fec_inner; 319 328 } 320 329 321 bool equal_atsc(const struct dvb_frontend_parameters &p, 322 const struct dvb_frontend_parameters &op, uint range) 330 #ifdef FE_GET_EXTENDED_INFO 331 bool equal_dvbs2(const struct dvb_frontend_parameters_new &p, 332 const struct dvb_frontend_parameters_new &op, uint range) 323 333 { 334 return 335 p.frequency + range >= op.frequency && 336 p.frequency <= op.frequency + range && 337 p.inversion == op.inversion && 338 p.u.qpsk.symbol_rate == op.u.qpsk.symbol_rate && 339 p.u.qpsk.fec_inner == op.u.qpsk.fec_inner; 340 } 341 #endif 342 343 bool equal_atsc(const struct dvb_fe_params &p, 344 const struct dvb_fe_params &op, uint range) 345 { 324 346 bool ok = 325 347 p.frequency + range >= op.frequency && 326 348 p.frequency <= op.frequency + range; … … 330 352 return ok; 331 353 } 332 354 333 bool equal_qam(const struct dvb_f rontend_parameters &p,334 const struct dvb_f rontend_parameters &op, uint range)355 bool equal_qam(const struct dvb_fe_params &p, 356 const struct dvb_fe_params &op, uint range) 335 357 { 336 358 return 337 359 p.frequency + range >= op.frequency && … … 342 364 p.u.qam.modulation == op.u.qam.modulation; 343 365 } 344 366 345 bool equal_ofdm(const struct dvb_f rontend_parameters &p,346 const struct dvb_f rontend_parameters &op,367 bool equal_ofdm(const struct dvb_fe_params &p, 368 const struct dvb_fe_params &op, 347 369 uint range) 348 370 { 349 371 return … … 359 381 p.u.ofdm.hierarchy_information == op.u.ofdm.hierarchy_information; 360 382 } 361 383 362 bool equal_type(const struct dvb_f rontend_parameters &p,363 const struct dvb_f rontend_parameters &op,384 bool equal_type(const struct dvb_fe_params &p, 385 const struct dvb_fe_params &op, 364 386 fe_type_t type, uint freq_range) 365 387 { 366 388 if (FE_QAM == type) … … 371 393 return equal_qpsk(p, op, freq_range); 372 394 if (FE_ATSC == type) 373 395 return equal_atsc(p, op, freq_range); 396 #ifdef FE_GET_EXTENDED_INFO 397 if (FE_DVB_S2 == type) 398 return equal_dvbs2(p, op, freq_range); 399 #endif 374 400 return false; 375 401 } 376 402 … … 659 685 return true; 660 686 } 661 687 688 #ifdef FE_GET_EXTENDED_INFO 689 bool DVBTuning::parseDVBS2(const QString& frequency, const QString& inversion, 690 const QString& symbol_rate, const QString& fec_inner, 691 const QString& pol, const QString& _diseqc_type, 692 const QString& _diseqc_port, 693 const QString& _diseqc_pos, 694 const QString& _lnb_lof_switch, 695 const QString& _lnb_lof_hi, 696 const QString& _lnb_lof_lo, 697 const QString &modulation) 698 { 699 bool ok = true; 700 701 dvb_dvbs2_parameters& p = params.u.qpsk2; 702 params.frequency = frequency.toInt(); 703 704 params.inversion = parseInversion(inversion, ok); 705 if (!ok) 706 VERBOSE(VB_GENERAL, LOC_WARN + 707 "Invalid inversion, aborting, falling back to 'auto'"); 708 709 p.symbol_rate = symbol_rate.toInt(); 710 if (!p.symbol_rate) 711 { 712 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid symbol rate " + 713 QString("parameter '%1', aborting.").arg(symbol_rate)); 714 return false; 715 } 716 717 voltage = parsePolarity(pol, ok); 718 if (SEC_VOLTAGE_OFF == voltage) 719 { 720 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid polarization, aborting."); 721 return false; 722 } 723 724 p.fec_inner = parseCodeRate(fec_inner, ok); 725 726 p.modulation = parseModulation(modulation, ok); 727 diseqc_type = _diseqc_type.toInt(); 728 diseqc_port = _diseqc_port.toInt(); 729 diseqc_pos = _diseqc_pos.toFloat(); 730 lnb_lof_switch = _lnb_lof_switch.toInt(); 731 lnb_lof_hi = _lnb_lof_hi.toInt(); 732 lnb_lof_lo = _lnb_lof_lo.toInt(); 733 return true; 734 } 735 #endif 736 662 737 // TODO: Add in DiseqcPos when diseqc class supports it 663 738 bool DVBTuning::parseQPSK(const QString& frequency, const QString& inversion, 664 739 const QString& symbol_rate, const QString& fec_inner, … … 902 977 else if (modulation == "qam-16") return QAM_16; 903 978 else if (modulation == "8-vsb") return VSB_8; 904 979 else if (modulation == "16-vsb") return VSB_16; 905 980 #ifdef FE_GET_EXTENDED_INFO 981 else if (modulation == "8psk") return MOD_8PSK; 982 #endif 906 983 ok = false; 907 984 908 985 VERBOSE(VB_GENERAL, LOC_WARN + … … 942 1019 hierarchy); 943 1020 else if (FE_ATSC == type) 944 1021 ok = tuning.parseATSC(frequency, modulation); 1022 #ifdef FE_GET_EXTENDED_INFO 1023 else if (FE_DVB_S2 == type) 1024 ok = tuning.parseDVBS2( 1025 frequency, inversion, symbolrate, fec, polarity, 1026 dvb_diseqc_type, diseqc_port, diseqc_pos, 1027 lnb_lof_switch, lnb_lof_hi, lnb_lof_lo, modulation); 1028 #endif 945 1029 946 1030 sistandard = _sistandard; 947 1031 input_id = _input_id.toInt(); … … 963 1047 case QAM_16: return "QAM-16"; 964 1048 case VSB_8: return "8-VSB"; 965 1049 case VSB_16: return "16-VSB"; 1050 #ifdef FE_GET_EXTENDED_INFO 1051 case MOD_8PSK: return "8PSK"; 1052 #endif 966 1053 default: return "auto"; 967 1054 } 968 1055 return "Unknown"; … … 981 1068 case QAM_256: return "qam_256"; 982 1069 case VSB_8: return "8vsb"; 983 1070 case VSB_16: return "16vsb"; 1071 #ifdef FE_GET_EXTENDED_INFO 1072 case MOD_8PSK: return "8psk"; 1073 #endif 984 1074 default: return "auto"; 985 1075 } 986 1076 } … … 1015 1105 return "Unknown"; 1016 1106 } 1017 1107 1018 QString toString(const struct dvb_f rontend_parameters ¶ms,1108 QString toString(const struct dvb_fe_params ¶ms, 1019 1109 const fe_type_t type) 1020 1110 { 1021 1111 return QString("freq(%1) type(%2)") … … 1038 1128 QString toString(const struct dvb_frontend_event &event, 1039 1129 const fe_type_t type) 1040 1130 { 1131 const struct dvb_fe_params *params; 1132 params = (const struct dvb_fe_params *)(&event.parameters); 1041 1133 return QString("Event status(%1) %2") 1042 .arg(toString(event.status)).arg(toString(event.parameters, type)); 1134 .arg(toString(event.status)) 1135 .arg(toString(*params, type)); 1043 1136 } -
libs/libmythtv/dvbchannel.h
101 101 dvb_frontend_info info; ///< Contains info on tuning hardware 102 102 dvb_channel_t chan_opts; ///< Tuning options sent to tuning hardware 103 103 DVBTuning prev_tuning; ///< Last tuning options sent to hardware 104 #ifdef FE_GET_EXTENDED_INFO 105 dvb_fe_caps_extended extinfo; ///<Additional info on tuning hardware 106 #endif 104 107 105 108 volatile int fd_frontend; ///< File descriptor for tuning hardware 106 109 int cardnum; ///< DVB Card number -
libs/libmythtv/dvbtypes.h
51 51 #define MAX_SECTION_SIZE 4096 52 52 #define DMX_DONT_FILTER 0x2000 53 53 54 #ifdef FE_GET_EXTENDED_INFO 55 #define dvb_fe_params dvb_frontend_parameters_new 56 #else 57 #define dvb_fe_params dvb_frontend_parameters 58 #endif 59 54 60 QString toString(const fe_type_t); 55 QString toString(const struct dvb_f rontend_parameters&, const fe_type_t);61 QString toString(const struct dvb_fe_params&, const fe_type_t); 56 62 QString toString(fe_status); 57 63 QString toString(const struct dvb_frontend_event&, const fe_type_t); 58 64 … … 282 288 typedef vector<uint16_t> dvb_caid_t; 283 289 284 290 extern bool equal_qpsk( 285 const struct dvb_frontend_parameters &p, 286 const struct dvb_frontend_parameters &op, uint range); 291 const struct dvb_fe_params &p, 292 const struct dvb_fe_params &op, uint range); 293 #ifdef FE_GET_EXTENDED_INFO 294 extern bool equal_dvbs2( 295 const struct dvb_fe_params &p, 296 const struct dvb_fe_params &op, uint range); 297 #endif 287 298 extern bool equal_atsc( 288 const struct dvb_f rontend_parameters &p,289 const struct dvb_f rontend_parameters &op, uint range);299 const struct dvb_fe_params &p, 300 const struct dvb_fe_params &op, uint range); 290 301 extern bool equal_qam( 291 const struct dvb_f rontend_parameters &p,292 const struct dvb_f rontend_parameters &op, uint range);302 const struct dvb_fe_params &p, 303 const struct dvb_fe_params &op, uint range); 293 304 extern bool equal_ofdm( 294 const struct dvb_f rontend_parameters &p,295 const struct dvb_f rontend_parameters &op, uint range);305 const struct dvb_fe_params &p, 306 const struct dvb_fe_params &op, uint range); 296 307 extern bool equal_type( 297 const struct dvb_f rontend_parameters &p,298 const struct dvb_f rontend_parameters &op,308 const struct dvb_fe_params &p, 309 const struct dvb_fe_params &op, 299 310 fe_type_t type, uint freq_range); 300 311 301 312 class DVBTuning … … 306 317 diseqc_type(0), diseqc_port(0), diseqc_pos(0.0f), 307 318 lnb_lof_switch(0), lnb_lof_hi(0), lnb_lof_lo(0) 308 319 { 309 bzero(¶ms, sizeof(dvb_f rontend_parameters));320 bzero(¶ms, sizeof(dvb_fe_params)); 310 321 } 311 322 312 struct dvb_f rontend_parameters params;323 struct dvb_fe_params params; 313 324 fe_sec_voltage_t voltage; 314 325 fe_sec_tone_mode_t tone; 315 326 unsigned int diseqc_type; … … 386 397 bool parseQAM(const QString& frequency, const QString& inversion, 387 398 const QString& symbol_rate, const QString& fec_inner, 388 399 const QString& modulation); 400 401 #ifdef FE_GET_EXTENDED_INFO 402 bool equalDVBS2(const DVBTuning& other, uint range = 0) const 403 { return equal_dvbs2(params, other.params, range); } 404 uint DVBS2SymbolRate() const { return params.u.qpsk2.symbol_rate; } 405 bool parseDVBS2(const QString& frequency, const QString& inversion, 406 const QString& symbol_rate, const QString& fec_inner, 407 const QString& pol, const QString& diseqc_type, 408 const QString& diseqc_port, const QString& diseqc_pos, 409 const QString& lnb_lof_switch, const QString& lnb_lof_hi, 410 const QString& lnb_lof_lo, const QString& modulation); 411 #endif 389 412 }; 390 413 391 414 class dvb_channel_t -
libs/libmythtv/dvbchannel.cpp
147 147 return false; 148 148 } 149 149 150 #ifdef FE_GET_EXTENDED_INFO 151 if (info.caps & FE_HAS_EXTENDED_INFO) 152 { 153 if (ioctl(fd_frontend, FE_GET_EXTENDED_INFO, &extinfo) < 0) 154 { 155 VERBOSE(VB_IMPORTANT, LOC_ERR + 156 "Failed to get frontend extended information." + ENO); 157 close(fd_frontend); 158 fd_frontend = -1; 159 return false; 160 } 161 if (extinfo.modulations & MOD_8PSK) 162 { 163 if (ioctl(fd_frontend, FE_SET_STANDARD, FE_DVB_S2) < 0) 164 { 165 VERBOSE(VB_IMPORTANT, LOC_ERR + 166 "Failed to get extended frontend information." + ENO); 167 close(fd_frontend); 168 fd_frontend = -1; 169 return false; 170 } 171 if (ioctl(fd_frontend, FE_GET_INFO, &info) < 0) 172 { 173 VERBOSE(VB_IMPORTANT, LOC_ERR + 174 "Failed to get frontend information." + ENO); 175 close(fd_frontend); 176 fd_frontend = -1; 177 return false; 178 } 179 } 180 } 181 #endif 182 150 183 VERBOSE(VB_RECORD, LOC + QString("Using DVB card %1, with frontend '%2'.") 151 184 .arg(cardnum).arg(info.name)); 152 185 153 186 // Turn on the power to the LNB 187 #ifdef FE_GET_EXTENDED_INFO 188 if (info.type == FE_QPSK || info.type == FE_DVB_S2) 189 #else 154 190 if (info.type == FE_QPSK) 191 #endif 155 192 { 156 193 if (ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF) < 0) 157 194 { … … 473 510 } 474 511 break; 475 512 513 #ifdef FE_GET_EXTENDED_INFO 514 case FE_DVB_S2: 515 symbol_rate = t.DVBS2SymbolRate(); 516 517 if (!CheckModulation(t.params.u.qpsk2.modulation)) 518 VERBOSE(VB_GENERAL, LOC_WARN + 519 "Unsupported modulation parameter."); 520 521 if (!CheckCodeRate(t.params.u.qpsk2.fec_inner)) 522 VERBOSE(VB_GENERAL, LOC_WARN + 523 "Unsupported fec_inner parameter."); 524 break; 525 #endif 526 476 527 case FE_QAM: 477 528 symbol_rate = t.QAMSymbolRate(); 478 529 … … 541 592 case FE_ATSC: 542 593 // ATSC doesn't need any validation 543 594 break; 595 default: 596 break; 544 597 } 545 598 546 599 if (info.type != FE_OFDM && … … 572 625 case FEC_8_9: if (info.caps & FE_CAN_FEC_8_9) return true; 573 626 case FEC_AUTO: if (info.caps & FE_CAN_FEC_AUTO) return true; 574 627 case FEC_NONE: return true; 628 default: return false; 575 629 } 576 630 return false; 577 631 } … … 592 646 case QAM_AUTO: if (info.caps & FE_CAN_QAM_AUTO) return true; 593 647 case VSB_8: if (info.caps & FE_CAN_8VSB) return true; 594 648 case VSB_16: if (info.caps & FE_CAN_16VSB) return true; 649 #ifdef FE_GET_EXTENDED_INFO 650 case MOD_8PSK: if (info.caps & FE_HAS_EXTENDED_INFO && 651 extinfo.modulations & MOD_8PSK) return true; 652 #endif 653 default: return false; 595 654 } 596 655 return false; 597 656 } … … 644 703 bool DVBChannel::Tune(const dvb_channel_t& channel, bool force_reset) 645 704 { 646 705 bool reset = (force_reset || first_tune); 706 #ifdef FE_GET_EXTENDED_INFO 707 bool has_diseq = (FE_QPSK == info.type || FE_DVB_S2 == info.type) && diseqc; 708 #else 647 709 bool has_diseq = (FE_QPSK == info.type) && diseqc; 648 struct dvb_frontend_parameters params = channel.tuning.params; 710 #endif 711 struct dvb_fe_params params = channel.tuning.params; 649 712 650 713 retune_tuning = channel.tuning; 651 714 … … 683 746 684 747 params.frequency = params.frequency + (retune_adj = -retune_adj); 685 748 749 #ifdef FE_GET_EXTENDED_INFO 750 if (info.type == FE_DVB_S2) 751 { 752 if (ioctl(fd_frontend, FE_SET_FRONTEND2, ¶ms) < 0) 753 { 754 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 755 "Setting Frontend(2) tuning parameters failed." + ENO); 756 return false; 757 } 758 } else { 759 if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 760 { 761 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 762 "Setting Frontend tuning parameters failed." + ENO); 763 return false; 764 } 765 } 766 #else 686 767 if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 687 768 { 688 769 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + … … 690 771 691 772 return false; 692 773 } 774 #endif 693 775 694 776 // Extra delay to add for broken DVB drivers 695 777 if (tuning_delay) … … 806 888 static uint tuned_frequency(const DVBTuning &tuning, fe_type_t type, 807 889 fe_sec_tone_mode_t *p_tone) 808 890 { 891 #ifdef FE_GET_EXTENDED_INFO 892 if (FE_QPSK != type && FE_DVB_S2 != type) 893 return tuning.Frequency(); 894 #else 809 895 if (FE_QPSK != type) 810 896 return tuning.Frequency(); 897 #endif 811 898 812 899 uint freq = tuning.Frequency(); 813 900 bool tone = freq >= tuning.lnb_lof_switch; -
libs/libmythtv/scanwizard.cpp
39 39 : paneOFDM(new OFDMPane()), paneQPSK(new QPSKPane()), 40 40 paneATSC(new ATSCPane()), paneQAM(new QAMPane()), 41 41 paneSingle(new STPane()), 42 #ifdef FE_GET_EXTENDED_INFO 43 paneDVBS2(new DVBS2Pane()), 44 #endif 42 45 nVideoDev(-1), nCardType(CardUtil::ERROR_PROBE), 43 46 nCaptureCard(-1), 44 47 configPane(new ScanWizardScanType(this, sourceid)),