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:
Bill Somerville
2014-04-07 00:55:05 +00:00
parent f8bdff9aa7
commit c3d1eb5cee
7 changed files with 53 additions and 37 deletions
+25
View File
@@ -88,8 +88,33 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
}
}
void SoundInput::suspend ()
{
if (m_stream)
{
m_stream->suspend ();
audioError ();
}
}
void SoundInput::resume ()
{
if (m_sink)
{
m_sink->reset ();
}
if (m_stream)
{
m_stream->resume ();
audioError ();
}
}
void SoundInput::handleStateChanged (QAudio::State newState) const
{
// qDebug () << "SoundInput::handleStateChanged: newState:" << newState;
switch (newState)
{
case QAudio::IdleState: