From 4b8de38c639f03b191ce66d85d5b2c894117d4d5 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 30 Oct 2008 21:21:46 +0100 Subject: Add DiSEqC reset after voltage enable and tune failed... hopefully this fixes problems with some DiSEqC switches --- lib/dvb/frontend.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/dvb/frontend.cpp') diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 1bcacc03..635de8f5 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -1492,7 +1492,12 @@ void eDVBFrontend::tuneLoop() // called by m_tuneTimer eDebugNoSimulateNoNewLine("[SEC] sendDiseqc: "); for (int i=0; i < m_sec_sequence.current()->diseqc.len; ++i) eDebugNoSimulateNoNewLine("%02x", m_sec_sequence.current()->diseqc.data[i]); - eDebugNoSimulate(""); + if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x00", 3)) + eDebugNoSimulate("(DiSEqC reset)"); + else if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x03", 3)) + eDebugNoSimulate("(DiSEqC peripherial power on)"); + else + eDebugNoSimulate(""); ++m_sec_sequence.current(); break; case eSecCommand::SEND_TONEBURST: -- cgit v1.2.3 From e7721dc651ba450edc5e01360c93873b6e66bc50 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Nov 2008 12:15:33 +0100 Subject: add SNRdb calculation for bcm4501 in LDPC Mode --- lib/dvb/frontend.cpp | 93 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 33 deletions(-) (limited to 'lib/dvb/frontend.cpp') diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 635de8f5..27ea66ec 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -81,22 +81,26 @@ if (!m_simulate) \ eDebug(x); \ } while(0) -// else \ -// { \ -// eDebugNoNewLine("SIMULATE:"); \ -// eDebug(x); \ -// } \ +#if 0 + else \ + { \ + eDebugNoNewLine("SIMULATE:"); \ + eDebug(x); \ + } +#endif #define eDebugNoSimulateNoNewLine(x...) \ do { \ if (!m_simulate) \ eDebugNoNewLine(x); \ } while(0) -// else \ -// { \ -// eDebugNoNewLine("SIMULATE:"); \ -// eDebugNoNewLine(x); \ -// } \ +#if 0 + else \ + { \ + eDebugNoNewLine("SIMULATE:"); \ + eDebugNoNewLine(x); \ + } +#endif void eDVBDiseqcCommand::setCommandString(const char *str) { @@ -725,34 +729,58 @@ int eDVBFrontend::readFrontendData(int type) if (!strcmp(m_description, "BCM4501 (internal)")) { unsigned int SDS_SNRE = snr << 16; + float snr_in_db; - static float SNR_COEFF[6] = { - 100.0 / 4194304.0, - -7136.0 / 4194304.0, - 197418.0 / 4194304.0, - -2602183.0 / 4194304.0, - 20377212.0 / 4194304.0, - -37791203.0 / 4194304.0, - }; - - float fval1, fval2, snr_in_db; - int i; - fval1 = 12.44714 - (2.0 * log10(SDS_SNRE / 256.0)); - fval2 = pow(10.0, fval1)-1; - fval1 = 10.0 * log10(fval2); - - if (fval1 < 10.0) + if (parm_u_qpsk_fec_inner <= FEC_AUTO) // DVB-S1 / QPSK { - fval2 = SNR_COEFF[0]; - for (i=0; i<6; ++i) + static float SNR_COEFF[6] = { + 100.0 / 4194304.0, + -7136.0 / 4194304.0, + 197418.0 / 4194304.0, + -2602183.0 / 4194304.0, + 20377212.0 / 4194304.0, + -37791203.0 / 4194304.0, + }; + float fval1 = 12.44714 - (2.0 * log10(SDS_SNRE / 256.0)), + fval2 = pow(10.0, fval1)-1; + fval1 = 10.0 * log10(fval2); + + if (fval1 < 10.0) { - fval2 *= fval1; - fval2 += SNR_COEFF[i]; + fval2 = SNR_COEFF[0]; + for (int i=0; i<6; ++i) + { + fval2 *= fval1; + fval2 += SNR_COEFF[i]; + } + fval1 = fval2; } - fval1 = fval2; + snr_in_db = fval1; } - snr_in_db = fval1; +#if HAVE_DVB_API_VERSION >= 3 + else + { + float fval1 = SDS_SNRE / 268435456.0, + fval2, fval3, fval4; + if (parm_u_qpsk_fec_inner <= FEC_S2_QPSK_9_10) // DVB-S2 QPSK + { + fval2 = 6.76; + fval3 = 4.35; + } + else // 8PSK + { + fval1 *= 0.5; + fval2 = 8.06; + fval3 = 6.18; + } + fval4 = -10.0 * log10(fval1); + fval1 = fval4; + for (int i=0; i < 5; ++i) + fval1 = fval4 - fval2 * log10(1.0+pow(10.0, (fval3-fval1)/fval2)); + snr_in_db = fval1; + } +#endif return (int)(snr_in_db * 100.0); } else if (strstr(m_description, "Alps BSBE1 C01A") || @@ -781,7 +809,6 @@ int eDVBFrontend::readFrontendData(int type) i; if(INRANGE(CN_lookup[Imin][REGVAL],regval,CN_lookup[Imax][REGVAL])) { - long val; while((Imax-Imin)>1) { i=(Imax+Imin)/2; -- cgit v1.2.3 From 6347d817582886ab7c7535b44601538749d06d5b Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 16 Nov 2008 12:23:21 +0100 Subject: Add possibility to set Pilot also for DVB-S2 non 8PSK Transponders (i.e. the new Euro1080 Transponder on 7°E) But this needs also new drivers! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/dvb/db.cpp | 9 +++------ lib/dvb/frontend.cpp | 29 +++++++++++++---------------- lib/python/Screens/ScanSetup.py | 3 +-- lib/service/servicedvb.cpp | 15 ++++++--------- 4 files changed, 23 insertions(+), 33 deletions(-) (limited to 'lib/dvb/frontend.cpp') diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp index c6c2e855..1c332033 100644 --- a/lib/dvb/db.cpp +++ b/lib/dvb/db.cpp @@ -497,7 +497,7 @@ void eDVBDB::saveServicelist(const char *file) { if (sat.system == eDVBFrontendParametersSatellite::System::DVB_S2) { - fprintf(f, "\ts %d:%d:%d:%d:%d:%d:%d:%d:%d:%d", + fprintf(f, "\ts %d:%d:%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, @@ -505,11 +505,8 @@ void eDVBDB::saveServicelist(const char *file) flags, sat.system, sat.modulation, - sat.rolloff); - if (sat.modulation == eDVBFrontendParametersSatellite::Modulation::M8PSK) - fprintf(f, ":%d\n", sat.pilot); - else - fprintf(f, "\n"); + sat.rolloff, + sat.pilot); } else { diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 27ea66ec..b0e92d39 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -1014,22 +1014,19 @@ void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &parm, e break; } PutToDict(dict, "rolloff", tmp); - if (parm_u_qpsk_fec_inner > FEC_S2_QPSK_9_10) + switch(parm_inversion & 0x30) { - 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); + 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 @@ -1310,7 +1307,7 @@ void eDVBFrontend::getTransponderData(ePyObject dest, bool original) { const FRONTENDPARAMETERS &parm = original || m_simulate ? this->parm : front; const char *tmp = "INVERSION_AUTO"; - switch(parm_inversion) + switch(parm_inversion & 3) { case INVERSION_ON: tmp = "INVERSION_ON"; @@ -1916,10 +1913,10 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm, return -EINVAL; } parm_inversion |= (feparm.rolloff << 2); // Hack.. we use bit 2..3 of inversion param for rolloff + parm_inversion |= (feparm.pilot << 4); // Hack.. we use bit 4..5 of inversion param for pilot 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 diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py index ab110a24..608dcb2d 100644 --- a/lib/python/Screens/ScanSetup.py +++ b/lib/python/Screens/ScanSetup.py @@ -394,8 +394,7 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.modulationEntry = getConfigListEntry(_('Modulation'), self.scan_sat.modulation) self.list.append(self.modulationEntry) self.list.append(getConfigListEntry(_('Rolloff'), self.scan_sat.rolloff)) - if self.scan_sat.modulation.value == "8psk": - self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot)) + self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot)) elif self.scan_type.value == "single_satellite": self.updateSatList() print self.scan_satselection[index_to_scan] diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 2f98ed6b..6c1e46f7 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -174,17 +174,14 @@ void PutSatelliteDataToDict(ePyObject &dict, eDVBFrontendParametersSatellite &fe case eDVBFrontendParametersSatellite::RollOff::alpha_0_20: tmp="0.20"; break; } PutToDict(dict, "roll off", tmp); - if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation::M8PSK) + switch(feparm.pilot) { - switch(feparm.pilot) - { - case eDVBFrontendParametersSatellite::Pilot::On: tmp="ON"; break; - case eDVBFrontendParametersSatellite::Pilot::Off: tmp="OFF"; break; - default: - case eDVBFrontendParametersSatellite::Pilot::Unknown: tmp="AUTO"; break; - } - PutToDict(dict, "pilot", tmp); + case eDVBFrontendParametersSatellite::Pilot::On: tmp="ON"; break; + case eDVBFrontendParametersSatellite::Pilot::Off: tmp="OFF"; break; + default: + case eDVBFrontendParametersSatellite::Pilot::Unknown: tmp="AUTO"; break; } + PutToDict(dict, "pilot", tmp); tmp="DVB-S2"; break; } -- cgit v1.2.3