diff --git a/plugins/channelrx/demodam/amdemodsink.cpp b/plugins/channelrx/demodam/amdemodsink.cpp index a5140b9ae..5b9aea881 100644 --- a/plugins/channelrx/demodam/amdemodsink.cpp +++ b/plugins/channelrx/demodam/amdemodsink.cpp @@ -95,17 +95,6 @@ void AMDemodSink::feed(const SampleVector::const_iterator& begin, const SampleVe } } } - - if (m_audioBufferFill > 0) - { - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) { - qDebug("AMDemodSink::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - } } void AMDemodSink::processOneSample(Complex &ci) diff --git a/plugins/channelrx/demodbfm/bfmdemodsink.cpp b/plugins/channelrx/demodbfm/bfmdemodsink.cpp index 22ef69f2e..8667edb67 100644 --- a/plugins/channelrx/demodbfm/bfmdemodsink.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodsink.cpp @@ -72,7 +72,7 @@ BFMDemodSink::BFMDemodSink() : m_deemphasisFilterY.configure(default_deemphasis * m_audioSampleRate * 1.0e-6); m_phaseDiscri.setFMScaling(384000/m_fmExcursion); - m_audioBuffer.resize(16384); + m_audioBuffer.resize(1<<14); m_audioBufferFill = 0; applySettings(m_settings, true); @@ -229,22 +229,11 @@ void BFMDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV } } - if (m_audioBufferFill > 0) + if (m_spectrumSink && (m_sampleBuffer.size() != 0)) { - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) { - qDebug("BFMDemodSink::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - } - - if (m_spectrumSink) { m_spectrumSink->feed(m_sampleBuffer.begin(), m_sampleBuffer.end(), true); + m_sampleBuffer.clear(); } - - m_sampleBuffer.clear(); } void BFMDemodSink::applyAudioSampleRate(int sampleRate) diff --git a/plugins/channelrx/demodfreedv/freedvdemodsink.cpp b/plugins/channelrx/demodfreedv/freedvdemodsink.cpp index 6171a02c0..7d14072aa 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodsink.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemodsink.cpp @@ -211,21 +211,11 @@ void FreeDVDemodSink::feed(const SampleVector::const_iterator& begin, const Samp } } - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) - { - qDebug("FreeDVDemod::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - - if (m_spectrumSink) - { + if (m_spectrumSink && (m_sampleBuffer.size() != 0)) + { m_spectrumSink->feed(m_sampleBuffer.begin(), m_sampleBuffer.end(), true); + m_sampleBuffer.clear(); } - - m_sampleBuffer.clear(); } void FreeDVDemodSink::processOneSample(Complex &ci) diff --git a/plugins/channelrx/demodnfm/nfmdemodsink.cpp b/plugins/channelrx/demodnfm/nfmdemodsink.cpp index 6e69f6a1d..17e9cc7ef 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsink.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodsink.cpp @@ -65,7 +65,7 @@ NFMDemodSink::NFMDemodSink() : m_squelchDelayLine(24000), m_messageQueueToGUI(nullptr) { - m_audioBuffer.resize(1<<16); + m_audioBuffer.resize(1<<14); m_demodBuffer.resize(1<<12); m_demodBufferFill = 0; @@ -110,17 +110,6 @@ void NFMDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV } } } - - if (m_audioBufferFill > 0) - { - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) { - qDebug("NFMDemodSink::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - } } void NFMDemodSink::processOneSample(Complex &ci) diff --git a/plugins/channelrx/demodssb/ssbdemodsink.cpp b/plugins/channelrx/demodssb/ssbdemodsink.cpp index b3576b6c0..4f5b616b3 100644 --- a/plugins/channelrx/demodssb/ssbdemodsink.cpp +++ b/plugins/channelrx/demodssb/ssbdemodsink.cpp @@ -241,19 +241,11 @@ void SSBDemodSink::processOneSample(Complex &ci) } } - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) { - qDebug("SSBDemodSink::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - - if (m_spectrumSink != 0) { + if (m_spectrumSink && (m_sampleBuffer.size() != 0)) + { m_spectrumSink->feed(m_sampleBuffer.begin(), m_sampleBuffer.end(), !m_dsb); + m_sampleBuffer.clear(); } - - m_sampleBuffer.clear(); } void SSBDemodSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force) diff --git a/plugins/channelrx/demodvor/vordemodsink.cpp b/plugins/channelrx/demodvor/vordemodsink.cpp index 0a2db5385..b7f046dad 100644 --- a/plugins/channelrx/demodvor/vordemodsink.cpp +++ b/plugins/channelrx/demodvor/vordemodsink.cpp @@ -100,17 +100,6 @@ void VORDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV } } } - - if (m_audioBufferFill > 0) - { - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) { - qDebug("VORDemodSink::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - } } void VORDemodSink::processOneAudioSample(Complex &ci) diff --git a/plugins/channelrx/demodvorsc/vordemodscsink.cpp b/plugins/channelrx/demodvorsc/vordemodscsink.cpp index 46caad290..0ca67c9d1 100644 --- a/plugins/channelrx/demodvorsc/vordemodscsink.cpp +++ b/plugins/channelrx/demodvorsc/vordemodscsink.cpp @@ -89,17 +89,6 @@ void VORDemodSCSink::feed(const SampleVector::const_iterator& begin, const Sampl } } } - - if (m_audioBufferFill > 0) - { - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) { - qDebug("VORDemodSCSink::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - } } void VORDemodSCSink::processOneAudioSample(Complex &ci) diff --git a/plugins/channelrx/demodwfm/wfmdemodsink.cpp b/plugins/channelrx/demodwfm/wfmdemodsink.cpp index 2ae1af031..d81e83683 100644 --- a/plugins/channelrx/demodwfm/wfmdemodsink.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodsink.cpp @@ -49,7 +49,7 @@ WFMDemodSink::WFMDemodSink() : m_rfFilter = new fftfilt(-50000.0 / 384000.0, 50000.0 / 384000.0, m_rfFilterFftLength); m_phaseDiscri.setFMScaling(384000/75000); - m_audioBuffer.resize(16384); + m_audioBuffer.resize(1<<14); m_audioBufferFill = 0; m_demodBuffer.resize(1<<12); @@ -119,7 +119,6 @@ void WFMDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV if (m_interpolator.decimate(&m_interpolatorDistanceRemain, e, &ci)) { qint16 sample = (qint16)(ci.real() * 3276.8f * m_settings.m_volume); - m_sampleBuffer.push_back(Sample(sample, sample)); m_audioBuffer[m_audioBufferFill].l = sample; m_audioBuffer[m_audioBufferFill].r = sample; @@ -158,19 +157,6 @@ void WFMDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV } } } - - if (m_audioBufferFill > 0) - { - uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill); - - if (res != m_audioBufferFill) { - qDebug("WFMDemodSink::feed: %u/%u tail samples written", res, m_audioBufferFill); - } - - m_audioBufferFill = 0; - } - - m_sampleBuffer.clear(); } void WFMDemodSink::applyAudioSampleRate(int sampleRate) diff --git a/plugins/channelrx/demodwfm/wfmdemodsink.h b/plugins/channelrx/demodwfm/wfmdemodsink.h index ad3018538..0c8c2b5ef 100644 --- a/plugins/channelrx/demodwfm/wfmdemodsink.h +++ b/plugins/channelrx/demodwfm/wfmdemodsink.h @@ -116,7 +116,6 @@ private: uint m_audioBufferFill; AudioFifo m_audioFifo; - SampleVector m_sampleBuffer; PhaseDiscriminators m_phaseDiscri; QVector m_demodBuffer;