--- scan-s2-88afcf030566/scan.c.orig 2008-11-01 10:09:43.000000000 +0100 +++ scan-s2-88afcf030566/scan.c 2008-11-01 15:55:14.000000000 +0100 @@ -906,10 +906,7 @@ // New transponder t = alloc_transponder(tn.frequency); - // For sattelites start with DVB-S, it will switch to DVB-S2 if DVB-S gives no results - if(current_tp->delivery_system == SYS_DVBS || current_tp->delivery_system == SYS_DVBS2) { - tn.delivery_system = SYS_DVBS; - } + tn.delivery_system = current_tp->delivery_system; copy_transponder(t, &tn); } @@ -1578,7 +1575,10 @@ if_freq = abs(t->frequency - lnb_type.low_val); } if (verbosity >= 2) + if (t->delivery_system == SYS_DVBS) dprintf(1,"DVB-S IF freq is %d\n", if_freq); + else if (t->delivery_system == SYS_DVBS2) + dprintf(1,"DVB-S2 IF freq is %d\n", if_freq); } @@ -1640,7 +1640,8 @@ // get the actual parameters from the driver for that channel if ((ioctl(frontend_fd, FE_GET_PROPERTY, &cmdseq)) == -1) { perror("FE_GET_PROPERTY failed"); - return; + t->last_tuning_failed = 1; + return -1; } t->delivery_system = p[0].u.data; @@ -1722,12 +1723,6 @@ rc = tune_to_transponder(frontend_fd, t); - // If scan failed and it's a DVB-S system, try DVB-S2 before giving up - if (rc != 0 && t->delivery_system == SYS_DVBS) { - t->delivery_system = SYS_DVBS2; - rc = tune_to_transponder(frontend_fd, t); - } - if (rc == 0) { return 0; } @@ -1992,6 +1987,42 @@ t->frequency, pol[0], t->symbol_rate, fec2str(t->fec), rolloff2str(t->rolloff), qam2str(t->modulation)); } + else if (sscanf(buf, "S2 %u %1[HVLR] %u %4s %4s %6s\n", &f, pol, &sr, fec, rolloff, qam) >= 3) { + t = alloc_transponder(f); + t->delivery_system = SYS_DVBS2; + t->modulation = QAM_AUTO; + t->rolloff = ROLLOFF_AUTO; + t->fec = FEC_AUTO; + switch(pol[0]) + { + case 'H': + case 'L': + t->polarisation = POLARISATION_HORIZONTAL; + break; + default: + t->polarisation = POLARISATION_VERTICAL;; + break; + } + t->inversion = spectral_inversion; + t->symbol_rate = sr; + + // parse optional parameters + if(strlen(fec) > 0) { + t->fec = str2fec(fec); + } + + if(strlen(rolloff) > 0) { + t->rolloff = str2rolloff(rolloff); + } + + if(strlen(qam) > 0) { + t->modulation = str2qam(qam); + } + + info("initial transponder %u %c %d %s %s %s\n", + t->frequency, + pol[0], t->symbol_rate, fec2str(t->fec), rolloff2str(t->rolloff), qam2str(t->modulation)); + } else if (sscanf(buf, "C %u %u %4s %6s\n", &f, &sr, fec, qam) >= 2) { t = alloc_transponder(f); t->delivery_system = SYS_DVBC_ANNEX_AC;