summaryrefslogtreecommitdiff
path: root/Transceiver
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2026-10-20 22:35:06 +0100
committerDave Hibberd <hibby@debian.org>2026-10-20 22:35:06 +0100
commit82ebb1ed1af30cee4dfbb1c628431d32885a00e0 (patch)
tree1a1f782d3e576b758be0bc61171574a7cd8f2376 /Transceiver
parent061658210acb6425517733ea012dda803a7f72a1 (diff)
parent61d684922b0f1c8455cc60eb3d123df058c9e1f5 (diff)
Merge tag 'debian/3.3.0_beta2+dfsg-1' into hibbian/trixie-backports
tagging wsjtx 3.3.0~beta2+dfsg-1
Diffstat (limited to 'Transceiver')
-rw-r--r--Transceiver/EmulateSplitTransceiver.cpp6
-rw-r--r--Transceiver/EmulateSplitTransceiver.hpp6
-rw-r--r--Transceiver/TCITransceiver.cpp146
-rw-r--r--Transceiver/TCITransceiver.hpp12
-rw-r--r--Transceiver/Transceiver.cpp4
-rw-r--r--Transceiver/Transceiver.hpp18
-rw-r--r--Transceiver/TransceiverBase.cpp8
-rw-r--r--Transceiver/TransceiverBase.hpp2
-rw-r--r--Transceiver/TxInhibitTransceiver.cpp7
-rw-r--r--Transceiver/TxInhibitTransceiver.hpp6
10 files changed, 194 insertions, 21 deletions
diff --git a/Transceiver/EmulateSplitTransceiver.cpp b/Transceiver/EmulateSplitTransceiver.cpp
index 942ce088..bc1ead70 100644
--- a/Transceiver/EmulateSplitTransceiver.cpp
+++ b/Transceiver/EmulateSplitTransceiver.cpp
@@ -19,6 +19,12 @@ EmulateSplitTransceiver::EmulateSplitTransceiver (logger_type * logger,
connect (wrapped_.get (), &Transceiver::resolution, this, &Transceiver::resolution);
connect (wrapped_.get (), &Transceiver::tciframeswritten, this, &Transceiver::tciframeswritten);
connect (wrapped_.get (), &Transceiver::receiveAudio, this, &Transceiver::receiveAudio);
+ connect (wrapped_.get (), &Transceiver::continuousAudioAvailable,
+ this, &Transceiver::continuousAudioAvailable);
+ connect (wrapped_.get (), &Transceiver::continuousReceptionStopped,
+ this, &Transceiver::continuousReceptionStopped);
+ connect (wrapped_.get (), &Transceiver::continuousReceiveDrained,
+ this, &Transceiver::continuousReceiveDrained);
connect (wrapped_.get (), &Transceiver::tci_mod_active, this, &Transceiver::tci_mod_active);
connect (wrapped_.get (), &Transceiver::txSourceCommitted, this, &Transceiver::txSourceCommitted);
connect (wrapped_.get (), &Transceiver::rawTxPlayoutSnapshot, this, &Transceiver::rawTxPlayoutSnapshot);
diff --git a/Transceiver/EmulateSplitTransceiver.hpp b/Transceiver/EmulateSplitTransceiver.hpp
index 250305d1..e630371b 100644
--- a/Transceiver/EmulateSplitTransceiver.hpp
+++ b/Transceiver/EmulateSplitTransceiver.hpp
@@ -41,6 +41,12 @@ public:
// forward everything else to wrapped Transceiver
void start (unsigned sequence_number) noexcept override {wrapped_->start (sequence_number);}
void stop () noexcept override {wrapped_->stop ();}
+ void receive_discontinuity (JttyReceiveReason reason) override
+ { wrapped_->receive_discontinuity (reason); }
+ void receive_stop_reason (JttyReceiveReason reason) override
+ { wrapped_->receive_stop_reason (reason); }
+ void requestContinuousReceiveDrain (quint64 requestId) override
+ { wrapped_->requestContinuousReceiveDrain (requestId); }
private:
void handle_update (TransceiverState const&, unsigned seqeunce_number);
diff --git a/Transceiver/TCITransceiver.cpp b/Transceiver/TCITransceiver.cpp
index 5ee4bc0b..64926cdb 100644
--- a/Transceiver/TCITransceiver.cpp
+++ b/Transceiver/TCITransceiver.cpp
@@ -319,12 +319,14 @@ void TCITransceiver::onConnected()
void TCITransceiver::onDisconnected()
{
inConnected = false;
+ receive_discontinuity (JttyReceiveReason::InputError);
CAT_TRACE ("TCITransceiver entered TCI onDisonnected and inConnected==false\n");
}
void TCITransceiver::onError(QAbstractSocket::SocketError err)
{
+ receive_discontinuity (JttyReceiveReason::InputError);
qDebug() << "WebInThread::onError";
CAT_TRACE ("TCITransceiver entered TCI onError and ErrorNumber is " + QString::number(err) + '\n');
auto const error_index = static_cast<int> (err);
@@ -531,6 +533,13 @@ int TCITransceiver::do_start ()
void TCITransceiver::do_stop ()
{
+ bool const endingContinuous = m_receivePolicy == ReceivePolicy::ContinuousJtty;
+ if (m_receivePolicy == ReceivePolicy::ContinuousJtty) audio_ = false;
+ receive_discontinuity (JttyReceiveReason::SourceChanged);
+ m_receivePolicy = ReceivePolicy::Timed;
+ m_receiveContext = 0;
+ m_jttyPublisher.setContext (0);
+ if (endingContinuous) Q_EMIT continuousReceptionStopped (m_jttyPublisher.mailbox ());
CAT_TRACE ("TCITransceiver TCI close\n");
if (!commander_) return;
if (stream_audio_ && tci_Ready && inConnected && _power_) {
@@ -946,6 +955,7 @@ void TCITransceiver::onBinaryReceived(const QByteArray &data)
qDebug() << "IQ" << data.size() << pStream->length;
} else if (pStream->type == TciStream::RxAudioStream && audio_ && pStream->receiver == rx_.toUInt()) {
if (!TciStream::has_complete_float_payload (data, pStream->length)) {
+ receive_discontinuity (JttyReceiveReason::InputError);
return;
}
writeAudioData(const_cast<float *> (TciStream::float_payload (data)),pStream->length);
@@ -1015,9 +1025,14 @@ void TCITransceiver::enqueue_jtty_pcm (QByteArray const& samples,
TxAudioQueueEpoch epoch,
qint64 enqueueId) noexcept
{
- qint64 const count = samples.size () / int (sizeof (qint16));
- if (count <= 0) return;
+ if (samples.isEmpty () || samples.size () % int (sizeof (qint16)))
+ {
+ Q_EMIT jtty_enqueue_failed (
+ epoch, enqueueId, TxAudioQueueEnqueueFailure::Capacity);
+ return;
+ }
+ qint64 const count = samples.size () / int (sizeof (qint16));
qint16 const * pcm = reinterpret_cast<qint16 const *> (samples.constData ());
auto const result = m_txAudioQueue.enqueue (pcm, count, epoch);
if (!result.accepted)
@@ -1030,7 +1045,7 @@ void TCITransceiver::enqueue_jtty_pcm (QByteArray const& samples,
{
CAT_DEBUG ("JTTY TCI transmit queue epoch changed; rejecting stale PCM enqueue\n");
}
- Q_EMIT jtty_enqueue_failed (epoch, enqueueId);
+ Q_EMIT jtty_enqueue_failed (epoch, enqueueId, result.failure);
return;
}
Q_EMIT jtty_enqueue_accepted (enqueueId, count, result.progress);
@@ -1039,12 +1054,24 @@ void TCITransceiver::enqueue_jtty_pcm (QByteArray const& samples,
void TCITransceiver::clear_jtty_pcm (TxAudioQueueEpoch epoch) noexcept
{
m_txAudioQueue.clear (epoch);
+ // PCM enqueue and TxChrono consumption both run on this rig thread.
+ m_txAudioQueue.applyPendingReset ();
}
void TCITransceiver::poll_jtty_drain ()
{
// TCI audio is pulled while responding to TxChrono packets. Emitting the
// completion signal here keeps Qt work out of that packet/audio path.
+ if (m_state == Idle || m_txMode != "JTTY") return;
+ auto const current = m_txAudioQueue.progress ();
+ if (current.epoch.isValid ()
+ && (current.epoch != m_jttyLastProgress.epoch
+ || current.served_samples != m_jttyLastProgress.served_samples
+ || current.total_samples != m_jttyLastProgress.total_samples))
+ {
+ m_jttyLastProgress = current;
+ Q_EMIT jtty_progress (current);
+ }
auto const drain = m_txAudioQueue.takeDrainReady ();
if (drain.ready)
{
@@ -1060,18 +1087,28 @@ void TCITransceiver::clear ()
quint32 TCITransceiver::writeAudioData (float * data, qint32 maxSize)
{
- if (dec_data_input_blocked ()) return maxSize;
+ if (dec_data_input_blocked ())
+ {
+ receive_discontinuity (JttyReceiveReason::Replay);
+ return maxSize;
+ }
QVector<qint64> frame_counts;
QVector<ReceiveAudio> audio;
- qint64 ms0 = (receive_clock_ ? receive_clock_ ()
- : QDateTime::currentMSecsSinceEpoch ()) % 86400000;
- unsigned mstr = ms0 % int(1000.0*m_period); // ms into the nominal Tx start time
+ bool continuousNotify = false;
+ bool const continuous = m_receivePolicy == ReceivePolicy::ContinuousJtty;
+ qint64 const now = receive_clock_ ? receive_clock_ () : QDateTime::currentMSecsSinceEpoch ();
+ qint64 const packetFrames = maxSize / static_cast<qint32> (rxChannels);
+ qint64 const packetDurationMs = audioSampleRate
+ ? qRound64 (1000.0 * packetFrames / audioSampleRate) : 0;
+ qint64 const packetStartUtc = now - packetDurationMs;
+ qint64 ms0 = now % 86400000;
+ unsigned mstr = continuous ? 0 : ms0 % int(1000.0*m_period);
if(data == NULL) {
QMutexLocker lock {&dec_data_mutex ()};
if (dec_data_input_blocked ()) return maxSize;
- if(mstr < m_lastPeriodOffsetMs/2) { //When mstr has wrapped around to 0, restart the buffer
+ if(!continuous && mstr < m_lastPeriodOffsetMs/2) { //When mstr has wrapped around to 0, restart the buffer
clear ();
}
m_lastPeriodOffsetMs=mstr;
@@ -1084,18 +1121,22 @@ quint32 TCITransceiver::writeAudioData (float * data, qint32 maxSize)
{
QMutexLocker lock {&dec_data_mutex ()};
auto& producer = m_receiveAudioProducer.data ();
- if (dec_data_input_blocked ()) return maxSize;
+ if (dec_data_input_blocked ()) {
+ receive_discontinuity (JttyReceiveReason::Replay);
+ return maxSize;
+ }
- if(mstr < m_lastPeriodOffsetMs/2) { //When mstr has wrapped around to 0, restart the buffer
+ if(!continuous && mstr < m_lastPeriodOffsetMs/2) { //When mstr has wrapped around to 0, restart the buffer
clear ();
}
m_lastPeriodOffsetMs=mstr;
+ if (continuous) continuousNotify = m_jttyPublisher.begin (packetStartUtc);
// no torn frames
Q_ASSERT (!(maxSize % static_cast<qint32> (rxChannels)));
// these are in terms of input frames (not down sampled)
- size_t framesAcceptable ((sizeof producer.d2 /
+ size_t framesAcceptable (continuous ? maxSize / rxChannels : (sizeof producer.d2 /
sizeof producer.d2[0] - m_receiveAudioProducer.frames ()) * m_downSampleFactor);
size_t framesAccepted (qMin (static_cast<size_t> (maxSize /
rxChannels), framesAcceptable));
@@ -1118,7 +1159,12 @@ quint32 TCITransceiver::writeAudioData (float * data, qint32 maxSize)
if(m_bufferPos==m_samplesPerFFT*m_downSampleFactor) {
qint32 framesToProcess (m_samplesPerFFT * m_downSampleFactor);
qint32 framesAfterDownSample (m_samplesPerFFT);
- if(m_downSampleFactor > 1 && m_receiveAudioProducer.frames ()>=0 &&
+ if (continuous) {
+ fil4_state_ (m_buffer.data (), &framesToProcess, m_jttyOutput.data (),
+ &framesAfterDownSample, m_downsampleState.data ());
+ continuousNotify = m_jttyPublisher.append (m_jttyOutput.data (), framesAfterDownSample)
+ || continuousNotify;
+ } else if(m_downSampleFactor > 1 && m_receiveAudioProducer.frames ()>=0 &&
m_receiveAudioProducer.frames () < (NTMAX*12000 - framesAfterDownSample)) {
fil4_state_(&m_buffer[0], &framesToProcess,
&producer.d2[m_receiveAudioProducer.frames ()],
@@ -1129,20 +1175,27 @@ quint32 TCITransceiver::writeAudioData (float * data, qint32 maxSize)
qDebug() << "receive audio frames = " << m_receiveAudioProducer.frames ();
qDebug() << "framesAfterDownSample" << framesAfterDownSample;
}
- frame_counts << m_receiveAudioProducer.frames ();
- audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period);
+ if (!continuous) {
+ frame_counts << m_receiveAudioProducer.frames ();
+ audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period);
+ }
m_bufferPos = 0;
}
} else {
store (&data[(framesAccepted - remaining) * rxChannels],
- numFramesProcessed, &producer.d2[m_receiveAudioProducer.frames ()],
- receiveGain);
+ numFramesProcessed, continuous ? m_jttyOutput.data () + m_bufferPos
+ : &producer.d2[m_receiveAudioProducer.frames ()], receiveGain);
m_bufferPos += numFramesProcessed;
- m_receiveAudioProducer.setFrames (m_receiveAudioProducer.frames () + numFramesProcessed);
+ if (!continuous) m_receiveAudioProducer.setFrames (m_receiveAudioProducer.frames () + numFramesProcessed);
if (m_bufferPos == static_cast<unsigned> (m_samplesPerFFT)) {
- frame_counts << m_receiveAudioProducer.frames ();
- audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period);
+ if (continuous) {
+ continuousNotify = m_jttyPublisher.append (m_jttyOutput.data (), m_bufferPos)
+ || continuousNotify;
+ } else {
+ frame_counts << m_receiveAudioProducer.frames ();
+ audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period);
+ }
m_bufferPos = 0;
}
}
@@ -1154,6 +1207,7 @@ quint32 TCITransceiver::writeAudioData (float * data, qint32 maxSize)
Q_EMIT tciframeswritten (frames);
}
for (auto const& block : audio) Q_EMIT receiveAudio (block);
+ if (continuousNotify) Q_EMIT continuousAudioAvailable (m_jttyPublisher.mailbox ());
return maxSize; // we drop any data past the end of the buffer on
// the floor until the next period starts
@@ -1217,12 +1271,19 @@ void TCITransceiver::stream_audio (bool on)
void TCITransceiver::do_audio (bool on)
{
TRACE_CAT ("TCITransceiver", on << state ());
+ receive_discontinuity (on ? JttyReceiveReason::SourceChanged : m_inputStopReason);
if (on) {
QMutexLocker lock {&dec_data_mutex ()};
m_bufferPos = 0;
if (!dec_data_input_blocked ()) clear ();
}
audio_ = on;
+ if (!on)
+ {
+ m_inputStopReason = JttyReceiveReason::MonitorStopped;
+ if (m_receivePolicy == ReceivePolicy::ContinuousJtty)
+ Q_EMIT continuousReceptionStopped (m_jttyPublisher.mailbox ());
+ }
}
void TCITransceiver::do_period (double period)
@@ -1232,10 +1293,49 @@ void TCITransceiver::do_period (double period)
{
QMutexLocker lock {&dec_data_mutex ()};
m_period = period;
- if (!dec_data_input_blocked ()) clear ();
+ if (m_receivePolicy == ReceivePolicy::Timed && !dec_data_input_blocked ()) clear ();
}
}
+void TCITransceiver::do_receive_policy (ReceivePolicy policy)
+{
+ if (policy == m_receivePolicy) return;
+ bool const endingContinuous = m_receivePolicy == ReceivePolicy::ContinuousJtty;
+ receive_discontinuity (JttyReceiveReason::ModeChanged);
+ m_receivePolicy = policy;
+ m_downsampleState.fill (0);
+ QMutexLocker lock {&dec_data_mutex ()};
+ clear ();
+ if (endingContinuous) Q_EMIT continuousReceptionStopped (m_jttyPublisher.mailbox ());
+}
+
+void TCITransceiver::do_receive_context (quint64 context)
+{
+ if (context == m_receiveContext) return;
+ receive_discontinuity (JttyReceiveReason::SourceChanged);
+ m_receiveContext = context;
+ m_jttyPublisher.setContext (context);
+}
+
+void TCITransceiver::receive_discontinuity (JttyReceiveReason reason)
+{
+ if (m_receivePolicy != ReceivePolicy::ContinuousJtty) return;
+ bool notify = false;
+ if (m_jttyPublisher.active () && m_bufferPos)
+ {
+ qint32 inputFrames = m_bufferPos - m_bufferPos % m_downSampleFactor;
+ qint32 outputFrames = inputFrames / m_downSampleFactor;
+ if (m_downSampleFactor > 1 && inputFrames)
+ fil4_state_ (m_buffer.data (), &inputFrames, m_jttyOutput.data (),
+ &outputFrames, m_downsampleState.data ());
+ notify = m_jttyPublisher.append (m_jttyOutput.data (), outputFrames);
+ }
+ notify = m_jttyPublisher.end (reason) || notify;
+ m_bufferPos = 0;
+ m_downsampleState.fill (0);
+ if (notify) Q_EMIT continuousAudioAvailable (m_jttyPublisher.mailbox ());
+}
+
void TCITransceiver::do_volume (qreal volume)
{
rxAtten = volume;
@@ -1250,6 +1350,11 @@ void TCITransceiver::do_txvolume (qreal txvolume)
void TCITransceiver::do_blocksize (qint32 blocksize)
{
TRACE_CAT ("TCITransceiver", blocksize << state ());
+ if (blocksize <= 0 || size_t (blocksize) > max_buffer_size
+ || blocksize == m_samplesPerFFT) return;
+ // Finish partial continuous audio before changing the block's write boundary.
+ receive_discontinuity (JttyReceiveReason::SourceChanged);
+ m_bufferPos = 0;
m_samplesPerFFT = blocksize;
}
@@ -1612,6 +1717,7 @@ void TCITransceiver::do_modulator_start (TxEvidence::TxRequest const& request)
}
m_quickClose = false;
m_txMode = request.mode;
+ m_jttyLastProgress = {};
m_symbolsLength = request.symbols_length;
m_isym0 = std::numeric_limits<unsigned>::max (); // big number
m_frequency0 = 0.;
diff --git a/Transceiver/TCITransceiver.hpp b/Transceiver/TCITransceiver.hpp
index 4f2387b3..18c1d624 100644
--- a/Transceiver/TCITransceiver.hpp
+++ b/Transceiver/TCITransceiver.hpp
@@ -147,6 +147,12 @@ protected:
void do_audio (bool on) override;
void do_tune (bool on) override;
void do_period(double period) override;
+ void do_receive_policy (ReceivePolicy) override;
+ void do_receive_context (quint64) override;
+ void receive_discontinuity (JttyReceiveReason) override;
+ void receive_stop_reason (JttyReceiveReason reason) override { m_inputStopReason = reason; }
+ void requestContinuousReceiveDrain (quint64 requestId) override
+ { Q_EMIT continuousReceiveDrained (requestId, m_jttyPublisher.mailbox ()); }
void do_blocksize(qint32 blocksize) override;
void do_spread(double spread) override {m_fSpread=spread;}
void do_nsym(int nsym) override {m_symbolsLength=nsym;}
@@ -289,6 +295,11 @@ private:
double m_period = 15.0;
ReceiveClock receive_clock_;
ReceiveAudioProducer m_receiveAudioProducer;
+ ReceivePolicy m_receivePolicy = ReceivePolicy::Timed;
+ quint64 m_receiveContext = 0;
+ JttyReceiveReason m_inputStopReason = JttyReceiveReason::MonitorStopped;
+ JttyReceivePublisher m_jttyPublisher;
+ std::array<short, 7 * 512> m_jttyOutput {};
std::array<float, 49> m_downsampleState {};
unsigned m_lastPeriodOffsetMs = 999999;
unsigned m_downSampleFactor;
@@ -333,6 +344,7 @@ private:
TxAudioQueue m_txAudioQueue;
QTimer * m_jttyDrainTimer;
qint64 m_jttyDrainGuard;
+ TxAudioQueueProgress m_jttyLastProgress;
TxEvidence::TxStartSnapshot m_txStartSnapshot;
qint64 m_tciBackendStartSequence;
qint64 m_tciSuccessfullyWrittenFrames;
diff --git a/Transceiver/Transceiver.cpp b/Transceiver/Transceiver.cpp
index ac85318e..dae390ce 100644
--- a/Transceiver/Transceiver.cpp
+++ b/Transceiver/Transceiver.cpp
@@ -23,6 +23,8 @@ QDebug operator << (QDebug d, Transceiver::TransceiverState const& s)
<< "; TUNE: " << (s.tune_ ? "on" : "off")
<< "; QUICK: " << (s.quick_ ? "on" : "off")
<< "; PERIOD: " << s.period_ << "sec."
+ << "; RECEIVE_POLICY: " << int (s.receive_policy_)
+ << "; RECEIVE_CONTEXT: " << s.receive_context_
<< "; BLOCKSIZE: " << s.blocksize_
<< "; SYMBOLSLENGTH: " << s.tx_request_.symbols_length
<< "; FRAMESPERSYMBOL: " << s.tx_request_.frames_per_symbol
@@ -83,6 +85,8 @@ bool operator != (Transceiver::TransceiverState const& lhs, Transceiver::Transce
|| lhs.tune_ != rhs.tune_
|| lhs.quick_ != rhs.quick_
|| lhs.period_ != rhs.period_
+ || lhs.receive_policy_ != rhs.receive_policy_
+ || lhs.receive_context_ != rhs.receive_context_
|| lhs.blocksize_ != rhs.blocksize_
|| lhs.tx_request_ != rhs.tx_request_
|| lhs.spread_ != rhs.spread_
diff --git a/Transceiver/Transceiver.hpp b/Transceiver/Transceiver.hpp
index 14d1640b..c598e7b4 100644
--- a/Transceiver/Transceiver.hpp
+++ b/Transceiver/Transceiver.hpp
@@ -16,6 +16,7 @@
#include "Audio/TxPlaybackEvidence.hpp"
#include "Audio/TxRequest.hpp"
#include "ReceiveAudio.hpp"
+#include "JttyReceiveAudio.hpp"
class QString;
@@ -126,6 +127,8 @@ public:
bool tune () const {return tune_;}
bool quick () const {return quick_;}
double period () const {return period_;}
+ ReceivePolicy receive_policy () const { return receive_policy_; }
+ quint64 receive_context () const { return receive_context_; }
qint32 blocksize () const {return blocksize_;}
unsigned symbolslength () const {return tx_request_.symbols_length;}
double framespersymbol () const {return tx_request_.frames_per_symbol;}
@@ -158,6 +161,8 @@ public:
void tune (bool state) {tune_ = state;}
void quick (bool state) {quick_ = state;}
void period (double period) {period_ = period;}
+ void receive_policy (ReceivePolicy policy) { receive_policy_ = policy; }
+ void receive_context (quint64 context) { receive_context_ = context; }
void blocksize (qint32 blocksize) {blocksize_ = blocksize;}
void symbolslength (unsigned symbolslength) {tx_request_.symbols_length = symbolslength;}
void framespersymbol (double framespersymbol) {tx_request_.frames_per_symbol = framespersymbol;}
@@ -191,6 +196,8 @@ public:
bool tune_;
bool quick_;
double period_;
+ ReceivePolicy receive_policy_ = ReceivePolicy::Timed;
+ quint64 receive_context_ = 0;
qint32 blocksize_;
TxEvidence::TxRequest tx_request_;
double spread_;
@@ -245,6 +252,13 @@ public:
// rig audio data transfer w3sz tci
Q_SIGNAL void tciframeswritten (qint64);
Q_SIGNAL void receiveAudio (ReceiveAudio);
+ Q_SIGNAL void continuousAudioAvailable (JttyReceiveMailboxPtr);
+ Q_SIGNAL void continuousReceptionStopped (JttyReceiveMailboxPtr);
+ Q_SIGNAL void continuousReceiveDrained (quint64 requestId, JttyReceiveMailboxPtr);
+ Q_SLOT virtual void requestContinuousReceiveDrain (quint64 requestId)
+ { Q_EMIT continuousReceiveDrained (requestId, {}); }
+ Q_SLOT virtual void receive_discontinuity (JttyReceiveReason) {}
+ Q_SLOT virtual void receive_stop_reason (JttyReceiveReason) {}
// rig audio data transfer w3sz tci
Q_SIGNAL void tci_mod_active (bool);
@@ -254,9 +268,11 @@ public:
Q_SIGNAL void rawTxPlayoutSnapshot (TxEvidence::TxRawPlayoutSnapshot);
Q_SIGNAL void jtty_drained (TxAudioQueueDrainState drain);
+ Q_SIGNAL void jtty_progress (TxAudioQueueProgress progress);
Q_SIGNAL void jtty_enqueue_accepted (qint64 enqueueId, qint64 sampleCount,
TxAudioQueueProgress progress);
- Q_SIGNAL void jtty_enqueue_failed (TxAudioQueueEpoch epoch, qint64 enqueueId);
+ Q_SIGNAL void jtty_enqueue_failed (TxAudioQueueEpoch epoch, qint64 enqueueId,
+ TxAudioQueueEnqueueFailure failure);
// rig state changed
Q_SIGNAL void update (Transceiver::TransceiverState const&,
diff --git a/Transceiver/TransceiverBase.cpp b/Transceiver/TransceiverBase.cpp
index 458eade5..3eed2f59 100644
--- a/Transceiver/TransceiverBase.cpp
+++ b/Transceiver/TransceiverBase.cpp
@@ -73,6 +73,14 @@ void TransceiverBase::set (TransceiverState const& s,
if (requested_.online ())
{
bool audio_cmd {false};
+ if (requested_.receive_policy () != s.receive_policy ()) {
+ do_receive_policy (s.receive_policy ());
+ requested_.receive_policy (s.receive_policy ());
+ }
+ if (requested_.receive_context () != s.receive_context ()) {
+ do_receive_context (s.receive_context ());
+ requested_.receive_context (s.receive_context ());
+ }
if (requested_.blocksize() != s.blocksize()) {
do_blocksize (s.blocksize());
audio_cmd = true;
diff --git a/Transceiver/TransceiverBase.hpp b/Transceiver/TransceiverBase.hpp
index 085fccfc..c5e42966 100644
--- a/Transceiver/TransceiverBase.hpp
+++ b/Transceiver/TransceiverBase.hpp
@@ -117,6 +117,8 @@ protected:
virtual void do_audio (bool = false) {}
virtual void do_tune (bool = false) {}
virtual void do_period (double) {}
+ virtual void do_receive_policy (ReceivePolicy) {}
+ virtual void do_receive_context (quint64) {}
virtual void do_blocksize (qint32) {}
virtual void do_spread(double) {}
virtual void do_nsym(int) {}
diff --git a/Transceiver/TxInhibitTransceiver.cpp b/Transceiver/TxInhibitTransceiver.cpp
index 6261432b..b2d62ee8 100644
--- a/Transceiver/TxInhibitTransceiver.cpp
+++ b/Transceiver/TxInhibitTransceiver.cpp
@@ -39,10 +39,17 @@ TxInhibitTransceiver::TxInhibitTransceiver (logger_type * logger,
connect (wrapped_.get (), &Transceiver::resolution, this, &Transceiver::resolution);
connect (wrapped_.get (), &Transceiver::tciframeswritten, this, &Transceiver::tciframeswritten);
connect (wrapped_.get (), &Transceiver::receiveAudio, this, &Transceiver::receiveAudio);
+ connect (wrapped_.get (), &Transceiver::continuousAudioAvailable,
+ this, &Transceiver::continuousAudioAvailable);
+ connect (wrapped_.get (), &Transceiver::continuousReceptionStopped,
+ this, &Transceiver::continuousReceptionStopped);
+ connect (wrapped_.get (), &Transceiver::continuousReceiveDrained,
+ this, &Transceiver::continuousReceiveDrained);
connect (wrapped_.get (), &Transceiver::tci_mod_active, this, &Transceiver::tci_mod_active);
connect (wrapped_.get (), &Transceiver::txSourceCommitted, this, &Transceiver::txSourceCommitted);
connect (wrapped_.get (), &Transceiver::rawTxPlayoutSnapshot, this, &Transceiver::rawTxPlayoutSnapshot);
connect (wrapped_.get (), &Transceiver::jtty_drained, this, &Transceiver::jtty_drained);
+ connect (wrapped_.get (), &Transceiver::jtty_progress, this, &Transceiver::jtty_progress);
connect (wrapped_.get (), &Transceiver::jtty_enqueue_accepted, this, &Transceiver::jtty_enqueue_accepted);
connect (wrapped_.get (), &Transceiver::jtty_enqueue_failed, this, &Transceiver::jtty_enqueue_failed);
connect (wrapped_.get (), &Transceiver::update, this, &Transceiver::update);
diff --git a/Transceiver/TxInhibitTransceiver.hpp b/Transceiver/TxInhibitTransceiver.hpp
index fb3f0103..a2ab25de 100644
--- a/Transceiver/TxInhibitTransceiver.hpp
+++ b/Transceiver/TxInhibitTransceiver.hpp
@@ -26,6 +26,12 @@ public:
void stop () noexcept override;
void enqueue_jtty_pcm (QByteArray const&, TxAudioQueueEpoch, qint64) noexcept override;
void clear_jtty_pcm (TxAudioQueueEpoch) noexcept override;
+ void receive_discontinuity (JttyReceiveReason reason) override
+ { wrapped_->receive_discontinuity (reason); }
+ void receive_stop_reason (JttyReceiveReason reason) override
+ { wrapped_->receive_stop_reason (reason); }
+ void requestContinuousReceiveDrain (quint64 requestId) override
+ { wrapped_->requestContinuousReceiveDrain (requestId); }
Q_SLOT void tx_inhibit_command (QString controller, quint32 ttl_ms, QString station);
Q_SLOT void tx_inhibit_invalid (quint64 count);