X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c95ebd0688c39d4fa6e22e85d84fe7d80e3da013..b9c0b3c8ec8c7979848126d9c88764043d685d26:/lib/dvb/frontend.cpp diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index bd8f0028..abbb8d29 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -906,6 +906,19 @@ int eDVBFrontend::readFrontendData(int type) } else if (strstr(m_description, "BCM4506") || strstr(m_description, "BCM4505")) ret = (snr * 100) >> 8; + else if (!strcmp(m_description, "CXD1981")) + { + int mse = (~snr) & 0xFF; + switch (parm_u_qam_modulation) { + case QAM_16: + case QAM_64: + case QAM_256: ret = (int)(-950 * log(((double)mse) / 760)); break; + case QAM_32: + case QAM_128: ret = (int)(-875 * log(((double)mse) / 650)); break; + + default: break; + } + } if (type == signalQuality) { @@ -1076,6 +1089,7 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS & case FEC_AUTO: tmp = eDVBFrontendParametersSatellite::FEC_Auto; break; default: eDebug("got unsupported FEC from frontend! report as FEC_AUTO!\n"); } + PutToDict(dict, "fec_inner", tmp); switch (p[0].u.data) { @@ -1124,7 +1138,7 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS & PutToDict(dict, "orbital_position", orb_pos); PutToDict(dict, "polarization", polarization); - switch(parm_u_qpsk_fec_inner) + switch((int)parm_u_qpsk_fec_inner) { case FEC_1_2: tmp = eDVBFrontendParametersSatellite::FEC_1_2; break; case FEC_2_3: tmp = eDVBFrontendParametersSatellite::FEC_2_3; break; @@ -1458,9 +1472,11 @@ int eDVBFrontend::readInputpower() return 0; int power=m_slotid; // this is needed for read inputpower from the correct tuner ! char proc_name[64]; - sprintf(proc_name, "/proc/stb/fp/lnb_sense%d", m_slotid); - FILE *f=fopen(proc_name, "r"); - if (f) + char proc_name2[64]; + sprintf(proc_name, "/proc/stb/frontend/%d/lnb_sense", m_slotid); + sprintf(proc_name2, "/proc/stb/fp/lnb_sense%d", m_slotid); + FILE *f; + if ((f=fopen(proc_name, "r")) || (f=fopen(proc_name2, "r"))) { if (fscanf(f, "%d", &power) != 1) eDebug("read %s failed!! (%m)", proc_name);