aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dvb')
-rw-r--r--lib/dvb/db.cpp29
-rw-r--r--lib/dvb/frontend.cpp51
-rw-r--r--lib/dvb/frontendparms.h13
3 files changed, 77 insertions, 16 deletions
diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp
index 5fd0758e..2be0dd4c 100644
--- a/lib/dvb/db.cpp
+++ b/lib/dvb/db.cpp
@@ -327,8 +327,9 @@ void eDVBDB::loadServicelist(const char *file)
int frequency, symbol_rate, polarisation, fec, orbital_position, inversion,
system=eDVBFrontendParametersSatellite::System::DVB_S,
modulation=eDVBFrontendParametersSatellite::Modulation::QPSK,
- rolloff=eDVBFrontendParametersSatellite::RollOff::alpha_auto;
- sscanf(line+3, "%d:%d:%d:%d:%d:%d:%d:%d:%d", &frequency, &symbol_rate, &polarisation, &fec, &orbital_position, &inversion, &system, &modulation, &rolloff);
+ rolloff=eDVBFrontendParametersSatellite::RollOff::alpha_0_35,
+ pilot=eDVBFrontendParametersSatellite::Pilot::Unknown;
+ sscanf(line+3, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d", &frequency, &symbol_rate, &polarisation, &fec, &orbital_position, &inversion, &system, &modulation, &rolloff, &pilot);
sat.frequency = frequency;
sat.symbol_rate = symbol_rate;
sat.polarisation = polarisation;
@@ -338,7 +339,8 @@ void eDVBDB::loadServicelist(const char *file)
sat.inversion = inversion;
sat.system = system;
sat.modulation = modulation;
- sat.roll_off = rolloff;
+ sat.rolloff = rolloff;
+ sat.pilot = pilot;
feparm->setDVBS(sat);
} else if (line[1]=='t')
{
@@ -484,14 +486,18 @@ void eDVBDB::saveServicelist()
{
if (sat.system == eDVBFrontendParametersSatellite::System::DVB_S2)
{
- fprintf(f, "\ts %d:%d:%d:%d:%d:%d:%d:%d:%d\n",
+ fprintf(f, "\ts %d:%d:%d:%d:%d:%d:%d:%d:%d",
sat.frequency, sat.symbol_rate,
sat.polarisation, sat.fec,
sat.orbital_position > 1800 ? sat.orbital_position - 3600 : sat.orbital_position,
sat.inversion,
sat.system,
sat.modulation,
- sat.roll_off);
+ sat.rolloff);
+ if (sat.modulation == eDVBFrontendParametersSatellite::Modulation::M8PSK)
+ fprintf(f, ":%d\n", sat.pilot);
+ else
+ fprintf(f, "\n");
}
else
{
@@ -766,7 +772,7 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
return Py_False;
}
int tmp, *dest = NULL,
- modulation, system, freq, sr, pol, fec;
+ modulation, system, freq, sr, pol, fec, inv, pilot, rolloff;
char *end_ptr;
const Attribute *at;
std::string name;
@@ -828,6 +834,9 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
sr = 0;
pol = -1;
fec = 0; // AUTO default
+ inv = 2; // AUTO default
+ pilot = 2; // AUTO default
+ rolloff = 0; // alpha 0.35
for (AttributeConstIterator it(tp_attributes.begin()); it != end; ++it)
{
// eDebug("\t\tattr: %s", at->name().c_str());
@@ -839,6 +848,9 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
else if (name == "symbol_rate") dest = &sr;
else if (name == "polarization") dest = &pol;
else if (name == "fec_inner") dest = &fec;
+ else if (name == "inversion") dest = &inv;
+ else if (name == "rolloff") dest = &rolloff;
+ else if (name == "pilot") dest = &pilot;
if (dest)
{
tmp = strtol(at->value().c_str(), &end_ptr, 10);
@@ -848,7 +860,7 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
}
if (freq && sr && pol != -1)
{
- tuple = PyTuple_New(7);
+ tuple = PyTuple_New(10);
PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(0));
PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong(freq));
PyTuple_SET_ITEM(tuple, 2, PyInt_FromLong(sr));
@@ -856,6 +868,9 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
PyTuple_SET_ITEM(tuple, 4, PyInt_FromLong(fec));
PyTuple_SET_ITEM(tuple, 5, PyInt_FromLong(system));
PyTuple_SET_ITEM(tuple, 6, PyInt_FromLong(modulation));
+ PyTuple_SET_ITEM(tuple, 7, PyInt_FromLong(inv));
+ PyTuple_SET_ITEM(tuple, 8, PyInt_FromLong(rolloff));
+ PyTuple_SET_ITEM(tuple, 9, PyInt_FromLong(pilot));
PyList_Append(tplist, tuple);
Py_DECREF(tuple);
}
diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp
index 9f19ada1..d81c455c 100644
--- a/lib/dvb/frontend.cpp
+++ b/lib/dvb/frontend.cpp
@@ -125,6 +125,7 @@ void eDVBFrontendParametersSatellite::set(const SatelliteDeliverySystemDescripto
if ( fec != FEC::fNone && fec > FEC::f9_10 )
fec = FEC::fAuto;
inversion = Inversion::Unknown;
+ pilot = Pilot::Unknown;
orbital_position = ((descriptor.getOrbitalPosition() >> 12) & 0xF) * 1000;
orbital_position += ((descriptor.getOrbitalPosition() >> 8) & 0xF) * 100;
orbital_position += ((descriptor.getOrbitalPosition() >> 4) & 0xF) * 10;
@@ -138,16 +139,16 @@ void eDVBFrontendParametersSatellite::set(const SatelliteDeliverySystemDescripto
eDebug("satellite_delivery_descriptor non valid modulation type.. force QPSK");
modulation=QPSK;
}
- roll_off = descriptor.getRollOff();
+ rolloff = descriptor.getRollOff();
if (system == System::DVB_S2)
{
- eDebug("SAT DVB-S2 freq %d, %s, pos %d, sr %d, fec %d, modulation %d, roll_off %d",
+ eDebug("SAT DVB-S2 freq %d, %s, pos %d, sr %d, fec %d, modulation %d, rolloff %d",
frequency,
polarisation ? "hor" : "vert",
orbital_position,
symbol_rate, fec,
modulation,
- roll_off);
+ rolloff);
}
else
{
@@ -861,8 +862,43 @@ void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &parm, e
PutToDict(dict, "modulation", "QPSK" );
#endif
PutToDict(dict, "fec_inner", tmp);
- tmp = parm_u_qpsk_fec_inner > FEC_AUTO ?
- "DVB-S2" : "DVB-S";
+ if (parm_u_qpsk_fec_inner > FEC_AUTO)
+ {
+ switch(parm_inversion & 0xc)
+ {
+ default: // unknown rolloff
+ case 0: // 0.35
+ tmp = "ROLLOFF_0_35";
+ break;
+ case 4: // 0.25
+ tmp = "ROLLOFF_0_25";
+ break;
+ case 8: // 0.20
+ tmp = "ROLLOFF_0_20";
+ break;
+ }
+ PutToDict(dict, "rolloff", tmp);
+ if (parm_u_qpsk_fec_inner > FEC_S2_QPSK_9_10)
+ {
+ switch(parm_inversion & 0x30)
+ {
+ case 0: // pilot off
+ tmp = "PILOT_OFF";
+ break;
+ case 0x10: // pilot on
+ tmp = "PILOT_ON";
+ break;
+ case 0x20: // pilot auto
+ tmp = "PILOT_AUTO";
+ break;
+ }
+ PutToDict(dict, "pilot", tmp);
+ }
+ tmp = "DVB-S2";
+ }
+ else
+ tmp = "DVB-S";
+
PutToDict(dict, "system", tmp);
}
@@ -1657,9 +1693,12 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
eDebug("no valid fec for DVB-S2 set.. abort !!");
return -EINVAL;
}
- if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation::M8PSK)
+ parm_inversion |= (feparm.rolloff << 2); // Hack.. we use bit 2..3 of inversion param for rolloff
+ if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation::M8PSK) {
parm_u_qpsk_fec_inner = (fe_code_rate_t)((int)parm_u_qpsk_fec_inner+9);
// 8PSK fec driver values are decimal 9 bigger
+ parm_inversion |= (feparm.pilot << 4); // Hack.. we use bit 4..5 of inversion param for pilot
+ }
}
#endif
// FIXME !!! get frequency range from tuner
diff --git a/lib/dvb/frontendparms.h b/lib/dvb/frontendparms.h
index b8f47f43..c963a251 100644
--- a/lib/dvb/frontendparms.h
+++ b/lib/dvb/frontendparms.h
@@ -37,14 +37,21 @@ struct eDVBFrontendParametersSatellite
Auto, QPSK, M8PSK, QAM_16
};
};
- struct RollOff { // dvb-s2
+ // dvb-s2
+ struct RollOff {
enum {
- alpha_0_35, alpha_0_25, alpha_0_20, alpha_auto
+ alpha_0_35, alpha_0_25, alpha_0_20
+ };
+ };
+ // only 8psk
+ struct Pilot {
+ enum {
+ Off, On, Unknown
};
};
bool no_rotor_command_on_tune;
unsigned int frequency, symbol_rate;
- int polarisation, fec, inversion, orbital_position, system, modulation, roll_off;
+ int polarisation, fec, inversion, orbital_position, system, modulation, rolloff, pilot;
};
SWIG_ALLOW_OUTPUT_SIMPLE(eDVBFrontendParametersSatellite);