diff --git a/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp b/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp index e7413a53f..38665418f 100644 --- a/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp +++ b/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp @@ -535,6 +535,18 @@ void RemoteTCPSinkSink::processCommand() int sampleRate = RemoteTCPProtocol::extractUInt32(&cmd[1]); qDebug() << "RemoteTCPSinkSink::processCommand: set sample rate " << sampleRate; ChannelWebAPIUtils::setDevSampleRate(m_deviceIndex, sampleRate); + if (m_settings.m_protocol == RemoteTCPSinkSettings::RTL0) + { + // Match channel sample rate with device sample rate for RTL0 protocol + ChannelWebAPIUtils::setSoftDecim(m_deviceIndex, 0); + settings.m_channelSampleRate = sampleRate; + if (m_messageQueueToGUI) { + m_messageQueueToGUI->push(RemoteTCPSink::MsgConfigureRemoteTCPSink::create(settings, {"channelSampleRate"}, false, true)); + } + if (m_messageQueueToChannel) { + m_messageQueueToChannel->push(RemoteTCPSink::MsgConfigureRemoteTCPSink::create(settings, {"channelSampleRate"}, false, true)); + } + } break; } case RemoteTCPProtocol::setTunerGainMode: diff --git a/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp b/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp index fd6e5568e..f9c69e632 100644 --- a/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp +++ b/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp @@ -46,6 +46,7 @@ RemoteTCPInputTCPHandler::RemoteTCPInputTCPHandler(SampleSinkFifo *sampleFifo, D m_converterBufferNbSamples(0), m_settings() { + m_sampleFifo->setSize(5000000); // Start with large FIFO, to avoid having to resize m_tcpBuf = new char[m_sampleFifo->size()*2*4]; m_timer.setInterval(125); connect(&m_reconnectTimer, SIGNAL(timeout()), this, SLOT(reconnect())); @@ -455,8 +456,7 @@ void RemoteTCPInputTCPHandler::applySettings(const RemoteTCPInputSettings& setti if ((settings.m_channelSampleRate != m_settings.m_channelSampleRate) || force) { // Resize FIFO to give us 1 second - // Can't do this while running - if (!m_running && settingsKeys.contains("channelSampleRate") && settings.m_channelSampleRate > (qint32)m_sampleFifo->size()) + if ((settingsKeys.contains("channelSampleRate") || force) && (settings.m_channelSampleRate > (qint32)m_sampleFifo->size())) { qDebug() << "RemoteTCPInputTCPHandler::applySettings: Resizing sample FIFO from " << m_sampleFifo->size() << "to" << settings.m_channelSampleRate; m_sampleFifo->setSize(settings.m_channelSampleRate); @@ -692,7 +692,7 @@ void RemoteTCPInputTCPHandler::processData() qDebug() << "Buffer primed bytesAvailable:" << m_dataSocket->bytesAvailable(); m_fillBuffer = false; m_prevDateTime = QDateTime::currentDateTime(); - factor = 6.0f / 8.0f; + factor = 1.0f / 4.0f; // If this is too high, samples can just be dropped downstream } } else