mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-20 06:38:36 -04:00
SDRdaemon plugin: apply buffer r/w correction at all ticks. Updated readme with warnings for Windows
This commit is contained in:
@@ -44,7 +44,8 @@ SDRdaemonUDPHandler::SDRdaemonUDPHandler(SampleFifo *sampleFifo, MessageQueue *o
|
||||
m_readLengthSamples(0),
|
||||
m_readLength(0),
|
||||
m_throttleToggle(false),
|
||||
m_rateDivider(1000/SDRDAEMON_THROTTLE_MS)
|
||||
m_rateDivider(1000/SDRDAEMON_THROTTLE_MS),
|
||||
m_autoCorrBuffer(false)
|
||||
{
|
||||
m_udpBuf = new char[SDRdaemonBuffer::m_udpPayloadSize];
|
||||
}
|
||||
@@ -223,6 +224,10 @@ void SDRdaemonUDPHandler::tick()
|
||||
m_throttleToggle = !m_throttleToggle;
|
||||
}
|
||||
|
||||
if (m_autoCorrBuffer) {
|
||||
m_readLengthSamples += m_sdrDaemonBuffer.getRWBalanceCorrection();
|
||||
}
|
||||
|
||||
// read samples directly feeding the SampleFifo (no callback)
|
||||
m_sampleFifo->write(reinterpret_cast<quint8*>(m_sdrDaemonBuffer.readData(m_readLength)), m_readLength);
|
||||
m_samplesCount += m_readLengthSamples;
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
void stop();
|
||||
void configureUDPLink(const QString& address, quint16 port);
|
||||
void setAutoFollowRate(bool autoFollowRate) { m_sdrDaemonBuffer.setAutoFollowRate(autoFollowRate); }
|
||||
void setAutoCorrBuffer(bool autoCorrBuffer) { m_sdrDaemonBuffer.setAutoCorrBuffer(autoCorrBuffer); }
|
||||
void setAutoCorrBuffer(bool autoCorrBuffer) { m_autoCorrBuffer = autoCorrBuffer; m_sdrDaemonBuffer.setAutoCorrBuffer(autoCorrBuffer); }
|
||||
void resetIndexes() { m_sdrDaemonBuffer.setResetIndexes(); }
|
||||
public slots:
|
||||
void dataReadyRead();
|
||||
@@ -71,6 +71,7 @@ private:
|
||||
uint32_t m_readLength;
|
||||
bool m_throttleToggle;
|
||||
int m_rateDivider;
|
||||
bool m_autoCorrBuffer;
|
||||
|
||||
void setSamplerate(uint32_t samplerate);
|
||||
void processData();
|
||||
|
||||
Reference in New Issue
Block a user