From 6771e5e86cdffb21e70947ac14b82efe3f190699 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 9 May 2016 09:24:28 +0200 Subject: [PATCH] DSD demod: fixes for Serial DV (1) --- plugins/channel/demoddsd/dsddecoder.h | 1 + plugins/channel/demoddsd/dsddemod.cpp | 2 ++ sdrbase/dsp/dvserialworker.cpp | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/channel/demoddsd/dsddecoder.h b/plugins/channel/demoddsd/dsddecoder.h index dcc1591bb..fa06b1b0d 100644 --- a/plugins/channel/demoddsd/dsddecoder.h +++ b/plugins/channel/demoddsd/dsddecoder.h @@ -31,6 +31,7 @@ public: void pushSample(short sample) { m_decoder.run(sample); } short *getAudio(int& nbSamples) { return m_decoder.getAudio(nbSamples); } void resetAudio() { m_decoder.resetAudio(); } + void enableMbelib(bool enable) { m_decoder.enableMbelib(enable); } bool mbeDVReady() const { return m_decoder.mbeDVReady(); } void resetMbeDV() { m_decoder.resetMbeDV(); } diff --git a/plugins/channel/demoddsd/dsddemod.cpp b/plugins/channel/demoddsd/dsddemod.cpp index 1d4da50cd..3b373c7a2 100644 --- a/plugins/channel/demoddsd/dsddemod.cpp +++ b/plugins/channel/demoddsd/dsddemod.cpp @@ -100,6 +100,8 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto m_settingsMutex.lock(); m_scopeSampleBuffer.clear(); + m_dsdDecoder.enableMbelib(!DSPEngine::instance()->hasDVSerialSupport()); // disable mbelib if DV serial support is present and activated else enable it + for (SampleVector::const_iterator it = begin; it != end; ++it) { Complex c(it->real(), it->imag()); diff --git a/sdrbase/dsp/dvserialworker.cpp b/sdrbase/dsp/dvserialworker.cpp index ec99a8d04..51939197b 100644 --- a/sdrbase/dsp/dvserialworker.cpp +++ b/sdrbase/dsp/dvserialworker.cpp @@ -84,6 +84,10 @@ void DVSerialWorker::handleInputMessages() // upsample6(m_dvAudioSamples, m_audioSamples, SerialDV::MBE_AUDIO_BLOCK_SIZE); // decodeMsg->getAudioFifo()->write((const quint8 *) m_audioSamples, SerialDV::MBE_AUDIO_BLOCK_SIZE * 6, 10); } + else + { + qDebug("DVSerialWorker::handleInputMessages: MsgMbeDecode: decode failed"); + } } delete message; @@ -100,7 +104,7 @@ void DVSerialWorker::upsample6(short *in, int nbSamplesIn, AudioFifo *audioFifo) for (int j = 1; j < 7; j++) { - upsample = (qint16) ((cur*i + prev*(6-i)) / 6); + upsample = (qint16) ((cur*j + prev*(6-j)) / 6); m_audioBuffer[m_audioBufferFill].l = upsample; m_audioBuffer[m_audioBufferFill].r = upsample; ++m_audioBufferFill;