Ensure that PTT is actually off when opening Hamlib connection. (#1308)

* Ensure that PTT is actually off when opening Hamlib connection.

* Fix TSan warnings during testing of Tune feature.

* Add PR #1308 to changelog.

* Tweak mock Hamlib server to fix tests.

* Clarify multiple config behavior in user manual.
pull/1306/head^2
Mooneer Salem 2026-04-25 14:35:02 -07:00 committed by GitHub
parent 7c1abacffd
commit fd0a760228
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 22 additions and 6 deletions

View File

@ -365,7 +365,8 @@ to the following locations:
You can also save and restore different configuration files by using the Tools->Export Configuration
and Use Configuration menu items. These menu options allow for switching of configurations without
restarting FreeDV.
restarting FreeDV. Note that restoring a configuration file does not modify the default configuration
nor does FreeDV begin using it by default on subsequent application starts.
## Executing FreeDV With a Different Configuration (Windows)
@ -931,6 +932,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
* FreeDV Reporter: Fix inability to use mouse wheel on Msg column. (PR #1289)
* Fix RADE related compiler errors. (PR #1299)
* Logging: fix incorrect time when using UTC due to DST. (PR #1302) - thanks @barjac!
* Ensure that PTT is actually off when opening Hamlib connection. (PR #1308)
2. Enhancements:
* FreeDV Reporter: Use ItemsAdded/ItemsDeleted instead of Cleared() for performance. (PR #1212)
* Optimize "From XXX" plot performance. (PR #1238, #1239)

View File

@ -3757,12 +3757,14 @@ void MainFrame::OnTxOutAudioData_(IAudioDevice& dev, void* data, size_t size, vo
auto txLevel = g_tuneLevelScale.load(std::memory_order_acquire) * (SHRT_MAX / 2);
for (unsigned long index = 0; index < size; index++)
{
auto carrierSample = txLevel * sin(2 * M_PI * FDMDV_FCENTRE * cbData->tuneSineWaveSampleNumber / sr);
auto sineWaveSampleNumber = cbData->tuneSineWaveSampleNumber.load(std::memory_order_acquire);
auto carrierSample = txLevel * sin(2 * M_PI * FDMDV_FCENTRE * sineWaveSampleNumber / sr);
for (int i = 0; i < numChannels; i++)
{
*audioData++ = carrierSample;
}
cbData->tuneSineWaveSampleNumber = (cbData->tuneSineWaveSampleNumber + 1) % sr;
sineWaveSampleNumber = (sineWaveSampleNumber + 1) % sr;
cbData->tuneSineWaveSampleNumber.store(sineWaveSampleNumber, std::memory_order_release);
}
}
else

View File

@ -1441,7 +1441,7 @@ void MainFrame::OnTogBtnTune(wxCommandEvent&)
m_cboReportFrequency->Enable(!newTx);
// Enable tuning carrier
g_rxUserdata->tuneSineWaveSampleNumber = 0;
g_rxUserdata->tuneSineWaveSampleNumber.store(0, std::memory_order_release);
g_rxUserdata->isTuning.store(newTx, std::memory_order_release);
wxString fmtString;

View File

@ -67,7 +67,7 @@ typedef struct paCallBackData
// Tune state
std::atomic<bool> isTuning;
int tuneSineWaveSampleNumber;
std::atomic<int> tuneSineWaveSampleNumber;
} paCallBackData;
#endif // AUDIO_PIPELINE_PA_CALLBACK_DATA_H

View File

@ -438,6 +438,14 @@ void HamlibRigController::connectImpl_()
multipleVfos_ = true;
}
// Make sure PTT is not enabled as there have been reports of some
// radios starting off in this state.
result = rig_set_ptt(tmpRig, RIG_VFO_CURR, RIG_PTT_OFF);
if (result != RIG_OK)
{
log_warn("Could not ensure that radio starts with PTT off: %s", rigerror(result));
}
// Get current frequency and mode when we first connect so we can
// revert on close.
requestCurrentFrequencyModeImpl_();

View File

@ -150,6 +150,9 @@ void OmniRigController::connectImpl_()
// Get list of writable parameters.
rig_->get_WriteableParams(&writableParams_);
// Make sure radio starts in RX mode.
rig_->put_Tx(PM_RX);
// Get current frequency and mode when we first connect so we can
// revert on close.
requestCurrentFrequencyModeImpl_();

View File

@ -331,8 +331,9 @@ class HamlibHandler:
if x:
self.app.ptt = 1
else:
if self.app.ptt:
self.app.timesBeforeKill = self.app.timesBeforeKill - 1
self.app.ptt = 0
self.app.timesBeforeKill = self.app.timesBeforeKill - 1
def GetSplitVfo(self):
self.Reply('SPLIT', self.app.splitenable, 'TXVFO', self.app.txvfo, 0)
def SetSplitVfo(self):