Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSD Demod - Fix loss of constellation #1883

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/channelrx/demodam/amdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ void AMDemodGUI::audioSelect(const QPoint& p)
qDebug("AMDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodbfm/bfmdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ void BFMDemodGUI::audioSelect(const QPoint& p)
qDebug("BFMDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demoddab/dabdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ void DABDemodGUI::audioSelect(const QPoint& p)
{
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demoddatv/datvdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ void DATVDemodGUI::audioSelect(const QPoint& p)
qDebug("DATVDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
12 changes: 11 additions & 1 deletion plugins/channelrx/demoddsd/dsddemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) :
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI),
m_running(false),
m_basebandSampleRate(0)
m_basebandSampleRate(0),
m_scopeXYSink(nullptr)
{
qDebug("DSDDemod::DSDDemod");
setObjectName(m_channelId);
Expand Down Expand Up @@ -175,6 +176,7 @@ void DSDDemod::start()
if (m_basebandSampleRate != 0) {
m_basebandSink->setBasebandSampleRate(m_basebandSampleRate);
}
m_basebandSink->setScopeXYSink(m_scopeXYSink);

m_thread->start();

Expand All @@ -198,6 +200,14 @@ void DSDDemod::stop()
m_thread->wait();
}

void DSDDemod::setScopeXYSink(BasebandSampleSink* sampleSink)
{
m_scopeXYSink = sampleSink;
if (m_running) {
m_basebandSink->setScopeXYSink(sampleSink);
}
}

bool DSDDemod::handleMessage(const Message& cmd)
{
qDebug() << "DSDDemod::handleMessage";
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demoddsd/dsddemod.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class DSDDemod : public BasebandSampleSink, public ChannelAPI {
SWGSDRangel::SWGChannelSettings& response);

uint32_t getNumberOfDeviceStreams() const;
void setScopeXYSink(BasebandSampleSink* sampleSink) { if (m_running) { m_basebandSink->setScopeXYSink(sampleSink); } }
void setScopeXYSink(BasebandSampleSink* sampleSink);
void configureMyPosition(float myLatitude, float myLongitude) { if (m_running) { m_basebandSink->configureMyPosition(myLatitude, myLongitude); } }
double getMagSq() { return m_running ? m_basebandSink->getMagSq() : 0.0; }
bool getSquelchOpen() const { return m_running && m_basebandSink->getSquelchOpen(); }
Expand Down Expand Up @@ -186,7 +186,7 @@ class DSDDemod : public BasebandSampleSink, public ChannelAPI {
DSDDemodSettings m_settings;
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
QHash<Feature*, DSDDemodSettings::AvailableAMBEFeature> m_availableAMBEFeatures;

BasebandSampleSink *m_scopeXYSink;
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;

Expand Down
6 changes: 6 additions & 0 deletions plugins/channelrx/demoddsd/dsddemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ bool DSDDemodGUI::handleMessage(const Message& message)
DSPSignalNotification& notif = (DSPSignalNotification&) message;
m_deviceCenterFrequency = notif.getCenterFrequency();
m_basebandSampleRate = notif.getSampleRate();
if (m_basebandSampleRate < 48000) {
setStatusText(QString("Sample rate must be >= 48000 Hz (Currently %1 Hz)").arg(m_basebandSampleRate));
} else {
setStatusText("");
}
ui->deltaFrequency->setValueRange(false, 7, -m_basebandSampleRate/2, m_basebandSampleRate/2);
ui->deltaFrequencyLabel->setToolTip(tr("Range %1 %L2 Hz").arg(QChar(0xB1)).arg(m_basebandSampleRate/2));
updateAbsoluteCenterFrequency();
Expand Down Expand Up @@ -602,6 +607,7 @@ void DSDDemodGUI::audioSelect(const QPoint& p)
qDebug("DSDDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
20 changes: 10 additions & 10 deletions plugins/channelrx/demoddsd/dsddemodgui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>650</width>
<width>500</width>
<height>392</height>
</size>
</property>
Expand Down Expand Up @@ -54,7 +54,7 @@
</property>
<property name="minimumSize">
<size>
<width>648</width>
<width>500</width>
<height>0</height>
</size>
</property>
Expand Down Expand Up @@ -533,7 +533,7 @@
<widget class="QLabel" name="formatStatusText">
<property name="minimumSize">
<size>
<width>595</width>
<width>480</width>
<height>0</height>
</size>
</property>
Expand Down Expand Up @@ -569,13 +569,13 @@
<rect>
<x>10</x>
<y>180</y>
<width>600</width>
<width>480</width>
<height>210</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<width>480</width>
<height>210</height>
</size>
</property>
Expand Down Expand Up @@ -1260,6 +1260,11 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
Expand All @@ -1278,11 +1283,6 @@
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>TVScreen</class>
<extends>QWidget</extends>
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodfreedv/freedvdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ void FreeDVDemodGUI::audioSelect(const QPoint& p)
qDebug("FreeDVDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 0 additions & 1 deletion plugins/channelrx/demodft8/ft8demodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "gui/basicchannelsettingsdialog.h"
#include "gui/devicestreamselectiondialog.h"
#include "gui/crightclickenabler.h"
#include "gui/audioselectdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
#include "util/db.h"
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodils/ilsdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,7 @@ void ILSDemodGUI::audioSelect(const QPoint& p)
qDebug("ILSDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodm17/m17demodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ void M17DemodGUI::audioSelect(const QPoint& p)
{
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodnfm/nfmdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ void NFMDemodGUI::audioSelect(const QPoint& p)
qDebug("NFMDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodssb/ssbdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ void SSBDemodGUI::audioSelect(const QPoint& p)
{
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodvor/vordemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ void VORDemodGUI::audioSelect(const QPoint& p)
qDebug("VORDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodvormc/vordemodmcgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,7 @@ void VORDemodMCGUI::audioSelect(const QPoint& p)
qDebug("VORDemodMCGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channelrx/demodwfm/wfmdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ void WFMDemodGUI::audioSelect(const QPoint& p)
qDebug("WFMDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 0 additions & 1 deletion plugins/channelrx/freqtracker/freqtrackergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "gui/devicestreamselectiondialog.h"
#include "dsp/dspengine.h"
#include "gui/crightclickenabler.h"
#include "gui/audioselectdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
#include "maincore.h"
Expand Down
2 changes: 1 addition & 1 deletion plugins/channeltx/modam/ammodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ void AMModGUI::audioSelect(const QPoint& p)
qDebug("AMModGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
audioSelect.move(p);

new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/channeltx/modfreedv/freedvmodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ void FreeDVModGUI::audioSelect(const QPoint& p)
qDebug("FreeDVModGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
2 changes: 2 additions & 0 deletions plugins/channeltx/modm17/m17modgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ void M17ModGUI::audioSelect(const QPoint& p)
qDebug("M17ModGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand All @@ -731,6 +732,7 @@ void M17ModGUI::audioFeedbackSelect(const QPoint& p)
qDebug("M17ModGUI::audioFeedbackSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
2 changes: 2 additions & 0 deletions plugins/channeltx/modnfm/nfmmodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ void NFMModGUI::audioSelect(const QPoint& p)
qDebug("NFMModGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand All @@ -637,6 +638,7 @@ void NFMModGUI::audioFeedbackSelect(const QPoint& p)
qDebug("NFMModGUI::audioFeedbackSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
2 changes: 2 additions & 0 deletions plugins/channeltx/modssb/ssbmodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ void SSBModGUI::audioSelect(const QPoint& p)
qDebug("SSBModGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand All @@ -784,6 +785,7 @@ void SSBModGUI::audioFeedbackSelect(const QPoint& p)
qDebug("SSBModGUI::audioFeedbackSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
2 changes: 2 additions & 0 deletions plugins/channeltx/modwfm/wfmmodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ void WFMModGUI::audioSelect(const QPoint& p)
qDebug("WFMModGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand All @@ -532,6 +533,7 @@ void WFMModGUI::audioFeedbackSelect(const QPoint& p)
qDebug("WFMModGUI::audioFeedbackSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
2 changes: 2 additions & 0 deletions plugins/samplemimo/audiocatsiso/audiocatsisogui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ void AudioCATSISOGUI::on_transverter_clicked()
void AudioCATSISOGUI::on_rxDeviceSelect_clicked()
{
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_txDeviceName, true, this);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand All @@ -338,6 +339,7 @@ void AudioCATSISOGUI::on_rxDeviceSelect_clicked()
void AudioCATSISOGUI::on_txDeviceSelect_clicked()
{
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_txDeviceName, false, this);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
1 change: 1 addition & 0 deletions plugins/samplesink/audiooutput/audiooutputgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ void AudioOutputGui::displaySettings()
void AudioOutputGui::on_deviceSelect_clicked()
{
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_deviceName, false, this);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();

if (audioSelect.m_selected)
Expand Down
Loading