diff --git a/plugins/samplesink/testsink/readme.md b/plugins/samplesink/testsink/readme.md
index 63158a909..fee3419a1 100644
--- a/plugins/samplesink/testsink/readme.md
+++ b/plugins/samplesink/testsink/readme.md
@@ -14,6 +14,8 @@ The top and bottom bars of the device window are described [here](../../../sdrgu

+Note: the associated spectrum in the independent spectrum window shows the baseband. The interpolated output appears in the attached spectrum view below the settings.
+
1: Start/Stop
Device start / stop button.
diff --git a/plugins/samplesink/testsink/testsinkgui.h b/plugins/samplesink/testsink/testsinkgui.h
index 7e5408e2b..3d6a1892e 100644
--- a/plugins/samplesink/testsink/testsinkgui.h
+++ b/plugins/samplesink/testsink/testsinkgui.h
@@ -67,7 +67,7 @@ private:
int m_lastEngineState;
MessageQueue m_inputMessageQueue;
SpectrumVis* m_spectrumVis;
- static const int m_MinimumWidth = 360;
+ static const int m_MinimumWidth = 364;
static const int m_MinimumHeight = 200 + 20 + 10 + 4*22 + 5;
void blockApplySettings(bool block) { m_doApplySettings = !block; }
diff --git a/plugins/samplesink/testsink/testsinkgui.ui b/plugins/samplesink/testsink/testsinkgui.ui
index 7858fc1c5..37ec64dc4 100644
--- a/plugins/samplesink/testsink/testsinkgui.ui
+++ b/plugins/samplesink/testsink/testsinkgui.ui
@@ -280,13 +280,6 @@
- -
-
-
- Qt::Vertical
-
-
-
-
@@ -347,12 +340,6 @@
QToolButton
-
- ValueDial
- QWidget
-
- 1
-
GLSpectrum
QWidget
@@ -365,6 +352,12 @@
1
+
+ ValueDial
+ QWidget
+
+ 1
+
diff --git a/plugins/samplesink/testsink/testsinkoutput.cpp b/plugins/samplesink/testsink/testsinkoutput.cpp
index c36f21740..0fc27f2ed 100644
--- a/plugins/samplesink/testsink/testsinkoutput.cpp
+++ b/plugins/samplesink/testsink/testsinkoutput.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2019-2020, 2022 Edouard Griffiths, F4EXB //
+// Copyright (C) 2019-2026 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
@@ -65,8 +65,6 @@ void TestSinkOutput::init()
bool TestSinkOutput::start()
{
- QMutexLocker mutexLocker(&m_mutex);
-
if (m_running) {
return true;
}
@@ -94,8 +92,6 @@ bool TestSinkOutput::start()
void TestSinkOutput::stop()
{
- QMutexLocker mutexLocker(&m_mutex);
-
if (!m_running) {
return;
}
@@ -206,8 +202,8 @@ bool TestSinkOutput::handleMessage(const Message& message)
void TestSinkOutput::applySettings(const TestSinkSettings& settings, const QList& settingsKeys, bool force)
{
qDebug() << "TestSinkOutput::applySettings: force:" << force << settings.getDebugString(settingsKeys, force);
- QMutexLocker mutexLocker(&m_mutex);
bool forwardChange = false;
+ bool needRestart = false;
if (force || settingsKeys.contains("centerFrequency"))
{
@@ -218,25 +214,21 @@ void TestSinkOutput::applySettings(const TestSinkSettings& settings, const QList
if (force || settingsKeys.contains("sampleRate"))
{
m_settings.m_sampleRate = settings.m_sampleRate;
-
- if (m_running) {
- m_testSinkWorker->setSamplerate(m_settings.m_sampleRate);
- }
-
+ needRestart = true;
forwardChange = true;
}
if (force || settingsKeys.contains("log2Interp"))
{
m_settings.m_log2Interp = settings.m_log2Interp;
-
- if (m_running) {
- m_testSinkWorker->setLog2Interpolation(m_settings.m_log2Interp);
- }
-
+ needRestart = true;
forwardChange = true;
}
-
+ if (needRestart && m_running)
+ {
+ stop();
+ start();
+ }
if (forwardChange)
{
qDebug("TestSinkOutput::applySettings: forward: m_centerFrequency: %llu m_sampleRate: %llu m_log2Interp: %d",
@@ -275,5 +267,3 @@ int TestSinkOutput::webapiRun(
return 200;
}
-
-
diff --git a/plugins/samplesink/testsink/testsinkoutput.h b/plugins/samplesink/testsink/testsinkoutput.h
index 0b694ffb5..02cd29d7d 100644
--- a/plugins/samplesink/testsink/testsinkoutput.h
+++ b/plugins/samplesink/testsink/testsinkoutput.h
@@ -2,7 +2,7 @@
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
// written by Christian Daniel //
// Copyright (C) 2014 John Greb //
-// Copyright (C) 2015-2020, 2022 Edouard Griffiths, F4EXB //
+// Copyright (C) 2015-2020, 2026 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
@@ -117,7 +117,6 @@ public:
private:
DeviceAPI *m_deviceAPI;
- QMutex m_mutex;
TestSinkSettings m_settings;
SpectrumVis m_spectrumVis;
std::ofstream m_ofstream;
diff --git a/plugins/samplesink/testsink/testsinkworker.cpp b/plugins/samplesink/testsink/testsinkworker.cpp
index cb92f0aa5..ab9787748 100644
--- a/plugins/samplesink/testsink/testsinkworker.cpp
+++ b/plugins/samplesink/testsink/testsinkworker.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2016-2017, 2019-2020 Edouard Griffiths, F4EXB //
+// Copyright (C) 2016-2017, 2019-2026 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
@@ -71,14 +71,6 @@ void TestSinkWorker::setSamplerate(int samplerate)
<< " new:" << samplerate
<< " old:" << m_samplerate;
- bool wasRunning = false;
-
- if (m_running)
- {
- stopWork();
- wasRunning = true;
- }
-
// resize sample FIFO
if (m_sampleFifo) {
m_sampleFifo->resize(SampleSourceFifo::getSizePolicy(samplerate));
@@ -87,13 +79,8 @@ void TestSinkWorker::setSamplerate(int samplerate)
// resize output buffer
if (m_buf) delete[] m_buf;
m_buf = new int16_t[samplerate*(1<