diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index 8942fbc6e..214c9b7b5 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -346,8 +346,10 @@ void DATVDemodGUI::displaySettings() } #endif - if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) { + if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) + { ui->statusText->clear(); + ui->statusText->setStyleSheet("QLabel { background:rgb(79,79,79); }"); } ui->cmbFilter->setCurrentIndex((int) m_settings.m_filter); @@ -606,8 +608,10 @@ void DATVDemodGUI::on_cmbStandard_currentIndexChanged(int index) } #endif - if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) { + if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) + { ui->statusText->clear(); + ui->statusText->setStyleSheet("QLabel { background:rgb(79,79,79); }"); } m_settings.validateSystemConfiguration(); diff --git a/plugins/channelrx/demoddatv/datvdemodgui.ui b/plugins/channelrx/demoddatv/datvdemodgui.ui index a8ead08e6..93f51d6fd 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.ui +++ b/plugins/channelrx/demoddatv/datvdemodgui.ui @@ -720,6 +720,9 @@ 19 + + Modulation detection status + ... diff --git a/plugins/channelrx/demoddatv/datvdemodsink.cpp b/plugins/channelrx/demoddatv/datvdemodsink.cpp index cd781684f..d7941c98f 100644 --- a/plugins/channelrx/demoddatv/datvdemodsink.cpp +++ b/plugins/channelrx/demoddatv/datvdemodsink.cpp @@ -177,7 +177,6 @@ bool DATVDemodSink::playVideo() m_objVideoStream->MultiThreaded = true; m_objVideoStream->ThreadTimeOut = DATVideoRenderThread::videoThreadTimeoutMs; m_objRenderThread->start(); - return true; } return false; @@ -893,7 +892,7 @@ void DATVDemodSink::InitDATVS2Framework() m_objCfg.fastlock = m_settings.m_fastLock; m_objCfg.sampler = m_settings.m_filter; - m_objCfg.rolloff = m_settings.m_rollOff; //0...1 + m_objCfg.rolloff = m_settings.m_rollOff * 1.001f; //0...1 and correct 0.2 bug m_objCfg.rrc_rej = (float) m_settings.m_excursion; //dB m_objCfg.rrc_steps = 0; //auto diff --git a/plugins/channelrx/demoddatv/datvideorender.h b/plugins/channelrx/demoddatv/datvideorender.h index 6ac6ae90c..b891d9398 100644 --- a/plugins/channelrx/demoddatv/datvideorender.h +++ b/plugins/channelrx/demoddatv/datvideorender.h @@ -234,8 +234,7 @@ class DATVideoRenderThread : public QThread m_renderingVideo = false; } - void stopRendering() - { + void stopRendering() { m_renderingVideo = false; } diff --git a/plugins/channelrx/demoddatv/leansdr/dvbs2.h b/plugins/channelrx/demoddatv/leansdr/dvbs2.h index d60b4b882..185090db8 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvbs2.h +++ b/plugins/channelrx/demoddatv/leansdr/dvbs2.h @@ -793,7 +793,11 @@ struct s2_frame_receiver : runnable void run_frame_detect() { - if ( discard ) + cstln->m_rateCode = -1; + cstln->m_typeCode = -1; + cstln->m_setByModcod = cstln->m_typeCode != -1; + + if (discard) { size_t d = std::min(discard, in.readable()); in.read(d); @@ -921,7 +925,7 @@ struct s2_frame_receiver : runnable if (sof_errors >= S2_MAX_ERR_SOF) { if (sch->debug2) { - fprintf(stderr, "Too many errors in SOF (%u/26)\n", sof_errors); + fprintf(stderr, "Too many errors in SOF (%u/%u)\n", sof_errors, S2_MAX_ERR_SOF); } in.read(ss.p-in.rd()); @@ -1087,7 +1091,7 @@ struct s2_frame_receiver : runnable cstln = dcstln; // Used by GUI cstln->m_rateCode = mcinfo->rate < code_rate::FEC_COUNT ? mcinfo->rate : -1; cstln->m_typeCode = mcinfo->c < cstln_base::predef::COUNT ? mcinfo->c : -1; - cstln->m_setByModcod = true; + cstln->m_setByModcod = cstln->m_typeCode != -1; // Output special slot with PLS information. pout->is_pls = true; pout->pls = pls; @@ -1658,17 +1662,19 @@ struct s2_frame_receiver : runnable fprintf(stderr, "match_frame\n"); } + bool pilots = pls->pilots; // force to true for lighter processing // With pilots: Use first block of data slots. // Without pilots: Use whole frame. - int ns = pls->pilots ? 16*90 : S*90; + int ns = pilots ? 16*90 : S*90; // Pilots: steps of ~700 ppm (= 1 cycle between pilots) // No pilots, normal frames: steps of ~30(QPSK) - ~80(32APSK) ppm // No pilots, short frames: steps of ~120(QPSK) - 300(32APSK) ppm - int nwrap = pls->pilots ? 16*90+pilot.LENGTH : S*90+sof.LENGTH; + int nwrap = pilots ? 16*90+pilot.LENGTH : S*90+sof.LENGTH; // Frequency search range. - int sliprange = pls->pilots ? 10 : 50; // TBD Customizable ? + int sliprange = pilots ? 10 : 50; // TBD Customizable ? float besterr = 1e99; float bestslip = 0; // Avoid compiler warning + int err_div = ns * cstln_amp * cstln_amp; for (int slip = -sliprange; slip <= sliprange; ++slip) { @@ -1685,12 +1691,12 @@ struct s2_frame_receiver : runnable std::complex p = interp_next(&ssl) * ssl.gain; typename cstln_lut::result *cr = dcstln->lookup(p.real(), p.imag()); - std::complex &cp = dcstln->symbols[cr->symbol]; - std::complex ev(p.real()-cp.real(), p.imag()-cp.imag()); - err += cnorm2(ev); + float evreal = p.real() - dcstln->symbols[cr->symbol].real(); + float evimag = p.imag() - dcstln->symbols[cr->symbol].imag(); + err += evreal*evreal + evimag*evimag; } - err /= ns * cstln_amp * cstln_amp; + err /= err_div; if (err < besterr) {