From 71462252228ad3ae872a29aa4a6a3b1aa4c679fa Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 4 Sep 2018 15:02:45 +0200 Subject: [PATCH] SDRdaemonSinkGui: removed rate control code --- .../sdrdaemonsink/sdrdaemonsinkgui.cpp | 36 ------------------- .../sdrdaemonsink/sdrdaemonsinkgui.h | 4 --- 2 files changed, 40 deletions(-) diff --git a/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp b/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp index 561842d4c..0de35c635 100644 --- a/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp +++ b/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.cpp @@ -58,9 +58,6 @@ SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceUISet *deviceUISet, QWidget* parent) : m_lastCountUnrecoverable = 0; m_lastCountRecovered = 0; m_lastSampleCount = 0; - m_lastTimestampRateCorrection = 0; - m_nbSamplesSinceRateCorrection = 0; - m_chunkSizeCorrection = 0; m_resetCounts = true; m_paletteGreenText.setColor(QPalette::WindowText, Qt::green); @@ -446,9 +443,6 @@ void SDRdaemonSinkGui::on_startStop_toggled(bool checked) { if (m_doApplySettings) { - m_nbSamplesSinceRateCorrection = 0; - m_lastTimestampRateCorrection = 0; - SDRdaemonSinkOutput::MsgStartStop *message = SDRdaemonSinkOutput::MsgStartStop::create(checked); m_deviceSampleSink->getInputMessageQueue()->push(message); } @@ -598,22 +592,6 @@ void SDRdaemonSinkGui::analyzeApiReply(const QJsonObject& jsonObject) { ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : blue; }"); } - else - { - if (m_lastTimestampRateCorrection == 0) { - m_lastTimestampRateCorrection = timestampUs; - } - - //if ((timestampUs - m_lastTimestampRateCorrection > 300e6) && ((queueLengthPercent > 60) || (queueLengthPercent < 40))) - if ((m_nbSamplesSinceRateCorrection > 20000000) && ((queueLengthPercent > 60) || (queueLengthPercent < 40))) - { - sampleRateCorrection(queueLength, queueSize, timestampUs - m_lastTimestampRateCorrection); - m_lastTimestampRateCorrection = timestampUs; - m_nbSamplesSinceRateCorrection = 0; - } - - m_nbSamplesSinceRateCorrection += sampleCountDelta; - } double remoteStreamRate = sampleCountDelta*1e6 / (double) (timestampUs - m_lastTimestampUs); @@ -652,17 +630,3 @@ void SDRdaemonSinkGui::analyzeApiReply(const QJsonObject& jsonObject) ui->infoText->setText(infoLine); } } - -void SDRdaemonSinkGui::sampleRateCorrection(int queueLength, int queueSize, int64_t timeDeltaUs) -{ - int nbBlocksDiff = queueLength - (queueSize/2); - int nbSamplesDiff = nbBlocksDiff * 127 * 127; - float sampleCorr = (nbSamplesDiff * 50000.0) / timeDeltaUs; // correction for ~50ms chunks (50000 us) - int chunkCorr = -roundf(sampleCorr); - m_chunkSizeCorrection += chunkCorr; - -// qDebug("SDRdaemonSinkGui::sampleRateCorrection: %d (%d) samples", m_chunkSizeCorrection, chunkCorr); -// -// SDRdaemonSinkOutput::MsgConfigureSDRdaemonSinkChunkCorrection* message = SDRdaemonSinkOutput::MsgConfigureSDRdaemonSinkChunkCorrection::create(m_chunkSizeCorrection); -// m_deviceSampleSink->getInputMessageQueue()->push(message); -} diff --git a/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.h b/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.h index 2e719c52f..683a13774 100644 --- a/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.h +++ b/plugins/samplesink/sdrdaemonsink/sdrdaemonsinkgui.h @@ -111,9 +111,6 @@ private: uint32_t m_lastCountRecovered; uint32_t m_lastSampleCount; uint64_t m_lastTimestampUs; - uint64_t m_lastTimestampRateCorrection; - uint32_t m_nbSamplesSinceRateCorrection; - int m_chunkSizeCorrection; bool m_resetCounts; QTime m_time; @@ -137,7 +134,6 @@ private: void displayEventStatus(int recoverableCount, int unrecoverableCount); void displayEventTimer(); void analyzeApiReply(const QJsonObject& jsonObject); - void sampleRateCorrection(int queueLength, int queueSize, int64_t timeDeltaUs); private slots: void handleInputMessages();