frontend: correct snr/db value for tuner "Si216x" (dvb-t mode)
authorDima73 <Dima-73@inbox.lv>
Fri, 25 Dec 2015 19:52:31 +0000 (21:52 +0200)
committerDima73 <Dima-73@inbox.lv>
Fri, 25 Dec 2015 19:52:31 +0000 (21:52 +0200)
lib/dvb/frontend.cpp

index f163b8b..a9b0513 100644 (file)
@@ -781,6 +781,7 @@ void eDVBFrontend::calculateSignalQuality(int snr, int &signalquality, int &sign
 {
        int sat_max = 1600; // for stv0288 / bsbe2
        int ret = 0x12345678;
 {
        int sat_max = 1600; // for stv0288 / bsbe2
        int ret = 0x12345678;
+       int ter_max = 2900;
        if (!strcmp(m_description, "AVL2108")) // ET9000
        {
                ret = (int)(snr / 40.5);
        if (!strcmp(m_description, "AVL2108")) // ET9000
        {
                ret = (int)(snr / 40.5);
@@ -989,7 +990,7 @@ void eDVBFrontend::calculateSignalQuality(int snr, int &signalquality, int &sign
                {
                        case eDVBFrontendParametersTerrestrial::System_DVB_T:
                        case eDVBFrontendParametersTerrestrial::System_DVB_T2: 
                {
                        case eDVBFrontendParametersTerrestrial::System_DVB_T:
                        case eDVBFrontendParametersTerrestrial::System_DVB_T2: 
-                       case eDVBFrontendParametersTerrestrial::System_DVB_T_T2: ret = (int)((snr * 10) / 15); break;
+                       case eDVBFrontendParametersTerrestrial::System_DVB_T_T2: ret = (int)(snr / 58); ter_max = 1700; break;
                        default: break;
                }
        }
                        default: break;
                }
        }
@@ -1012,7 +1013,7 @@ void eDVBFrontend::calculateSignalQuality(int snr, int &signalquality, int &sign
                        signalquality = (ret >= 4200 ? 65536 : ret * 65536 / 4200);
                        break;
                case feTerrestrial: // we assume a max of 29db here
                        signalquality = (ret >= 4200 ? 65536 : ret * 65536 / 4200);
                        break;
                case feTerrestrial: // we assume a max of 29db here
-                       signalquality = (ret >= 2900 ? 65536 : ret * 65536 / 2900);
+                       signalquality = (ret >= ter_max ? 65536 : ret * 65536 / ter_max);
                        break;
                case feATSC: // we assume a max of 42db here
                        signalquality = (ret >= 4200 ? 65536 : ret * 65536 / 4200);
                        break;
                case feATSC: // we assume a max of 42db here
                        signalquality = (ret >= 4200 ? 65536 : ret * 65536 / 4200);