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;
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
{
}
case iDVBFrontend::feCable:
hash = 0xFFFF0000;
+ hash |= (cable.frequency/1000)&0xFFFF;
return 0;
case iDVBFrontend::feTerrestrial:
hash = 0xEEEE0000;
+ hash |= (terrestrial.frequency/1000)&0xFFFF;
return 0;
default:
return -1;
eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok)
:m_enabled(false), m_type(-1), m_dvbid(fe), m_slotid(fe)
- ,m_fd(-1), m_need_rotor_workaround(false), m_sn(0), m_timeout(0), m_tuneTimer(0)
+ ,m_fd(-1), m_need_rotor_workaround(false), m_can_handle_dvbs2(false)
+ ,m_sn(0), m_timeout(0), m_tuneTimer(0)
#if HAVE_DVB_API_VERSION < 3
,m_secfd(-1)
#endif
break;
#endif
}
+ PutToDict(dict, "fec_inner", tmp);
#if HAVE_DVB_API_VERSION >=3
PutToDict(dict, "modulation",
parm_u_qpsk_fec_inner > FEC_S2_QPSK_9_10 ? "8PSK": "QPSK" );
+ 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";
#else
PutToDict(dict, "modulation", "QPSK" );
+ tmp = "DVB-S";
#endif
- PutToDict(dict, "fec_inner", tmp);
- tmp = parm_u_qpsk_fec_inner > FEC_AUTO ?
- "DVB-S2" : "DVB-S";
PutToDict(dict, "system", tmp);
}
void fillDictWithCableData(ePyObject dict, const FRONTENDPARAMETERS &parm)
{
const char *tmp=0;
+#if HAVE_DVB_API_VERSION < 3
+ PutToDict(dict, "frequency", parm_frequency);
+#else
PutToDict(dict, "frequency", parm_frequency/1000);
+#endif
PutToDict(dict, "symbol_rate", parm_u_qam_symbol_rate);
switch(parm_u_qam_fec_inner)
{
break;
case eSecCommand::SET_POWER_LIMITING_MODE:
{
- if (m_need_rotor_workaround)
+ char proc_name[64];
+ sprintf(proc_name, "/proc/stb/frontend/%d/static_current_limiting", m_dvbid);
+ FILE *f=fopen(proc_name, "w");
+ if (f) // new interface exist?
+ {
+ bool slimiting = m_sec_sequence.current()->mode == eSecCommand::modeStatic;
+ if (fprintf(f, "%s", slimiting ? "on" : "off") <= 0)
+ eDebug("write %s failed!! (%m)", proc_name);
+ else
+ eDebug("[SEC] set %s current limiting", slimiting ? "static" : "dynamic");
+ fclose(f);
+ }
+ else if (m_need_rotor_workaround)
{
char dev[16];
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
RESULT eDVBFrontend::prepare_cable(const eDVBFrontendParametersCable &feparm)
{
+#if HAVE_DVB_API_VERSION < 3
+ parm_frequency = feparm.frequency;
+#else
parm_frequency = feparm.frequency * 1000;
+#endif
parm_u_qam_symbol_rate = feparm.symbol_rate;
switch (feparm.modulation)
{
int type;
if (feparm->getSystem(type) || type != m_type || !m_enabled)
return 0;
-
if (m_type == eDVBFrontend::feSatellite)
{
ASSERT(m_sec);
eDVBFrontendParametersSatellite sat_parm;
int ret = feparm->getDVBS(sat_parm);
ASSERT(!ret);
- return m_sec->canTune(sat_parm, this, 1 << m_slotid);
+ if (sat_parm.system == eDVBFrontendParametersSatellite::System::DVB_S2 && !m_can_handle_dvbs2)
+ return 0;
+ ret = m_sec->canTune(sat_parm, this, 1 << m_slotid);
+ if (ret > 1 && sat_parm.system == eDVBFrontendParametersSatellite::System::DVB_S && m_can_handle_dvbs2)
+ ret -= 1;
+ return ret;
}
else if (m_type == eDVBFrontend::feCable)
return 2; // more prio for cable frontends
- return 1;
+ else if (m_type == eDVBFrontend::feTerrestrial)
+ return 1;
+ return 0;
}
bool eDVBFrontend::setSlotInfo(ePyObject obj)
// HACK.. the rotor workaround is neede for all NIMs with LNBP21 voltage regulator...
m_need_rotor_workaround = !!strstr(m_description, "Alps BSBE1") ||
!!strstr(m_description, "Alps BSBE2") ||
- !!strstr(m_description, "Alps -S");
- eDebug("setSlotInfo for dvb frontend %d to slotid %d, descr %s, need rotorworkaround %s, enabled %s",
- m_dvbid, m_slotid, m_description, m_need_rotor_workaround ? "Yes" : "No", m_enabled ? "Yes" : "No" );
+ !!strstr(m_description, "Alps -S") ||
+ !!strstr(m_description, "BCM4501");
+ m_can_handle_dvbs2 = !!strstr(m_description, "Alps BSBE2") || !!strstr(m_description, "BCM4501");
+ eDebug("setSlotInfo for dvb frontend %d to slotid %d, descr %s, need rotorworkaround %s, enabled %s, DVB-S2 %s",
+ m_dvbid, m_slotid, m_description, m_need_rotor_workaround ? "Yes" : "No", m_enabled ? "Yes" : "No", m_can_handle_dvbs2 ? "Yes" : "No" );
return true;
arg_error:
PyErr_SetString(PyExc_StandardError,