Merge branch 'develop' into feat-fst280

This commit is contained in:
Bill Somerville 2020-12-07 20:43:28 +00:00
commit c9f9c1d7c8
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
6 changed files with 21 additions and 15 deletions

View File

@ -88,17 +88,16 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
//qDebug () << "SoundIn default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize (); //qDebug () << "SoundIn default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize ();
// the Windows MME version of QAudioInput uses 1/5 of the buffer // the Windows MME version of QAudioInput uses 1/5 of the buffer
// size for period size other platforms seem to optimize themselves // size for period size other platforms seem to optimize themselves
#if defined (Q_OS_WIN) if (framesPerBuffer > 0)
m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer * 5)); {
#else m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer));
Q_UNUSED (framesPerBuffer); }
#endif
if (m_sink->initialize (QIODevice::WriteOnly, channel)) if (m_sink->initialize (QIODevice::WriteOnly, channel))
{ {
m_stream->start (sink); m_stream->start (sink);
checkStream (); checkStream ();
cummulative_lost_usec_ = -1; cummulative_lost_usec_ = -1;
//qDebug () << "SoundIn selected buffer size (bytes):" << m_stream->bufferSize () << "peirod size:" << m_stream->periodSize (); LOG_DEBUG ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ());
} }
else else
{ {

View File

@ -111,7 +111,7 @@ void SoundOutput::restart (QIODevice * source)
} }
m_stream->setCategory ("production"); m_stream->setCategory ("production");
m_stream->start (source); m_stream->start (source);
LOG_INFO ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ()); LOG_DEBUG ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ());
} }
void SoundOutput::suspend () void SoundOutput::suspend ()

View File

@ -34,8 +34,7 @@ Double-click on the wsjtx-...-Darwin.dmg file you have downloaded from K1JT's we
Now open a Terminal window by going to Applications->Utilities and clicking on Terminal. Now open a Terminal window by going to Applications->Utilities and clicking on Terminal.
Along with this ReadMe file there is a file: sysctl.conf which must be copied to a Along with this ReadMe file there is a file: sysctl.conf which must be copied to a
system area by typing these two lines in the Terminal window and then pressing the Return key system area by typing this line in the Terminal window and then pressing the Return key.
after each line.
sudo cp /Volumes/WSJT-X/sysctl.conf /etc sudo cp /Volumes/WSJT-X/sysctl.conf /etc

View File

@ -1,5 +1,6 @@
#include "logqso.h" #include "logqso.h"
#include <QLocale>
#include <QString> #include <QString>
#include <QSettings> #include <QSettings>
#include <QStandardPaths> #include <QStandardPaths>
@ -61,6 +62,9 @@ LogQSO::LogQSO(QString const& programTitle, QSettings * settings
ui->comboBoxPropMode->addItem (prop_mode.name_, prop_mode.id_); ui->comboBoxPropMode->addItem (prop_mode.name_, prop_mode.id_);
} }
loadSettings (); loadSettings ();
auto date_time_format = QLocale {}.dateFormat (QLocale::ShortFormat) + " hh:mm:ss";
ui->start_date_time->setDisplayFormat (date_time_format);
ui->end_date_time->setDisplayFormat (date_time_format);
ui->grid->setValidator (new MaidenheadLocatorValidator {this}); ui->grid->setValidator (new MaidenheadLocatorValidator {this});
} }

View File

@ -218,7 +218,7 @@ namespace
QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"};
auto quint32_max = std::numeric_limits<quint32>::max (); auto quint32_max = std::numeric_limits<quint32>::max ();
constexpr int N_WIDGETS {36}; constexpr int N_WIDGETS {36};
constexpr int rx_chunk_size {3456}; // audio samples at 12000 Hz constexpr int default_rx_audio_buffer_frames {-1}; // lets Qt decide
constexpr int default_tx_audio_buffer_frames {-1}; // lets Qt decide constexpr int default_tx_audio_buffer_frames {-1}; // lets Qt decide
bool message_is_73 (int type, QStringList const& msg_parts) bool message_is_73 (int type, QStringList const& msg_parts)
@ -272,6 +272,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_soundInput {new SoundInput}, m_soundInput {new SoundInput},
m_modulator {new Modulator {TX_SAMPLE_RATE, NTMAX}}, m_modulator {new Modulator {TX_SAMPLE_RATE, NTMAX}},
m_soundOutput {new SoundOutput}, m_soundOutput {new SoundOutput},
m_rx_audio_buffer_frames {0},
m_tx_audio_buffer_frames {0}, m_tx_audio_buffer_frames {0},
m_msErase {0}, m_msErase {0},
m_secBandChanged {0}, m_secBandChanged {0},
@ -464,7 +465,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_soundInput->moveToThread (&m_audioThread); m_soundInput->moveToThread (&m_audioThread);
m_detector->moveToThread (&m_audioThread); m_detector->moveToThread (&m_audioThread);
bool ok; bool ok;
auto buffer_size = env.value ("WSJT_TX_AUDIO_BUFFER_FRAMES", "0").toInt (&ok); auto buffer_size = env.value ("WSJT_RX_AUDIO_BUFFER_FRAMES", "0").toInt (&ok);
m_rx_audio_buffer_frames = ok && buffer_size ? buffer_size : default_rx_audio_buffer_frames;
buffer_size = env.value ("WSJT_TX_AUDIO_BUFFER_FRAMES", "0").toInt (&ok);
m_tx_audio_buffer_frames = ok && buffer_size ? buffer_size : default_tx_audio_buffer_frames; m_tx_audio_buffer_frames = ok && buffer_size ? buffer_size : default_tx_audio_buffer_frames;
// hook up sound output stream slots & signals and disposal // hook up sound output stream slots & signals and disposal
@ -943,7 +946,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
if (!m_config.audio_input_device ().isNull ()) if (!m_config.audio_input_device ().isNull ())
{ {
Q_EMIT startAudioInputStream (m_config.audio_input_device () Q_EMIT startAudioInputStream (m_config.audio_input_device ()
, rx_chunk_size * m_downSampleFactor , m_rx_audio_buffer_frames
, m_detector, m_downSampleFactor, m_config.audio_input_channel ()); , m_detector, m_downSampleFactor, m_config.audio_input_channel ());
} }
if (!m_config.audio_output_device ().isNull ()) if (!m_config.audio_output_device ().isNull ())
@ -1860,7 +1863,7 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
if(m_config.restart_audio_input () && !m_config.audio_input_device ().isNull ()) { if(m_config.restart_audio_input () && !m_config.audio_input_device ().isNull ()) {
Q_EMIT startAudioInputStream (m_config.audio_input_device () Q_EMIT startAudioInputStream (m_config.audio_input_device ()
, rx_chunk_size * m_downSampleFactor , m_rx_audio_buffer_frames
, m_detector, m_downSampleFactor , m_detector, m_downSampleFactor
, m_config.audio_input_channel ()); , m_config.audio_input_channel ());
} }

View File

@ -405,6 +405,7 @@ private:
SoundInput * m_soundInput; SoundInput * m_soundInput;
Modulator * m_modulator; Modulator * m_modulator;
SoundOutput * m_soundOutput; SoundOutput * m_soundOutput;
int m_rx_audio_buffer_frames;
int m_tx_audio_buffer_frames; int m_tx_audio_buffer_frames;
QThread m_audioThread; QThread m_audioThread;