mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-07-23 10:34:21 -04:00
Replaced Detector monitoring switch with audio stream suspend/resume.
In an effort to reduce the processing overhead when transmitting I have suspended the audio input stream at source instead of the prior behavior that simply idled skipping received samples. This is in response to high activity levels, especially with JTAlert also running, when decode processing rolls over into the next TX period. Tests show a reduction in CPU loading from ~5% to ~1.5% in the above scenario. Hopefully this will reduce the likelyhood of TX audio glitches when other system activity spikes. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3986 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+11
-17
@@ -146,6 +146,8 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
|
||||
|
||||
// hook up the audio input stream
|
||||
connect (this, &MainWindow::startAudioInputStream, &m_soundInput, &SoundInput::start);
|
||||
connect (this, &MainWindow::suspendAudioInputStream, &m_soundInput, &SoundInput::suspend);
|
||||
connect (this, &MainWindow::resumeAudioInputStream, &m_soundInput, &SoundInput::resume);
|
||||
connect (this, &MainWindow::finished, &m_soundInput, &SoundInput::stop);
|
||||
|
||||
connect (this, &MainWindow::finished, this, &MainWindow::close);
|
||||
@@ -154,7 +156,6 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
|
||||
// connect(&m_soundInput, &SoundInput::status, this, &MainWindow::showStatusMessage);
|
||||
|
||||
// hook up the detector
|
||||
connect (this, &MainWindow::detectorSetMonitoring, &m_detector, &Detector::setMonitoring);
|
||||
connect(&m_detector, &Detector::framesWritten, this, &MainWindow::dataSink);
|
||||
|
||||
// setup the waterfall
|
||||
@@ -672,20 +673,19 @@ void MainWindow::on_monitorButton_clicked (bool checked)
|
||||
if (!m_transmitting)
|
||||
{
|
||||
m_monitoring = checked;
|
||||
|
||||
if (checked)
|
||||
if (m_monitoring)
|
||||
{
|
||||
m_diskData = false; // no longer reading WAV files
|
||||
|
||||
if (m_monitoring)
|
||||
{
|
||||
// put rig back where it was when last in control
|
||||
Q_EMIT m_config.transceiver_frequency (m_lastMonitoredFrequency);
|
||||
setXIT (m_txFreq);
|
||||
}
|
||||
// put rig back where it was when last in control
|
||||
Q_EMIT m_config.transceiver_frequency (m_lastMonitoredFrequency);
|
||||
setXIT (m_txFreq);
|
||||
Q_EMIT resumeAudioInputStream ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_EMIT suspendAudioInputStream ();
|
||||
}
|
||||
|
||||
Q_EMIT detectorSetMonitoring (checked);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -985,8 +985,6 @@ void MainWindow::closeEvent(QCloseEvent * e)
|
||||
|
||||
void MainWindow::on_stopButton_clicked() //stopButton
|
||||
{
|
||||
// m_monitoring=false;
|
||||
// Q_EMIT detectorSetMonitoring (m_monitoring);
|
||||
monitor (false);
|
||||
m_loopall=false;
|
||||
}
|
||||
@@ -1023,8 +1021,6 @@ void MainWindow::on_actionAstronomical_data_triggered()
|
||||
|
||||
void MainWindow::on_actionOpen_triggered() //Open File
|
||||
{
|
||||
// m_monitoring=false;
|
||||
// Q_EMIT detectorSetMonitoring (m_monitoring);
|
||||
monitor (false);
|
||||
|
||||
QString fname;
|
||||
@@ -1576,8 +1572,6 @@ void MainWindow::guiUpdate()
|
||||
|
||||
signalMeter->setValue(0);
|
||||
|
||||
// m_monitoring=false;
|
||||
// Q_EMIT detectorSetMonitoring (false);
|
||||
if (m_monitoring)
|
||||
{
|
||||
monitor (false);
|
||||
|
||||
Reference in New Issue
Block a user