SSB demod: removed UDP/RTP copy audio entirely

pull/162/head
f4exb 2018-03-28 09:27:47 +02:00
rodzic 814764eeee
commit 4501066426
10 zmienionych plików z 3 dodań i 60 usunięć

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 58 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 57 KiB

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -144,13 +144,11 @@ To avoid unwanted squelch opening on short transient bursts only signals wilth p
When the power threshold is close to the noise floor a few milliseconds help in preventing noise power wiggle to open the squelch.
<h3>12: Copy audio to UDP</h3>
<h3>13: Audio mute and audio output select</h3>
Copies audio output to UDP. Output is mono S16LE samples regardless of binaural/monaural operation.
Left click on this button to toggle audio mute for this channel.
<h3>13: Audio mute</h3>
Use this button to toggle audio mute for this channel.
If you right click on it a dialog will open to select the audio output device.
<h3>14: Spectrum display</h3>

Wyświetl plik

@ -38,7 +38,6 @@ MESSAGE_CLASS_DEFINITION(SSBDemod::MsgConfigureChannelizer, Message)
const QString SSBDemod::m_channelIdURI = "de.maintech.sdrangelove.channel.ssb";
const QString SSBDemod::m_channelId = "SSBDemod";
const int SSBDemod::m_udpBlockSize = 512;
SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI),
@ -87,9 +86,6 @@ SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
SSBFilter = new fftfilt(m_LowCutoff / m_audioSampleRate, m_Bandwidth / m_audioSampleRate, ssbFftLen);
DSBFilter = new fftfilt((2.0f * m_Bandwidth) / m_audioSampleRate, 2 * ssbFftLen);
m_audioNetSink = new AudioNetSink(0); // parent thread allocated dynamically - no RTP
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
@ -104,7 +100,6 @@ SSBDemod::~SSBDemod()
if (SSBFilter) delete SSBFilter;
if (DSBFilter) delete DSBFilter;
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(&m_audioFifo);
delete m_audioNetSink;
m_deviceAPI->removeChannelAPI(this);
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
@ -220,8 +215,6 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
{
m_audioBuffer[m_audioBufferFill].r = 0;
m_audioBuffer[m_audioBufferFill].l = 0;
if (m_settings.m_copyAudioToUDP) { m_audioNetSink->write(0); }
}
else
{
@ -237,8 +230,6 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_audioBuffer[m_audioBufferFill].r = (qint16)(sideband[i].real() * m_volume * agcVal);
m_audioBuffer[m_audioBufferFill].l = (qint16)(sideband[i].imag() * m_volume * agcVal);
}
if (m_settings.m_copyAudioToUDP) { m_audioNetSink->write(m_audioBuffer[m_audioBufferFill].r + m_audioBuffer[m_audioBufferFill].l); }
}
else
{
@ -246,8 +237,6 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
qint16 sample = (qint16)(demod * m_volume * agcVal);
m_audioBuffer[m_audioBufferFill].l = sample;
m_audioBuffer[m_audioBufferFill].r = sample;
if (m_settings.m_copyAudioToUDP) { m_audioNetSink->write(sample); }
}
}
@ -332,7 +321,6 @@ bool SSBDemod::handleMessage(const Message& cmd)
BasebandSampleSink::MsgThreadedSink& cfg = (BasebandSampleSink::MsgThreadedSink&) cmd;
const QThread *thread = cfg.getThread();
qDebug("SSBDemod::handleMessage: BasebandSampleSink::MsgThreadedSink: %p", thread);
m_audioNetSink->moveToThread(const_cast<QThread*>(thread)); // use the thread for udp sinks
return true;
}
else if (DSPConfigureAudio::match(cmd))
@ -428,7 +416,6 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
<< " m_audioFlipChannels: " << settings.m_audioFlipChannels
<< " m_dsb: " << settings.m_dsb
<< " m_audioMute: " << settings.m_audioMute
<< " m_copyAudioToUDP: " << settings.m_copyAudioToUDP
<< " m_agcActive: " << settings.m_agc
<< " m_agcClamping: " << settings.m_agcClamping
<< " m_agcTimeLog2: " << settings.m_agcTimeLog2
@ -522,12 +509,6 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
<< " agcClamping: " << agcClamping;
}
if ((m_settings.m_udpAddress != settings.m_udpAddress)
|| (m_settings.m_udpPort != settings.m_udpPort) || force)
{
m_audioNetSink->setDestination(settings.m_udpAddress, settings.m_udpPort);
}
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force)
{
AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager();

Wyświetl plik

@ -276,8 +276,6 @@ private:
uint m_audioBufferFill;
AudioFifo m_audioFifo;
quint32 m_audioSampleRate;
AudioNetSink *m_audioNetSink;
static const int m_udpBlockSize;
QMutex m_settingsMutex;

Wyświetl plik

@ -222,12 +222,6 @@ void SSBDemodGUI::on_flipSidebands_clicked(bool checked __attribute__((unused)))
ui->lowCut->setValue(-lcValue);
}
void SSBDemodGUI::on_copyAudioToUDP_toggled(bool checked)
{
m_settings.m_copyAudioToUDP = checked;
applySettings();
}
void SSBDemodGUI::onMenuDialogCalled(const QPoint &p)
{
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
@ -235,14 +229,11 @@ void SSBDemodGUI::onMenuDialogCalled(const QPoint &p)
dialog.exec();
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
m_settings.m_title = m_channelMarker.getTitle();
setWindowTitle(m_settings.m_title);
setTitleColor(m_settings.m_rgbColor);
displayUDPAddress();
applySettings();
}
@ -486,7 +477,6 @@ void SSBDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
displayUDPAddress();
blockApplySettings(true);
@ -541,16 +531,10 @@ void SSBDemodGUI::displaySettings()
ui->agcThresholdGate->setValue(m_settings.m_agcThresholdGate);
s = QString::number(ui->agcThresholdGate->value(), 'f', 0);
ui->agcThresholdGateText->setText(s);
ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP);
blockApplySettings(false);
}
void SSBDemodGUI::displayUDPAddress()
{
ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_settings.m_udpAddress).arg(m_settings.m_udpPort));
}
void SSBDemodGUI::displayAGCPowerThreshold(int value)
{
if (value == SSBDemodSettings::m_minPowerThresholdDB)

Wyświetl plik

@ -72,7 +72,6 @@ private:
void applySettings(bool force = false);
void applyBandwidths(bool force = false);
void displaySettings();
void displayUDPAddress();
void displayAGCPowerThreshold(int value);
@ -95,7 +94,6 @@ private slots:
void on_audioMute_toggled(bool checked);
void on_spanLog2_valueChanged(int value);
void on_flipSidebands_clicked(bool checked);
void on_copyAudioToUDP_toggled(bool copy);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void handleInputMessages();

Wyświetl plik

@ -854,16 +854,6 @@
</property>
</spacer>
</item>
<item>
<widget class="ButtonSwitch" name="copyAudioToUDP">
<property name="toolTip">
<string>Copy audio to UDP</string>
</property>
<property name="text">
<string>U</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="audioMute">
<property name="toolTip">

Wyświetl plik

@ -44,7 +44,6 @@ void SSBDemodSettings::resetToDefaults()
m_audioMute = false;
m_agc = false;
m_agcClamping = false;
m_copyAudioToUDP = false;
m_agcPowerThreshold = -40;
m_agcThresholdGate = 4;
m_agcTimeLog2 = 7;
@ -53,8 +52,6 @@ void SSBDemodSettings::resetToDefaults()
m_volume = 3.0;
m_spanLog2 = 3;
m_inputFrequencyOffset = 0;
m_udpAddress = "127.0.0.1";
m_udpPort = 9999;
m_rgbColor = QColor(0, 255, 0).rgb();
m_title = "SSB Demodulator";
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;

Wyświetl plik

@ -32,14 +32,11 @@ struct SSBDemodSettings
bool m_audioFlipChannels;
bool m_dsb;
bool m_audioMute;
bool m_copyAudioToUDP;
bool m_agc;
bool m_agcClamping;
int m_agcTimeLog2;
int m_agcPowerThreshold;
int m_agcThresholdGate;
QString m_udpAddress;
quint16 m_udpPort;
quint32 m_rgbColor;
QString m_title;
QString m_audioDeviceName;