mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-09 09:24:59 -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:
+25
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user