BUGFIX: fix issue with CTS COR blocking VOX audio even when not enabled;

v24-dtr-reset-fix
Bryan Biedenkapp 1 month ago
parent 274a8f23fc
commit b35a2f5c60

@ -974,14 +974,6 @@ bool HostBridge::readParams()
m_ctsCorInvert = systemConf["ctsCorInvert"].as<bool>(false); m_ctsCorInvert = systemConf["ctsCorInvert"].as<bool>(false);
m_ctsCorHoldoffMs = (uint32_t)systemConf["ctsCorHoldoffMs"].as<uint32_t>(m_ctsCorHoldoffMs); m_ctsCorHoldoffMs = (uint32_t)systemConf["ctsCorHoldoffMs"].as<uint32_t>(m_ctsCorHoldoffMs);
if (m_ctsCorEnable) {
LogInfo("CTS COR Configuration");
LogInfo(" Enabled: yes");
LogInfo(" Port: %s", m_ctsCorPort.c_str());
LogInfo(" Invert: %s (%s triggers)", m_ctsCorInvert ? "yes" : "no", m_ctsCorInvert ? "LOW" : "HIGH");
LogInfo(" Holdoff: %u ms", m_ctsCorHoldoffMs);
}
std::string txModeStr = "DMR"; std::string txModeStr = "DMR";
if (m_txMode == TX_MODE_P25) if (m_txMode == TX_MODE_P25)
txModeStr = "P25"; txModeStr = "P25";
@ -1012,6 +1004,12 @@ bool HostBridge::readParams()
LogInfo(" RTS PTT Port: %s", m_rtsPttPort.c_str()); LogInfo(" RTS PTT Port: %s", m_rtsPttPort.c_str());
LogInfo(" RTS PTT Hold-off: %ums", m_rtsPttHoldoffMs); LogInfo(" RTS PTT Hold-off: %ums", m_rtsPttHoldoffMs);
} }
LogInfo(" CTS COR Enable: %s", m_ctsCorEnable ? "yes" : "no");
if (m_ctsCorEnable) {
LogInfo(" CTS COR Port: %s", m_ctsCorPort.c_str());
LogInfo(" CTS COR Invert: %s (%s triggers)", m_ctsCorInvert ? "yes" : "no", m_ctsCorInvert ? "LOW" : "HIGH");
LogInfo(" CTS COR Holdoff: %u ms", m_ctsCorHoldoffMs);
}
if (m_debug) { if (m_debug) {
LogInfo(" Debug: yes"); LogInfo(" Debug: yes");
@ -3097,18 +3095,23 @@ void* HostBridge::threadAudioProcess(void* arg)
// When COR is active, we need to send frames continuously when audio data is available // When COR is active, we need to send frames continuously when audio data is available
// The audio callback should be continuously feeding data, so we should always have data available // The audio callback should be continuously feeding data, so we should always have data available
bool hasAudioData = bridge->m_inputAudio.dataSize() >= AUDIO_SAMPLES_LENGTH; bool hasAudioData = bridge->m_inputAudio.dataSize() >= AUDIO_SAMPLES_LENGTH;
bool shouldProcess = false;
// Process if we have audio data if (!bridge->m_ctsCorEnable)
shouldProcess = true;
else {
// When COR is active: process whenever we have data (which should be continuous) // When COR is active: process whenever we have data (which should be continuous)
// When COR is not active: only process when VOX detects audio (normal mode) // When COR is not active: only process when VOX detects audio (normal mode)
bool shouldProcess = false;
if (bridge->m_ctsCorActive && bridge->m_audioDetect) { if (bridge->m_ctsCorActive && bridge->m_audioDetect) {
// COR is active: process whenever we have audio data (continuous transmission) // COR is active: process whenever we have audio data (continuous transmission)
shouldProcess = hasAudioData; shouldProcess = hasAudioData;
} else if (!bridge->m_ctsCorActive && bridge->m_audioDetect) {
}
else if (!bridge->m_ctsCorActive && bridge->m_audioDetect) {
// Normal VOX mode: process when we have audio data // Normal VOX mode: process when we have audio data
shouldProcess = hasAudioData; shouldProcess = hasAudioData;
} }
}
if (shouldProcess && hasAudioData) { if (shouldProcess && hasAudioData) {
short samples[AUDIO_SAMPLES_LENGTH]; short samples[AUDIO_SAMPLES_LENGTH];

Loading…
Cancel
Save

Powered by TurnKey Linux.