Ticket #5882: s2api.riky.r0.patch

File s2api.riky.r0.patch, 96.0 KB (added by ferrarir_AT_libero.it, 3 years ago)

refactored Alan's patch (r2) to match current scanwizardhelper.cpp

  • libs/libmythtv/firewirechannel.cpp

     
    6060 
    6161    // Fetch tuning data from the database. 
    6262    QString tvformat, modulation, freqtable, freqid, dtv_si_std; 
     63    QString msystem, rolloff; 
    6364    int finetune; 
    6465    uint64_t frequency; 
    6566    int mpeg_prog_num; 
     
    7071        tvformat, modulation, freqtable, freqid, 
    7172        finetune, frequency, 
    7273        dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 
     74        msystem, rolloff, 
    7375        mplexid, commfree)) 
    7476    { 
    7577        VERBOSE(VB_IMPORTANT, loc + " " + QString( 
  • libs/libmythtv/dtvconfparserhelpers.h

     
    7474  public: 
    7575    enum 
    7676    { 
    77         kTunerTypeQPSK    = 0, 
    78         kTunerTypeQAM     = 1, 
    79         kTunerTypeOFDM    = 2, 
     77        kTunerTypeQPSK    = 0,         // DVB-S 
     78        kTunerTypeQAM     = 1,         // DVB-C 
     79        kTunerTypeOFDM    = 2,         // DVB-T 
    8080        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 
    8582        kTunerTypeUnknown = (1 << 31), 
    8683    }; 
    8784 
     
    9592    { 
    9693        return ((kTunerTypeQPSK   == value) || 
    9794                (kTunerTypeQAM    == value) || 
    98                 (kTunerTypeDVB_S  == value) || 
    99                 (kTunerTypeDVB_C  == value) || 
    10095                (kTunerTypeDVB_S2 == value)); 
    10196    } 
    10297 
     
    191186    static const DTVParamHelperStruct confTable[]; 
    192187    static const DTVParamHelperStruct vdrTable[]; 
    193188    static const DTVParamHelperStruct parseTable[]; 
    194     static const uint kDBStrCnt = 10; 
     189    static const uint kDBStrCnt = 12; 
    195190    static const char *dbStr[kDBStrCnt]; 
    196191 
    197192  public: 
     
    207202        kFEC_7_8, 
    208203        kFEC_8_9, 
    209204        kFECAuto, 
     205        kFEC_3_5, 
     206        kFEC_9_10, 
    210207    }; 
    211208 
    212209    DTVCodeRate(int _default = kFECAuto) : DTVParamHelper(_default) { } 
     
    245242        kModulationQAMAuto = 6, 
    246243        kModulation8VSB    = 7, 
    247244        kModulation16VSB   = 8, 
    248         kModulation2VSB    = 9, 
    249         kModulation4VSB    = 10, 
    250         kModulationBPSK    = 11, 
    251         kModulation16APSK  = 12, 
    252         kModulation32APSK  = 13, 
    253         kModulation8PSK    = 14, 
    254         kModulation16PSK   = 15, 
     245        kModulation8PSK    = 9, 
     246        kModulation16APSK  = 10, 
     247        kModulation32APSK  = 11, 
     248        kModulationDQPSK   = 12, 
     249        kModulation2VSB    = 13, 
     250        kModulation4VSB    = 14, 
     251        kModulationBPSK    = 15, 
    255252        kModulationAnalog  = 16, /* for analog channel scanner */ 
     253        kModulation16PSK   = 17, 
    256254    }; 
    257255 
    258256    DTVModulation(int _default = kModulationQAMAuto) 
     
    414412        { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 
    415413}; 
    416414 
     415class 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 
     447class 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 
     481class 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 
    417510#endif // _DTVCONFPARSERHELPERS_H_ 
  • libs/libmythtv/channelscan/channelimporter.cpp

     
    468468 
    469469    bool is_dvbs = 
    470470        (DTVTunerType::kTunerTypeQPSK   == tuner_type) || 
    471         (DTVTunerType::kTunerTypeDVB_S  == tuner_type) || 
    472471        (DTVTunerType::kTunerTypeDVB_S2 == tuner_type); 
    473472 
    474473    uint freq_mult = (is_dvbs) ? 1 : 1000; 
  • libs/libmythtv/channelscan/scaninfo.cpp

     
    7676        "       hp_code_rate,      lp_code_rate,   modulation, " 
    7777        "       transmission_mode, guard_interval, hierarchy, " 
    7878        "       modulation,        bandwidth,      sistandard, " 
    79         "       tuner_type,        transportid " 
     79        "       tuner_type,        transportid, " 
     80        "       msystem,           rolloff " 
    8081        "FROM channelscan_dtv_multiplex " 
    8182        "WHERE scanid = :SCANID"); 
    8283    query.bindValue(":SCANID", scanid); 
     
    9798            query.value(6).toString(),  query.value(7).toString(), 
    9899            query.value(8).toString(),  query.value(9).toString(), 
    99100            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()); 
    101103 
    102104        query2.prepare( 
    103105            "SELECT " 
  • libs/libmythtv/channelscan/channelscan_sm.cpp

     
    14391439            startChan["coderate_hp"],    startChan["coderate_lp"], 
    14401440            startChan["constellation"],  startChan["trans_mode"], 
    14411441            startChan["guard_interval"], startChan["hierarchy"], 
    1442             startChan["modulation"],     startChan["bandwidth"]); 
     1442            startChan["modulation"],     startChan["bandwidth"], 
     1443            startChan["msystem"],        startChan["rolloff"]); 
    14431444    } 
    14441445 
    14451446    if (ok) 
  • libs/libmythtv/channelscan/modulationsetting.h

     
    5858    { 
    5959        addSelection(QObject::tr("Auto"),"auto",true); 
    6060        addSelection("QPSK","qpsk"); 
    61 #ifdef FE_GET_EXTENDED_INFO 
    6261        addSelection("8PSK","8psk"); 
    63 #endif 
    6462        addSelection("QAM 16","qam_16"); 
    6563        addSelection("QAM 32","qam_32"); 
    6664        addSelection("QAM 64","qam_64"); 
  • libs/libmythtv/channelscan/channelscanmiscsettings.h

     
    146146        addSelection("1/2"); 
    147147        addSelection("2/3"); 
    148148        addSelection("3/4"); 
     149        addSelection("3/5"); 
    149150        addSelection("4/5"); 
    150151        addSelection("5/6"); 
    151152        addSelection("6/7"); 
    152153        addSelection("7/8"); 
    153154        addSelection("8/9"); 
     155        addSelection("9/10"); 
    154156    } 
    155157}; 
    156158 
     
    165167    } 
    166168}; 
    167169 
     170class 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 
     183class 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 
    168202class ScanCodeRateLP: public ScanFecSetting, public TransientStorage 
    169203{ 
    170204  public: 
  • libs/libmythtv/channelscan/channelscanner.cpp

     
    143143    } 
    144144    else if ((ScanTypeSetting::NITAddScan_DVBT == scantype) || 
    145145             (ScanTypeSetting::NITAddScan_DVBS == scantype) || 
     146             (ScanTypeSetting::NITAddScan_DVBS2 == scantype) || 
    146147             (ScanTypeSetting::NITAddScan_DVBC == scantype)) 
    147148    { 
    148149        VERBOSE(VB_SIPARSER, LOC + "ScanTransports()"); 
     
    219220    DTVConfParser::cardtype_t type = DTVConfParser::UNKNOWN; 
    220221    type = (CardUtil::DVBT == cardtype) ? DTVConfParser::OFDM : type; 
    221222    type = (CardUtil::QPSK == cardtype) ? DTVConfParser::QPSK : type; 
     223    type = (CardUtil::DVBS2 == cardtype) ? DTVConfParser::DVBS2 : type; 
    222224    type = (CardUtil::DVBC == cardtype) ? DTVConfParser::QAM  : type; 
    223225    type = ((CardUtil::ATSC == cardtype) || 
    224226            (CardUtil::HDHOMERUN == cardtype)) ? DTVConfParser::ATSC : type; 
     
    302304        QString sub_type = CardUtil::ProbeDVBType(device.toUInt()).upper(); 
    303305        bool need_nit = (("QAM"  == sub_type) || 
    304306                         ("QPSK" == sub_type) || 
     307                         ("DVB_S2" == sub_type) || 
    305308                         ("OFDM" == sub_type)); 
    306309 
    307310        // Ugh, Some DVB drivers don't fully support signal monitoring... 
  • libs/libmythtv/channelscan/panedvbs2.h

     
    2222        left->addChild( pfrequency  = new ScanFrequency()); 
    2323        left->addChild( ppolarity   = new ScanPolarity()); 
    2424        left->addChild( psymbolrate = new ScanSymbolRate()); 
    25         right->addChild(pfec        = new ScanFec()); 
     25        left->addChild( pfec        = new ScanFec()); 
     26        right->addChild(pmsystem    = new ScanModulationSystem()); 
    2627        right->addChild(pmodulation = new ScanModulation()); 
    2728        right->addChild(pinversion  = new ScanInversion()); 
     29        right->addChild(prolloff    = new ScanRollOff()); 
    2830        addChild(left); 
    2931        addChild(right);      
    3032    } 
     
    3537    QString fec(void)        const { return pfec->getValue();        } 
    3638    QString polarity(void)   const { return ppolarity->getValue();   } 
    3739    QString modulation(void) const { return pmodulation->getValue(); } 
     40    QString rolloff(void)    const { return prolloff->getValue();    } 
     41    QString msystem(void)    const { return pmsystem->getValue();    } 
    3842 
    3943  protected: 
    4044    ScanFrequency  *pfrequency; 
     
    4347    ScanFec        *pfec; 
    4448    ScanPolarity   *ppolarity; 
    4549    ScanModulation *pmodulation; 
     50    ScanRollOff    *prolloff; 
     51    ScanModulationSystem    *pmsystem; 
    4652}; 
    4753 
    4854#endif // _PANE_DVBS2_H_ 
  • libs/libmythtv/channelscan/scanwizardconfig.cpp

     
    133133        addSelection(tr("Import channels.conf"), 
    134134                     QString::number(DVBUtilsImport)); 
    135135        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; 
    136142    case CardUtil::QAM: 
    137143        addSelection(tr("Full Scan (Tuned)"), 
    138144                     QString::number(NITAddScan_DVBC)); 
     
    329335        startChan["modulation"] = "qpsk"; 
    330336        startChan["polarity"]   = pane->polarity(); 
    331337    } 
     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    } 
    332351    else if (ScanTypeSetting::NITAddScan_DVBC == st) 
    333352    { 
    334353        const PaneDVBC *pane = paneDVBC; 
  • libs/libmythtv/dtvconfparserhelpers.cpp

     
    4747    dtv_tt_canonical_str[kTunerTypeQAM]     = "QAM"; 
    4848    dtv_tt_canonical_str[kTunerTypeOFDM]    = "OFDM"; 
    4949    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"; 
    5350    dtv_tt_canonical_str[kTunerTypeDVB_S2]  = "DVB_S2"; 
    5451    dtv_tt_canonical_str[kTunerTypeUnknown] = "UNKNOWN"; 
    5552} 
     
    6966    { "QAM",     kTunerTypeQAM     }, 
    7067    { "OFDM",    kTunerTypeOFDM    }, 
    7168    { "ATSC",    kTunerTypeATSC    }, 
    72     { "DVB_S",   kTunerTypeDVB_S   }, 
    73     { "DVB_C",   kTunerTypeDVB_C   }, 
    74     { "DVB_T",   kTunerTypeDVB_T   }, 
    7569    { "DVB_S2",  kTunerTypeDVB_S2  }, 
    7670    { "UNKNOWN", kTunerTypeUnknown }, 
    7771    { NULL,      kTunerTypeUnknown }, 
     
    154148    { "FEC_6_7",  kFEC_6_7  }, 
    155149    { "FEC_7_8",  kFEC_7_8  }, 
    156150    { "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  }, 
    158154    { NULL,       kFECAuto }, 
    159155}; 
    160156 
     
    164160    { "12",  kFEC_1_2 }, 
    165161    { "23",  kFEC_2_3 }, 
    166162    { "34",  kFEC_3_4 }, 
     163    { "35",  kFEC_3_5 }, 
    167164    { "45",  kFEC_4_5 }, 
    168165    { "56",  kFEC_5_6 }, 
    169166    { "67",  kFEC_6_7 }, 
    170167    { "78",  kFEC_7_8 }, 
    171168    { "89",  kFEC_8_9 }, 
     169    { "910", kFEC_9_10}, 
    172170    { "0",   kFECNone }, 
    173171    { NULL,  kFECAuto } 
    174172}; 
     
    184182    { "6/7",  kFEC_6_7 }, 
    185183    { "7/8",  kFEC_7_8 }, 
    186184    { "8/9",  kFEC_8_9 }, 
     185    { "3/5",  kFEC_3_5 }, 
     186    { "9/10", kFEC_9_10}, 
    187187    { "none", kFECNone }, 
    188188    { NULL,   kFECAuto } 
    189189}; 
     
    199199     "6/7",  ///< kFEC_6_7 
    200200     "7/8",  ///< kFEC_7_8 
    201201     "8/9",  ///< kFEC_8_9 
    202      "auto"  ///< kFECAuto 
     202     "3/5",  ///< kFEC_3_5 
     203     "9/10", ///< kFEC_9_10 
     204     "auto", ///< kFECAuto 
    203205}; 
    204206 
    205207const DTVParamHelperStruct DTVModulation::confTable[] = 
     
    220222   { "32APSK",   kModulation32APSK  }, 
    221223   { "8PSK",     kModulation8PSK    }, 
    222224   { "16PSK",    kModulation16PSK   }, 
     225   { "DQPSK",    kModulationDQPSK   }, 
    223226   { "analog",   kModulationAnalog  }, 
    224227   { NULL,       kModulationQAMAuto }, 
    225228}; 
     
    232235   { "64",  kModulationQAM64   }, 
    233236   { "128", kModulationQAM128  }, 
    234237   { "256", kModulationQAM256  }, 
     238   { "2",   kModulationQPSK    }, 
     239   { "10",  kModulation8VSB    }, 
     240   { "11",  kModulation16VSB   }, 
     241   { "6",   kModulation16APSK  }, 
     242   { "7",   kModulation32APSK  }, 
     243   { "5",   kModulation8PSK    }, 
    235244   { "0",   kModulationQPSK    }, 
    236245   { NULL,  kModulationQAMAuto }, 
    237246}; 
     
    254263   { "32apsk",   kModulation32APSK  }, 
    255264   { "8psk",     kModulation8PSK    }, 
    256265   { "16psk",    kModulation16PSK   }, 
     266   { "dqpsk",    kModulationDQPSK   }, 
    257267   // alternates 
    258268   { "a",        kModulationQAMAuto }, 
    259269   { "qam_auto", kModulationQAMAuto }, 
     
    272282   { "32-apsk",  kModulation32APSK  }, 
    273283   { "8-psk",    kModulation8PSK    }, 
    274284   { "16-psk",   kModulation16PSK   }, 
     285   { "dq-psk",   kModulationDQPSK   }, 
    275286   { NULL,       kModulationQAMAuto }, 
    276287}; 
    277288 
     
    293304    "32apsk",  ///< kModulation32APSK 
    294305    "8psk",    ///< kModulation8PSK 
    295306    "16psk",   ///< kModulation16PSK 
     307    "dqpsk",   ///< kModulationDQPSK 
    296308}; 
    297309 
    298310const DTVParamHelperStruct DTVTransmitMode::confTable[] = 
     
    420432   "r", ///< kPolarityRight 
    421433   "l"  ///< kPolarityLeft 
    422434}; 
     435 
     436const DTVParamHelperStruct DTVModulationSystem::confTable[] = 
     437{ 
     438   { "SYS_DVBS",  kModulationSystemDVBS  }, 
     439   { "SYS_DVBS2", kModulationSystemDVBS2 }, 
     440   { NULL,        kModulationSystemDVBS  }, 
     441}; 
     442 
     443const DTVParamHelperStruct DTVModulationSystem::vdrTable[] = 
     444{ 
     445   { "0",  kModulationSystemDVBS  }, 
     446   { "1",  kModulationSystemDVBS2 }, 
     447   { NULL, kModulationSystemDVBS  }, 
     448}; 
     449 
     450const DTVParamHelperStruct DTVModulationSystem::parseTable[] = 
     451{ 
     452   { "dvbs2", kModulationSystemDVBS2 }, 
     453   { "dvbs",  kModulationSystemDVBS  }, 
     454   { NULL,    kModulationSystemDVBS  }, 
     455}; 
     456 
     457const char *DTVModulationSystem::dbStr[DTVModulationSystem::kDBStrCnt] = 
     458{ 
     459    "dvbs",  ///< kModulationSystemDVBS 
     460    "dvbs2", ///< kModulationSystemDVBS2 
     461}; 
     462 
     463const 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 
     472const DTVParamHelperStruct DTVRollOff::vdrTable[] = 
     473{ 
     474   { "35",   kRollOff35   }, 
     475   { "20",   kRollOff20   }, 
     476   { "25",   kRollOff25   }, 
     477   { "0",    kRollOffAuto }, 
     478   { NULL,   kRollOff35   }, 
     479}; 
     480 
     481const DTVParamHelperStruct DTVRollOff::parseTable[] = 
     482{ 
     483   { "0.35",   kRollOff35   }, 
     484   { "0.20",   kRollOff20   }, 
     485   { "0.25",   kRollOff25   }, 
     486   { "auto",   kRollOffAuto }, 
     487   { NULL,     kRollOff35   }, 
     488}; 
     489 
     490const 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

     
    112112        { 
    113113            if ((type == OFDM) && (str == "T")) 
    114114                ok &= ParseVDR(list, channelNo); 
    115             else if ((type == QPSK) && (str == "S")) 
     115            else if (((type == QPSK) || (type == DVBS2)) && (str == "S")) 
    116116                ok &= ParseVDR(list, channelNo); 
    117117            else if ((type == QAM) && (str == "C")) 
    118118                ok &= ParseVDR(list, channelNo); 
     
    121121            ok &= ParseConfOFDM(list); 
    122122        else if (type == ATSC) 
    123123            ok &= ParseConfATSC(list); 
    124         else if (type == QPSK) 
     124        else if ((type == QPSK) || (type == DVBS2)) 
    125125            ok &= ParseConfQPSK(list); 
    126126        else if (type == QAM) 
    127127            ok &= ParseConfQAM(list); 
     
    213213    PARSE_SKIP(unknown); 
    214214    PARSE_SKIP(unknown); 
    215215    PARSE_UINT(chan.serviceid); 
     216    mux.modulation = DTVModulation::kModulationQPSK; 
    216217 
    217218    AddChannel(mux, chan); 
    218219 
     
    274275            case 'R': 
    275276            case 'L': 
    276277                mux.polarity.ParseVDR(ori); 
     278            case 'S': 
     279                mux.msystem.ParseVDR(params); 
     280            case 'O': 
     281                mux.rolloff.ParseVDR(params); 
    277282                break; 
    278283            default: 
    279284                return false; 
  • libs/libmythtv/dtvmultiplex.h

     
    4949        const QString &symbol_rate,  const QString &fec_inner, 
    5050        const QString &modulation,   const QString &polarity); 
    5151 
     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 
    5258    bool ParseTuningParams( 
    5359        DTVTunerType type, 
    5460        QString frequency,    QString inversion,      QString symbolrate, 
    5561        QString fec,          QString polarity, 
    5662        QString hp_code_rate, QString lp_code_rate,   QString constellation, 
    5763        QString trans_mode,   QString guard_interval, QString hierarchy, 
    58         QString modulation,   QString bandwidth); 
     64        QString modulation,   QString bandwidth, 
     65        QString msystem,      QString rolloff); 
    5966 
    6067    QString toString() const; 
    6168 
    6269  public: 
    6370    // 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; 
    7786 
    7887    // Optional additional info 
    7988    uint             mplex; 
  • libs/libmythtv/channelutil.h

     
    6767        signed char trans_mode, 
    6868        QString     inner_FEC,    QString     constellation, 
    6969        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); 
    7172 
    7273    static uint    CreateMultiplex(uint sourceid, const DTVMultiplex&, 
    7374                                   int transport_id, int network_id); 
     
    8586    static int     GetBetterMplexID(int current_mplexid, 
    8687                                    int transport_id, int network_id); 
    8788 
    88     static bool    GetTuningParams(uint mplexid, 
     89    static bool    GetTuningParams(uint      mplexid, 
    8990                                   QString  &modulation, 
    9091                                   uint64_t &frequency, 
    9192                                   uint     &dvb_transportid, 
    9293                                   uint     &dvb_networkid, 
     94                                   QString  &dvb_msystem,  
     95                                   QString  &dvb_rolloff, 
    9396                                   QString  &si_std); 
    9497 
    9598    static bool    GetATSCChannel(uint sourceid, const QString &channum, 
     
    156159        QString &tvformat,        QString       &modulation, 
    157160        QString &freqtable,       QString       &freqid, 
    158161        int     &finetune,        uint64_t      &frequency, 
    159         QString &dtv_si_std,      int     &mpeg_prog_num, 
     162        QString &dtv_si_std,      int           &mpeg_prog_num, 
    160163        uint    &atsc_major,      uint          &atsc_minor, 
    161164        uint    &dvb_transportid, uint          &dvb_networkid, 
     165        QString &dvb_msystem,     QString       &dvb_rolloff,  
    162166        uint    &mplexid,         bool          &commfree); 
    163167    static bool    GetChannelSettings(int chanid, bool &useonairguide, 
    164168                                    bool &hidden); 
  • libs/libmythtv/cardutil.h

     
    5454        HDHOMERUN = 10, 
    5555        FREEBOX   = 11, 
    5656        HDPVR     = 12, 
     57        DVBS2     = 13, 
    5758    }; 
    5859 
    5960    static enum CARD_TYPES toCardType(const QString &name) 
     
    8485            return FREEBOX; 
    8586        if ("HDPVR" == name) 
    8687            return HDPVR; 
     88        if ("DVB_S2" == name) 
     89            return DVBS2; 
    8790        return ERROR_UNKNOWN; 
    8891    } 
    8992 
  • libs/libmythtv/scanwizardhelpers.h

     
    243243        // seen in the Network Information Tables to the scan. 
    244244        NITAddScan_OFDM, 
    245245        NITAddScan_QPSK, 
     246        NITAddScan_DVBS2, 
    246247        NITAddScan_QAM, 
    247248        // Scan of all transports already in the database 
    248249        FullTransportScan, 
     
    274275    QString GetATSCFormat(const QString&)    const; 
    275276    QString GetFrequencyStandard(void)       const; 
    276277    QString GetModulation(void)              const; 
     278    QString GetRollOff(void)                 const; 
    277279    QString GetFrequencyTable(void)          const; 
    278280    bool    DoIgnoreSignalTimeout(void)      const; 
    279281    QString GetFilename(void)                const; 
     
    510512    { 
    511513        addSelection(QObject::tr("Auto"),"auto",true); 
    512514        addSelection("QPSK","qpsk"); 
    513 #ifdef FE_GET_EXTENDED_INFO 
    514515        addSelection("8PSK","8psk"); 
    515 #endif 
    516516        addSelection("QAM 16","qam_16"); 
    517517        addSelection("QAM 32","qam_32"); 
    518518        addSelection("QAM 64","qam_64"); 
     
    531531    }; 
    532532}; 
    533533 
     534class 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 
     544class 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 
     554class 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 
     566class 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 
    534576class ScanConstellation: public ScanModulationSetting, 
    535577                         public TransientStorage 
    536578{ 
     
    552594        addSelection("1/2"); 
    553595        addSelection("2/3"); 
    554596        addSelection("3/4"); 
     597        addSelection("3/5"); 
    555598        addSelection("4/5"); 
    556599        addSelection("5/6"); 
    557600        addSelection("6/7"); 
    558601        addSelection("7/8"); 
    559602        addSelection("8/9"); 
     603        addSelection("9/10"); 
    560604    } 
    561605}; 
    562606 
     
    692736        left->addChild( pfrequency  = new ScanFrequency()); 
    693737        left->addChild( ppolarity   = new ScanPolarity()); 
    694738        left->addChild( psymbolrate = new ScanSymbolRate()); 
    695         right->addChild(pfec        = new ScanFec()); 
     739        left->addChild( pfec        = new ScanFec()); 
     740        right->addChild(pmsystem    = new ScanModulationSystem()); 
    696741        right->addChild(pmodulation = new ScanModulation()); 
    697742        right->addChild(pinversion  = new ScanInversion()); 
     743        right->addChild(prolloff    = new ScanRollOff()); 
    698744        addChild(left); 
    699745        addChild(right); 
    700746    } 
     
    704750    QString inversion(void)  const { return pinversion->getValue();  } 
    705751    QString fec(void)        const { return pfec->getValue();        } 
    706752    QString polarity(void)   const { return ppolarity->getValue();   } 
     753    QString msystem(void)    const { return pmsystem->getValue();    } 
    707754    QString modulation(void) const { return pmodulation->getValue(); } 
     755    QString rolloff(void)    const { return prolloff->getValue();    } 
    708756 
    709757  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; 
    716766}; 
    717767 
    718768class QPSKPane : public HorizontalConfigurationGroup 
  • libs/libmythtv/scanwizardscanner.cpp

     
    362362 
    363363        ok = scanner->ScanTransports(sourceid, freq_std, mod, tbl); 
    364364    } 
    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)) 
    368369    { 
    369370        VERBOSE(VB_SIPARSER, LOC + "ScanTransports()"); 
    370371 
     
    440441    channels.clear(); 
    441442 
    442443    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; 
    446448    type = ((CardUtil::ATSC == cardtype)||(CardUtil::HDHOMERUN == cardtype)) ? 
    447449        DTVConfParser::ATSC : type; 
    448450 
     
    488490    if ("DVB" == card_type) 
    489491    { 
    490492        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)); 
    494497 
    495498        // Ugh, Some DVB drivers don't fully support signal monitoring... 
    496499        if ((ScanTypeSetting::TransportScan     == scantype) || 
  • libs/libmythtv/hdhrchannel.cpp

     
    291291 
    292292    // Fetch tuning data from the database. 
    293293    QString tvformat, modulation, freqtable, freqid, si_std; 
     294    QString msystem, rolloff; 
    294295    int finetune; 
    295296    uint64_t frequency; 
    296297    int mpeg_prog_num; 
     
    301302        tvformat, modulation, freqtable, freqid, 
    302303        finetune, frequency, 
    303304        si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 
     305        msystem, rolloff, 
    304306        mplexid, commfree)) 
    305307    { 
    306308        return false; 
     
    369371    uint64_t frequency; 
    370372    uint     transportid; 
    371373    uint     dvb_networkid; 
    372  
     374    QString  dvb_msystem;  
     375    QString  dvb_rolloff; 
     376     
    373377    if (!ChannelUtil::GetTuningParams( 
    374378            mplexid, modulation, frequency, 
    375             transportid, dvb_networkid, si_std)) 
     379            transportid, dvb_networkid,  
     380            dvb_msystem, dvb_rolloff, si_std)) 
    376381    { 
    377382        VERBOSE(VB_IMPORTANT, LOC_ERR + "TuneMultiplex(): " + 
    378383                QString("Could not find tuning parameters for multiplex %1.") 
  • libs/libmythtv/siscan.cpp

     
    901901    nextIt = transport_scan_items_it_t( scanTransports.end() ); 
    902902 
    903903    DTVMultiplex tuning; 
    904  
     904    DTVModulation modulation; 
     905    DTVModulationSystem msystem; 
    905906    DTVTunerType type; 
    906907 
    907908    if (std == "dvb") 
    908909    { 
    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); 
    910938    } 
    911939    else if (std == "atsc") 
    912940    { 
     
    924952            startChan["coderate_hp"],    startChan["coderate_lp"], 
    925953            startChan["constellation"],  startChan["trans_mode"], 
    926954            startChan["guard_interval"], startChan["hierarchy"], 
    927             startChan["modulation"],     startChan["bandwidth"]); 
     955            startChan["modulation"],     startChan["bandwidth"], 
     956            startChan["msystem"],        startChan["rolloff"]); 
    928957    } 
    929958 
    930959    if (ok) 
     
    15641593    const uint transportid, const uint networkid) 
    15651594{ 
    15661595    uint64_t    db_freq; 
    1567     QString     tmp_modulation; 
     1596    QString     tmp_modulation, tmp_msystem, tmp_rolloff; 
    15681597    QString     tmp_si_std; 
    15691598    uint        tmp_transportid, tmp_networkid; 
    15701599    int         mplexid; 
     
    15781607 
    15791608    if (!ChannelUtil::GetTuningParams( 
    15801609            (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)) 
    15821611    { 
    15831612        return tuning_freq; 
    15841613    } 
  • libs/libmythtv/dtvconfparser.h

     
    8080{ 
    8181  public: 
    8282    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 }; 
    8484 
    8585    DTVConfParser(enum cardtype_t _type, uint sourceid, const QString &_file); 
    8686    virtual ~DTVConfParser() { } 
  • libs/libmythtv/channelbase.cpp

     
    190190 
    191191    // Fetch tuning data from the database. 
    192192    QString tvformat, modulation, freqtable, freqid, dtv_si_std; 
     193    QString msystem, rolloff;  
    193194    int finetune; 
    194195    uint64_t frequency; 
    195196    int mpeg_prog_num; 
     
    201202        tvformat, modulation, freqtable, freqid, 
    202203        finetune, frequency, 
    203204        dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 
     205        msystem, rolloff, 
    204206        mplexid, commfree)) 
    205207    { 
    206208        VERBOSE(VB_IMPORTANT, loc + " " + QString( 
  • libs/libmythtv/dvbchannel.h

     
    117117    QString           frontend_name; 
    118118    DTVTunerType      card_type; 
    119119    uint64_t          capabilities; 
    120     uint64_t          ext_modulations; 
    121120    uint64_t          frequency_minimum; 
    122121    uint64_t          frequency_maximum; 
    123122    uint              symbol_rate_minimum; 
  • libs/libmythtv/channelutil.cpp

     
    7777        "WHERE sourceid     = :SOURCEID   " 
    7878        "  AND sistandard   = :SISTANDARD "; 
    7979 
    80     if (sistandard.toLower() != "dvb") 
     80    if (sistandard.toLower().left(3) != "dvb") 
    8181        qstr += "AND frequency    = :FREQUENCY   "; 
    8282    else 
    8383    { 
     
    9191    query.bindValue(":SOURCEID",          db_source_id); 
    9292    query.bindValue(":SISTANDARD",        sistandard); 
    9393 
    94     if (sistandard.toLower() != "dvb") 
     94    if (sistandard.toLower().left(3) != "dvb") 
    9595        query.bindValue(":FREQUENCY",     frequency); 
    9696    else 
    9797    { 
     
    121121    signed char trans_mode, 
    122122    QString     inner_FEC,     QString      constellation, 
    123123    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) 
    125126{ 
    126127    MSqlQuery query(MSqlQuery::InitCon()); 
    127128 
     
    135136        // DVB specific 
    136137        transport_id,  network_id); 
    137138 
    138     bool isDVB = (sistandard.toLower() == "dvb"); 
     139    bool isDVB = (sistandard.toLower().left(3) == "dvb"); 
    139140 
    140141    QString updateStr = 
    141142        "UPDATE dtv_multiplex " 
     
    165166        "lp_code_rate     = :LP_CODE_RATE, " : ""; 
    166167    updateStr += (!guard_interval.isNull()) ? 
    167168        "guard_interval   = :GUARD_INTERVAL, " : ""; 
     169    updateStr += (!msystem.isNull()) ? 
     170        "msystem          = :MSYSTEM, " : ""; 
     171    updateStr += (!rolloff.isNull()) ? 
     172        "rolloff          = :ROLLOFF, " : ""; 
    168173 
    169174    updateStr = updateStr.left(updateStr.length()-2) + " "; 
    170175 
     
    194199    insertStr += (!hp_code_rate.isNull())   ? "hp_code_rate, "      : ""; 
    195200    insertStr += (!lp_code_rate.isNull())   ? "lp_code_rate, "      : ""; 
    196201    insertStr += (!guard_interval.isNull()) ? "guard_interval, "    : ""; 
     202    insertStr += (!msystem.isNull())        ? "msystem, "           : ""; 
     203    insertStr += (!rolloff.isNull())        ? "rolloff, "           : ""; 
    197204    insertStr = insertStr.left(insertStr.length()-2) + ") "; 
    198205 
    199206    insertStr += 
     
    213220    insertStr += (!hp_code_rate.isNull())   ? ":HP_CODE_RATE, "     : ""; 
    214221    insertStr += (!lp_code_rate.isNull())   ? ":LP_CODE_RATE, "     : ""; 
    215222    insertStr += (!guard_interval.isNull()) ? ":GUARD_INTERVAL, "   : ""; 
     223    insertStr += (!msystem.isNull())        ? ":MSYSTEM, "          : ""; 
     224    insertStr += (!rolloff.isNull())        ? ":ROLLOFF, "          : ""; 
    216225    insertStr = insertStr.left(insertStr.length()-2) + ");"; 
    217226 
    218227    query.prepare((mplex) ? updateStr : insertStr); 
     
    254263        query.bindValue(":LP_CODE_RATE",  lp_code_rate); 
    255264    if (!guard_interval.isNull()) 
    256265        query.bindValue(":GUARD_INTERVAL",guard_interval); 
     266    if (!msystem.isNull()) 
     267        query.bindValue(":MSYSTEM",       msystem); 
     268    if (!rolloff.isNull()) 
     269        query.bindValue(":ROLLOFF",       rolloff); 
    257270 
    258271    if (!query.exec() || !query.isActive()) 
    259272    { 
     
    292305        { 
    293306            QString dummy_mod; 
    294307            QString dummy_sistd; 
     308            QString dummy_msystem; 
     309            QString dummy_rolloff; 
    295310            uint dummy_tsid, dummy_netid; 
    296311            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); 
    298315        } 
    299316 
    300317        mux = ChannelUtil::CreateMultiplex( 
     
    307324            cd.TransmissionModeString()[0].toAscii(), 
    308325            QString(),                         cd.ConstellationString(), 
    309326            cd.HierarchyString()[0].toAscii(), cd.CodeRateHPString(), 
    310             cd.CodeRateLPString(),             cd.GuardIntervalString()); 
     327            cd.CodeRateLPString(),             cd.GuardIntervalString(), 
     328            QString(),                         QString()); 
    311329 
    312330        if (mux) 
    313331            muxes.push_back(mux); 
     
    334352            -1, 
    335353            cd.FECInnerString(),  QString(), 
    336354            -1,                   QString(), 
    337             QString(),            QString()); 
     355            QString(),                   QString(), 
     356            cd.ModulationSystemString(), cd.RollOffString()); 
    338357 
    339358        if (mux) 
    340359            muxes.push_back(mux); 
     
    357376            -1, 
    358377            cd.FECInnerString(),  QString::null, 
    359378            -1,                   QString::null, 
     379            QString::null,        QString::null, 
    360380            QString::null,        QString::null); 
    361381 
    362382        if (mux) 
     
    377397        -1, 
    378398        QString::null,      QString::null, 
    379399        -1,                 QString::null, 
     400        QString::null,      QString::null, 
    380401        QString::null,      QString::null); 
    381402} 
    382403 
     
    390411    signed char trans_mode, 
    391412    QString     inner_FEC,    QString     constellation, 
    392413    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) 
    394416{ 
    395417    return insert_dtv_multiplex( 
    396418        sourceid,           sistandard, 
     
    402424        trans_mode, 
    403425        inner_FEC,          constellation, 
    404426        hierarchy,          hp_code_rate, 
    405         lp_code_rate,       guard_interval); 
     427        lp_code_rate,       guard_interval, 
     428        msystem,            rolloff); 
    406429} 
    407430 
    408431uint ChannelUtil::CreateMultiplex(uint sourceid, const DTVMultiplex &mux, 
     
    418441        mux.trans_mode.toChar().toAscii(), 
    419442        mux.fec.toString(),               mux.modulation.toString(), 
    420443        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()); 
    422446} 
    423447 
    424448 
     
    706730                                  uint64_t &frequency, 
    707731                                  uint     &dvb_transportid, 
    708732                                  uint     &dvb_networkid, 
     733                                  QString  &dvb_msystem,  
     734                                  QString  &dvb_rolloff, 
    709735                                  QString  &si_std) 
    710736{ 
    711737    if (!mplexid || (mplexid == 32767)) /* 32767 deals with old lineups */ 
     
    713739 
    714740    MSqlQuery query(MSqlQuery::InitCon()); 
    715741    query.prepare( 
    716         "SELECT transportid, networkid, frequency, modulation, sistandard " 
     742        "SELECT transportid, networkid, frequency, modulation, sistandard, msystem, rolloff " 
    717743        "FROM dtv_multiplex " 
    718744        "WHERE mplexid = :MPLEXID"); 
    719745    query.bindValue(":MPLEXID", mplexid); 
     
    732758    frequency       = (uint64_t) query.value(2).toDouble(); // Qt 3.1 compat 
    733759    modulation      = query.value(3).toString(); 
    734760    si_std          = query.value(4).toString(); 
    735  
     761    dvb_msystem     = query.value(5).toString();  
     762        dvb_rolloff     = query.value(6).toString();  
     763         
    736764    return true; 
    737765} 
    738766 
     
    14831511    QString &dtv_si_std,      int           &mpeg_prog_num, 
    14841512    uint    &atsc_major,      uint          &atsc_minor, 
    14851513    uint    &dvb_transportid, uint          &dvb_networkid, 
     1514    QString &dvb_msystem,     QString       &dvb_rolloff,  
    14861515    uint    &mplexid, 
    14871516    bool    &commfree) 
    14881517{ 
     
    14931522    mpeg_prog_num = -1; 
    14941523    atsc_major    = atsc_minor = mplexid = 0; 
    14951524    dvb_networkid = dvb_transportid = 0; 
     1525    dvb_msystem   = dvb_rolloff = QString::null; 
    14961526    commfree      = false; 
    14971527 
    14981528    MSqlQuery query(MSqlQuery::InitCon()); 
     
    15331563 
    15341564    if (!mplexid || (mplexid == 32767)) /* 32767 deals with old lineups */ 
    15351565        return true; 
    1536  
     1566   
    15371567    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); 
    15391570} 
    15401571 
    15411572bool ChannelUtil::GetChannelSettings(int chanid, bool &useonairguide, 
  • libs/libmythtv/mpeg/dvbdescriptors.h

     
    685685    // FEC_inner                4  12.4 
    686686    enum 
    687687    { 
    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, 
    695698    }; 
    696699    uint FECInner() const { return _data[12] & 0xf; } 
    697700    QString FECInnerString() const { return coderate_inner(FECInner()); } 
     
    745748    bool IsLinearPolarization()   const { return !((_data[8]>>6)&0x1); } 
    746749    bool IsHorizontalLeftPolarization() const { return (_data[8]>>5)&0x1; } 
    747750    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 
    749759    enum 
    750760    { 
     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    { 
    751774        kModulationQPSK_NS = 0x0, // Non standard QPSK for Bell ExpressVu 
    752775        kModulationQPSK   = 0x1, 
    753776        kModulation8PSK   = 0x2, 
    754777        kModulationQAM16  = 0x3, 
    755778    }; 
    756     uint Modulation() const { return _data[8]&0x1f; } 
     779    uint Modulation() const { return _data[8]&0x3; } 
    757780    QString ModulationString() const 
    758781    { 
    759782        static QString ms[] = { "qpsk", "qpsk", "8psk", "qam_16" }; 
     
    773796    // FEC_inner                4  12.4 
    774797    enum 
    775798    { 
    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, 
    783810    }; 
    784811    uint FECInner() const { return _data[12] & 0xf; } 
    785812    QString FECInnerString() const { return coderate_inner(FECInner()); } 
     
    17651792        case 0x3:  return "3/4"; 
    17661793        case 0x4:  return "5/6"; 
    17671794        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"; 
    17691799        case 0xf:  return "none"; 
    17701800        default:   return "auto"; // not actually defined in spec 
    17711801    } 
  • libs/libmythtv/mpeg/dvbdescriptors.cpp

     
    369369    QString str = QString("SatelliteDeliverySystemDescriptor: "); 
    370370 
    371371    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()) 
    373374        .arg(ModulationString()) 
     375        .arg(RollOffString()) 
    374376        .arg(SymbolRateHz()) 
    375377        .arg(FECInnerString()) 
    376378        .arg(OrbitalPositionString()) 
  • libs/libmythtv/v4lchannel.cpp

     
    453453 
    454454    // Fetch tuning data from the database. 
    455455    QString tvformat, modulation, freqtable, freqid, dtv_si_std; 
     456    QString msystem, rolloff; 
    456457    int finetune; 
    457458    uint64_t frequency; 
    458459    int mpeg_prog_num; 
     
    463464        tvformat, modulation, freqtable, freqid, 
    464465        finetune, frequency, 
    465466        dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 
     467        msystem, rolloff,  
    466468        mplexid, commfree)) 
    467469    { 
    468470        return false; 
     
    738740    uint64_t frequency; 
    739741    uint     transportid; 
    740742    uint     dvb_networkid; 
    741  
     743    QString  dvb_msystem;  
     744    QString  dvb_rolloff; 
     745     
    742746    if (!ChannelUtil::GetTuningParams( 
    743747            mplexid, modulation, frequency, 
    744             transportid, dvb_networkid, si_std)) 
     748            transportid, dvb_networkid,  
     749            dvb_msystem, dvb_rolloff, si_std)) 
    745750    { 
    746751        VERBOSE(VB_IMPORTANT, LOC_ERR + "TuneMultiplex(): " + 
    747752                QString("Could not find tuning parameters for multiplex %1.") 
  • libs/libmythtv/dvbtypes.h

     
    2020#include <linux/dvb/dmx.h> 
    2121 
    2222#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!" 
    2424#endif 
    2525 
    2626#ifndef DVB_API_VERSION_MINOR 
    2727#    define DVB_API_VERSION_MINOR 0 
    2828#endif 
    2929 
     30#if (DVB_API_VERSION == 5) 
     31#    define USE_DVB_V5 
     32#endif 
     33 
    3034#if ((DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR >= 1) || (DVB_API_VERSION > 3)) 
    3135#    define USE_ATSC 
    3236#else 
     
    3943#    define VSB_16        (fe_modulation)(QAM_AUTO+2) 
    4044#endif 
    4145 
    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 
    4747 
    4848class QString; 
    4949QString toString(fe_status); 
  • libs/libmythtv/dvbchannel.cpp

     
    4949 
    5050static void drain_dvb_events(int fd); 
    5151static bool wait_for_backend(int fd, int timeout_ms); 
     52 
    5253static struct dvb_fe_params dtvmultiplex_to_dvbparams( 
    5354    DTVTunerType, const DTVMultiplex&); 
    5455static DTVMultiplex dvbparams_to_dtvmultiplex( 
    5556    DTVTunerType, const dvb_fe_params&); 
    5657 
     58#ifdef USE_DVB_V5 
     59static bool dtvmultiplex_to_dtvproperties( 
     60    DTVTunerType, const DTVMultiplex&, struct dtv_properties*, bool do_tune); 
     61static bool dtvmultiplex_to_dtvproperties( 
     62    DTVTunerType, const DTVMultiplex&, struct dtv_properties*); 
     63static DTVMultiplex dtvproperties_to_dtvmultiplex( 
     64    DTVTunerType, const dtv_properties&); 
     65#endif 
     66 
    5767#define LOC QString("DVBChan(%1:%2): ").arg(GetCardID()).arg(device) 
    5868#define LOC_WARN QString("DVBChan(%1:%2) Warning: ") \ 
    5969                 .arg(GetCardID()).arg(device) 
     
    167177        frontend_name       = master->frontend_name; 
    168178        card_type           = master->card_type; 
    169179        capabilities        = master->capabilities; 
    170         ext_modulations     = master->ext_modulations; 
    171180        frequency_minimum   = master->frequency_minimum; 
    172181        frequency_maximum   = master->frequency_maximum; 
    173182        symbol_rate_minimum = master->symbol_rate_minimum; 
     
    210219        return false; 
    211220    } 
    212221 
    213 #ifdef FE_GET_EXTENDED_INFO 
    214     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 #endif 
    255  
    256222    frontend_name       = info.name; 
    257     card_type           = info.type; 
    258223    capabilities        = info.caps; 
    259224    frequency_minimum   = info.frequency_min; 
    260225    frequency_maximum   = info.frequency_max; 
    261226    symbol_rate_minimum = info.symbol_rate_min; 
    262227    symbol_rate_maximum = info.symbol_rate_max; 
     228    card_type.Parse(CardUtil::ProbeDVBType(device)); 
    263229 
    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)); 
    266232 
    267233    // Turn on the power to the LNB 
    268234    if (card_type == DTVTunerType::kTunerTypeQPSK || 
     
    309275bool DVBChannel::TuneMultiplex(uint mplexid, QString inputname) 
    310276{ 
    311277    DTVMultiplex tuning; 
    312     if (!tuning.FillFromDB(card_type, mplexid)) 
     278    bool ok = true; 
     279    ok = tuning.FillFromDB(card_type, mplexid); 
     280    if (!ok) 
    313281        return false; 
    314282 
    315283    CheckOptions(tuning); 
     
    365333 
    366334    // Get the input data for the channel 
    367335    QString tvformat, modulation, freqtable, freqid, si_std; 
     336    QString msystem, rolloff; 
    368337    int finetune; 
    369338    uint64_t frequency; 
    370339    int mpeg_prog_num; 
     
    375344        tvformat, modulation, freqtable, freqid, 
    376345        finetune, frequency, 
    377346        si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 
     347        msystem, rolloff,  
    378348        mplexid, commfree)) 
    379349    { 
    380350        VERBOSE(VB_IMPORTANT, loc_err + 
     
    394364    if (!mplexid || !tuning.FillFromDB(card_type, mplexid)) 
    395365    { 
    396366        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)); 
    398369 
    399370        return false; 
    400371    } 
     
    509480 
    510481    if (card_type.IsFECVariable() && !CheckCodeRate(tuning.fec)) 
    511482    { 
    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)); 
    513488    } 
    514489 
    515490    if (card_type.IsModulationVariable() && !CheckModulation(tuning.modulation)) 
     
    575550bool DVBChannel::CheckCodeRate(DTVCodeRate rate) const 
    576551{ 
    577552    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     
    578564    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)); 
    589575} 
    590576 
    591577/** 
     
    596582    const DTVModulation m = modulation; 
    597583    const uint64_t      c = capabilities; 
    598584 
    599 #ifdef FE_GET_EXTENDED_INFO 
    600     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_INFO 
    607  
    608585    return 
    609586        ((DTVModulation::kModulationQPSK    == m) && (c & FE_CAN_QPSK))     || 
    610587        ((DTVModulation::kModulationQAM16   == m) && (c & FE_CAN_QAM_16))   || 
     
    640617bool DVBChannel::Tune(const DTVMultiplex &tuning, QString inputname) 
    641618{ 
    642619    int inputid = inputname.isEmpty() ? currentInputID : GetInputByName(inputname); 
     620 
    643621    if (inputid < 0) 
    644622    { 
    645623        VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Tune(): Invalid input '%1'.") 
     
    671649                      bool same_input) 
    672650{ 
    673651    QMutexLocker lock(&tune_lock); 
     652    uint64_t frequency = tuning.frequency; 
    674653 
    675654    if (master) 
    676655    { 
     
    680659    } 
    681660 
    682661    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 
    683681    struct dvb_fe_params params = dtvmultiplex_to_dvbparams(card_type, tuning); 
     682#endif 
    684683 
    685684    bool is_dvbs = (DTVTunerType::kTunerTypeQPSK   == card_type || 
    686685                    DTVTunerType::kTunerTypeDVB_S2 == card_type); 
     
    737736            // make sure we tune to frequency, if the lnb has changed 
    738737            reset = first_tune = true; 
    739738        } 
    740          
    741         params.frequency = lnb->GetIntermediateFrequency( 
    742             diseqc_settings, tuning); 
    743739 
     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 
    744753        // if card can auto-FEC, use it -- sometimes NITs are inaccurate 
    745754        if (capabilities & FE_CAN_FEC_AUTO) 
    746755            params.u.qpsk.fec_inner = FEC_AUTO; 
     756#endif 
    747757    } 
    748758 
    749759    VERBOSE(VB_CHANNEL, LOC + "Old Params: " + 
     
    758768    if (reset || !prev_tuning.IsEqual(card_type, tuning, 500 * freq_mult)) 
    759769    { 
    760770        VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") 
    761                 .arg(params.frequency).arg(suffix)); 
     771                .arg(frequency).arg(suffix)); 
    762772 
    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) 
    765776        { 
    766             if (ioctl(fd_frontend, FE_SET_FRONTEND2, &params) < 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; 
    772780        } 
    773         else 
    774 #endif // FE_GET_EXTENDED_INFO 
     781#else 
     782        if (ioctl(fd_frontend, FE_SET_FRONTEND, &params) < 0) 
    775783        { 
    776             if (ioctl(fd_frontend, FE_SET_FRONTEND, &params) < 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; 
    782787        } 
     788#endif 
    783789 
    784790        // Extra delay to add for broken DVB drivers 
    785791        if (tuning_delay) 
     
    835841        return false; 
    836842    } 
    837843 
     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 
    838849    dvb_fe_params params; 
    839850    return ioctl(fd_frontend, FE_GET_FRONTEND, &params) >= 0; 
     851#endif 
    840852} 
    841853 
    842854/** \fn DVBChannel::ProbeTuningParams(DTVMultiplex&) const 
     
    868880        return false; 
    869881    } 
    870882 
     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 
    871892    dvb_fe_params params; 
    872     if (ioctl(fd_frontend, FE_GET_FRONTEND, &params) < 0) 
     893    fe_ok = ioctl(fd_frontend, FE_GET_FRONTEND, &params); 
     894#endif 
     895    if (fe_ok < 0) 
    873896    { 
    874897        VERBOSE(VB_IMPORTANT, LOC_ERR + 
    875898                "Getting Frontend tuning parameters failed." + ENO); 
     
    880903    uint    mplex      = tuning.mplex; 
    881904    QString sistandard = tuning.sistandard; sistandard.detach(); 
    882905 
     906#ifdef USE_DVB_V5 
     907    tuning = dtvproperties_to_dtvmultiplex(card_type, cmds); 
     908#else 
    883909    tuning = dvbparams_to_dtvmultiplex(card_type, params); 
     910#endif 
    884911 
    885912    tuning.mplex       = mplex; 
    886913    tuning.sistandard  = sistandard; 
     
    967994    // We use uint16_t for sig because this is correct for DVB API 4.0, 
    968995    // and works better than the correct int16_t for the 3.x API 
    969996    uint16_t sig = 0; 
    970  
    971997    int ret = ioctl(fd_frontend, FE_READ_SIGNAL_STRENGTH, &sig); 
    972  
    973998    if (ok) 
    974999        *ok = (0 == ret); 
    9751000 
     
    9871012 
    9881013    uint16_t snr = 0; 
    9891014    int ret = ioctl(fd_frontend, FE_READ_SNR, &snr); 
    990  
    9911015    if (ok) 
    9921016        *ok = (0 == ret); 
    9931017 
     
    10021026 
    10031027    uint32_t ber = 0; 
    10041028    int ret = ioctl(fd_frontend, FE_READ_BER, &ber); 
    1005  
    10061029    if (ok) 
    10071030        *ok = (0 == ret); 
    10081031 
     
    10171040 
    10181041    uint32_t ublocks = 0; 
    10191042    int ret = ioctl(fd_frontend, FE_READ_UNCORRECTED_BLOCKS, &ublocks); 
    1020  
    10211043    if (ok) 
    10221044        *ok = (0 == ret); 
    10231045 
     
    11111133 
    11121134    if (DTVTunerType::kTunerTypeDVB_S2 == tuner_type) 
    11131135    { 
    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 
    11191136        VERBOSE(VB_IMPORTANT, "DVBChan Error, MythTV was compiled without " 
    11201137                "DVB-S2 headers being present so DVB-S2 tuning will fail."); 
    1121 #endif // !FE_GET_EXTENDED_INFO 
    11221138    } 
    11231139 
    11241140    if (DTVTunerType::kTunerTypeQAM  == tuner_type) 
     
    11991215 
    12001216    return tuning; 
    12011217} 
     1218 
     1219 
     1220#ifdef USE_DVB_V5 
     1221static 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 
     1322static 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 
     1330static 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

     
    245245    close(fd_frontend); 
    246246 
    247247    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 
    248258    ret = (type.toString() != "UNKNOWN") ? type.toString().toUpper() : ret; 
    249259#endif // USING_DVB 
    250260 
     
    337347{ 
    338348    QString ct = card_type.toUpper(); 
    339349    return (ct == "DVB") || (ct == "QAM") || (ct == "QPSK") || 
    340         (ct == "OFDM") || (ct == "ATSC"); 
     350        (ct == "OFDM") || (ct == "ATSC") || (ct == "DVB_S2"); 
    341351} 
    342352 
    343353QString get_on_cardid(const QString &to_get, uint cardid) 
  • libs/libmythtv/videosource.cpp

     
    29292929            signal_timeout->setValue(60000); 
    29302930            channel_timeout->setValue(62500); 
    29312931            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; 
    29322938        case CardUtil::QAM: 
    29332939            cardtype->setValue("DVB-C"); 
    29342940            cardname->setValue(frontend_name); 
  • libs/libmythtv/frequencytables.cpp

     
    6868        _tuning.lp_code_rate.toString(),     _tuning.modulation.toString(), 
    6969        _tuning.trans_mode.toString(),       _tuning.guard_interval.toString(), 
    7070        _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; 
    7274} 
    7375 
    7476TransportScanItem::TransportScanItem(uint sourceid, 
  • libs/libmythtv/scanwizard.cpp

     
    9898        start_chan = configPane->GetStartChan(); 
    9999        parse_type = DTVTunerType::kTunerTypeQPSK; 
    100100    } 
     101    else if (scantype == ScanTypeSetting::NITAddScan_DVBS2) 
     102    { 
     103        start_chan = configPane->GetStartChan(); 
     104        parse_type = DTVTunerType::kTunerTypeDVB_S2; 
     105    } 
    101106    else if (scantype == ScanTypeSetting::NITAddScan_QAM) 
    102107    { 
    103108        start_chan = configPane->GetStartChan(); 
     
    139144            start_chan["coderate_hp"],    start_chan["coderate_lp"], 
    140145            start_chan["constellation"],  start_chan["trans_mode"], 
    141146            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"])) 
    143149    { 
    144150        MythPopupBox::showOkPopup( 
    145151            gContext->GetMainWindow(), tr("ScanWizard"), 
  • libs/libmythtv/transporteditor.cpp

     
    9898    MSqlQuery query(MSqlQuery::InitCon()); 
    9999    query.prepare( 
    100100        "SELECT mplexid, modulation, frequency, " 
    101         "       symbolrate, networkid, transportid, constellation " 
     101        "       symbolrate, networkid, transportid, constellation, msystem " 
    102102        "FROM dtv_multiplex, videosource " 
    103103        "WHERE dtv_multiplex.sourceid = :SOURCEID AND " 
    104104        "      dtv_multiplex.sourceid = videosource.sourceid " 
     
    129129        QString tid = query.value(5).toUInt() ? 
    130130            QString("tid %1").arg(query.value(5).toUInt(), 5) : ""; 
    131131 
    132         QString hz = (CardUtil::QPSK == cardtype) ? "kHz" : "Hz"; 
     132        QString hz = (CardUtil::QPSK == cardtype || 
     133                      CardUtil::DVBS2 == cardtype) ? "kHz" : "Hz"; 
    133134 
    134135        QString type = ""; 
    135136        if (CardUtil::OFDM == cardtype) 
    136137            type = "(DVB-T)"; 
    137138        if (CardUtil::QPSK == cardtype) 
    138139            type = "(DVB-S)"; 
     140        if (CardUtil::DVBS2 == cardtype) 
     141            type = (query.value(7).toString() == "dvbs2")?"(DVB-S2)":"(DVB-S)"; 
     142 
    139143        if (CardUtil::QAM == cardtype) 
    140144            type = "(DVB-C)"; 
    141145 
     
    487491    }; 
    488492}; 
    489493 
     494class 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 
    490508class Modulation : public ComboBoxSetting, public MuxDBStorage 
    491509{ 
    492510  public: 
     
    506524        // no modulation options 
    507525        setVisible(false); 
    508526    } 
     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    } 
    509536    else if ((CardUtil::QAM == nType) || (CardUtil::OFDM == nType)) 
    510537    { 
    511538        addSelection(QObject::tr("QAM Auto"), "auto"); 
     
    576603        addSelection("1/2"); 
    577604        addSelection("2/3"); 
    578605        addSelection("3/4"); 
     606        addSelection("3/5"); 
    579607        addSelection("4/5"); 
    580608        addSelection("5/6"); 
    581609        addSelection("6/7"); 
    582610        addSelection("7/8"); 
    583611        addSelection("8/9"); 
     612        addSelection("9/10"); 
    584613    }; 
    585614}; 
    586615 
     
    597626    }; 
    598627}; 
    599628 
     629class 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 
    600644class DVBTCoderateLP : 
    601645    public DVBForwardErrorCorrectionSelector, public MuxDBStorage 
    602646{ 
     
    715759        right->addChild(new DVBForwardErrorCorrection(id)); 
    716760        right->addChild(new SignalPolarity(id)); 
    717761    } 
     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    } 
    718776    else if (CardUtil::QAM == nType) 
    719777    { 
    720778        left->addChild(new DTVStandard(id, true, false)); 
  • libs/libmythtv/scanwizardhelpers.cpp

     
    455455                         QString::number(NITAddScan_QPSK)); 
    456456            importConf = true; 
    457457            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 
    458465        case CardUtil::QAM: 
    459466            addSelection(tr("Full Scan (Tuned)"), 
    460467                         QString::number(NITAddScan_QAM)); 
     
    584591              paneQAM); 
    585592    addTarget(QString::number(ScanTypeSetting::NITAddScan_QPSK), 
    586593              paneQPSK); 
     594    addTarget(QString::number(ScanTypeSetting::NITAddScan_DVBS2), 
     595              paneDVBS2); 
    587596    addTarget(QString::number(ScanTypeSetting::NITAddScan_OFDM), 
    588597              paneOFDM); 
    589598    addTarget(QString::number(ScanTypeSetting::FullScan_ATSC), 
     
    776785        startChan["modulation"] = "qpsk"; 
    777786        startChan["polarity"]   = pane->polarity(); 
    778787    } 
     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    } 
    779802    else if (ScanTypeSetting::NITAddScan_QAM == st) 
    780803    { 
    781804        const QAMPane *pane = paneQAM; 
  • libs/libmythtv/dtvmultiplex.cpp

     
    2424    fec            = other.fec; 
    2525    mplex          = other.mplex; 
    2626    sistandard     = other.sistandard; 
     27    msystem        = other.msystem; 
     28    rolloff        = other.rolloff; 
    2729    sistandard.detach(); 
    2830    return *this; 
    2931} 
     
    4042            (guard_interval == m.guard_interval) && 
    4143            (fec == m.fec) && 
    4244            (polarity == m.polarity) && 
    43             (hierarchy == m.hierarchy)); 
     45            (hierarchy == m.hierarchy) && 
     46            (msystem == m.msystem) && 
     47            (rolloff == m.rolloff)); 
    4448} 
    4549 
    4650/////////////////////////////////////////////////////////////////////////////// 
     
    4852 
    4953QString DTVMultiplex::toString() const 
    5054{ 
    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()); 
    5357 
    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") 
    5559        .arg(hp_code_rate.toString()).arg(lp_code_rate.toString()) 
    5660        .arg(bandwidth.toString()).arg(trans_mode.toString()) 
    5761        .arg(guard_interval.toString()).arg(hierarchy.toString()) 
    58         .arg(polarity.toString()); 
     62        .arg(polarity.toString()) 
     63        .arg(msystem.toString()).arg(rolloff.toString()); 
    5964 
    6065    return ret; 
    6166} 
     
    102107        return 
    103108            (inversion  == other.inversion)  && 
    104109            (symbolrate == other.symbolrate) && 
    105             (fec        == other.fec); 
     110            (fec        == other.fec)        && 
     111            (msystem    == other.msystem)    && 
     112            (rolloff    == other.rolloff); 
    106113    } 
    107114 
    108115    return false; 
     
    152159    const QString &_symbol_rate, const QString &_fec_inner, 
    153160    const QString &_modulation,  const QString &_polarity) 
    154161{ 
    155     bool ok = inversion.Parse(_inversion); 
    156     if (!ok) 
     162    if (!inversion.Parse(_inversion)) 
    157163    { 
    158164        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)); 
    162166    } 
    163167 
    164168    symbolrate = _symbol_rate.toInt(); 
     
    166170    { 
    167171        VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid symbol rate " + 
    168172                QString("parameter '%1', aborting.").arg(_symbol_rate)); 
    169  
    170173        return false; 
    171174    } 
    172175 
    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    } 
    175189 
    176190    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        } 
    178197 
    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    } 
    181207 
    182     return ok; 
     208    return true; 
    183209} 
    184210 
     211bool 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 
    185247bool DTVMultiplex::ParseTuningParams( 
    186248    DTVTunerType type, 
    187249    QString _frequency,    QString _inversion,      QString _symbolrate, 
    188250    QString _fec,          QString _polarity, 
    189251    QString _hp_code_rate, QString _lp_code_rate,   QString _ofdm_modulation, 
    190252    QString _trans_mode,   QString _guard_interval, QString _hierarchy, 
    191     QString _modulation,   QString _bandwidth) 
     253    QString _modulation,   QString _bandwidth, 
     254    QString _msystem,      QString _rolloff) 
    192255{ 
    193256    if (DTVTunerType::kTunerTypeOFDM == type) 
    194257    { 
     
    198261            _hierarchy); 
    199262    } 
    200263 
    201     if ((DTVTunerType::kTunerTypeQPSK   == type) || 
    202         (DTVTunerType::kTunerTypeDVB_S2 == type) || 
    203         (DTVTunerType::kTunerTypeQAM    == type)) 
     264    if ((DTVTunerType::kTunerTypeQPSK == type) || 
     265        (DTVTunerType::kTunerTypeQAM  == type)) 
    204266    { 
    205267        return ParseDVB_S_and_C( 
    206268            _frequency,       _inversion,     _symbolrate, 
    207269            _fec,             _modulation,    _polarity); 
    208270    } 
    209271 
     272    if (DTVTunerType::kTunerTypeDVB_S2 == type) 
     273    { 
     274        return ParseDVB_S2( 
     275            _frequency,       _inversion,     _symbolrate, 
     276            _fec,             _modulation,    _polarity, 
     277            _msystem,         _rolloff); 
     278    } 
     279 
    210280    if (DTVTunerType::kTunerTypeATSC == type) 
    211281        return ParseATSC(_frequency, _modulation); 
    212282 
     
    223293        "       fec,               polarity, " 
    224294        "       hp_code_rate,      lp_code_rate,   constellation, " 
    225295        "       transmission_mode, guard_interval, hierarchy, " 
    226         "       modulation,        bandwidth,      sistandard " 
     296        "       modulation,        bandwidth,      sistandard, " 
     297        "       msystem,           rolloff " 
    227298        "FROM dtv_multiplex " 
    228299        "WHERE dtv_multiplex.mplexid = :MPLEXID"); 
    229300    query.bindValue(":MPLEXID", mplexid); 
     
    256327        query.value(6).toString(),  query.value(7).toString(), 
    257328        query.value(8).toString(),  query.value(9).toString(), 
    258329        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()); 
    260332} 
    261333 
    262334//////////////////////////////////////////////////////////////////////////// 
     
    318390        "    mplexid,            frequency,       inversion,  " 
    319391        "    symbolrate,         fec,             polarity,   " 
    320392        "    hp_code_rate,       lp_code_rate,    modulation, " 
     393        "    msystem,            rolloff,                     " 
    321394        "    transmission_mode,  guard_interval,  hierarchy,  " 
    322395        "    bandwidth,          sistandard,      tuner_type  " 
    323396        " ) " 
     
    326399        "   :MPLEXID,           :FREQUENCY,      :INVERSION,  " 
    327400        "   :SYMBOLRATE,        :FEC,            :POLARITY,   " 
    328401        "   :HP_CODE_RATE,      :LP_CODE_RATE,   :MODULATION, " 
     402        "   :MSYSTEM,           :ROLLOFF,                     " 
    329403        "   :TRANSMISSION_MODE, :GUARD_INTERVAL, :HIERARCHY,  " 
    330404        "   :BANDWIDTH,         :SISTANDARD,     :TUNER_TYPE  " 
    331405        " );"); 
     
    340414    query.bindValue(":HP_CODE_RATE", hp_code_rate.toString()); 
    341415    query.bindValue(":LP_CODE_RATE", lp_code_rate.toString()); 
    342416    query.bindValue(":MODULATION", modulation.toString()); 
     417    query.bindValue(":MSYSTEM", msystem.toString()); 
     418    query.bindValue(":ROLLOFF", rolloff.toString()); 
    343419    query.bindValue(":TRANSMISSION_MODE", trans_mode.toString()); 
    344420    query.bindValue(":GUARD_INTERVAL", guard_interval.toString()); 
    345421    query.bindValue(":HIERARCHY", hierarchy.toString());