From 5e66153a41cc878e0ceb1832fdf5cd1765f600a1 Mon Sep 17 00:00:00 2001 From: pthoms849 Date: Tue, 11 Aug 2026 15:30:55 +0000 Subject: [PATCH 1/3] RDKEMW-23354: mics occasionally muted at boot Reason for change: Sometimes at boot the privacy setting is checked before the input/output routes are completed so ctrlm cane default to privacy enabled when it should not Test Procedure: go to settings and confirm that privacy mode is off, microphones are enabled. Reboot and check that privacy is still disabled. Testing will require a lot of reboots, as the original report said this issue might happen only 1 in 10 boots Risks: low Priority: P1 Signed-off-by: Jason Thomson --- src/voice/ctrlm_voice_obj.cpp | 27 +++++++++++++++------------ src/voice/ctrlm_voice_obj.h | 1 + src/voice/ctrlm_voice_obj_generic.cpp | 4 ++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index c3d4e981..46f222c2 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -588,18 +588,6 @@ bool ctrlm_voice_t::voice_configure_config_file_json(json_t *obj_voice, json_t * // Update routes this->voice_sdk_update_routes(); - if(this->local_mic) { - // Read privacy mode state from the DB in case power cycle lost HW GPIO state - if(this->device_status[CTRLM_VOICE_DEVICE_MICROPHONE] & CTRLM_VOICE_DEVICE_STATUS_DISABLED) { - XLOGD_INFO("voice is disabled, skip privacy"); - } else { - bool privacy_enabled = this->voice_is_privacy_enabled(); - if(privacy_enabled != this->vsdk_is_privacy_enabled()) { - privacy_enabled ? this->voice_privacy_enable(false) : this->voice_privacy_disable(false); - } - } - } - // Set init message if read from DB if(!init.empty()) { this->voice_init_set(init.c_str(), false); @@ -3729,6 +3717,21 @@ void ctrlm_voice_t::voice_privacy_disable(bool update_vsdk) { } } +void ctrlm_voice_t::voice_update_privacy() { + if(this->local_mic) { + // Read privacy mode state from the DB in case power cycle lost HW GPIO state + if(this->device_status[CTRLM_VOICE_DEVICE_MICROPHONE] & CTRLM_VOICE_DEVICE_STATUS_DISABLED) { + XLOGD_INFO("voice is disabled, skip privacy"); + } else { + XLOGD_INFO("LLAMA-18353 Reading privacy mode from VSDK"); + bool privacy_enabled = this->voice_is_privacy_enabled(); + if(privacy_enabled != this->vsdk_is_privacy_enabled()) { + privacy_enabled ? this->voice_privacy_enable(false) : this->voice_privacy_disable(false); + } + } + } +} + void ctrlm_voice_t::voice_device_enable(ctrlm_voice_device_t device, bool db_write, bool *update_routes) { sem_wait(&this->device_status_semaphore); if((this->device_status[device] & CTRLM_VOICE_DEVICE_STATUS_DISABLED) == 0x00) { // if device IS NOT disabled diff --git a/src/voice/ctrlm_voice_obj.h b/src/voice/ctrlm_voice_obj.h index b7368631..8900a403 100644 --- a/src/voice/ctrlm_voice_obj.h +++ b/src/voice/ctrlm_voice_obj.h @@ -644,6 +644,7 @@ class ctrlm_voice_t { bool voice_is_privacy_enabled(void); void voice_privacy_enable(bool update_vsdk); void voice_privacy_disable(bool update_vsdk); + void voice_update_privacy(); void voice_device_update_set_active(void); void voice_device_update_set_inactive(void); diff --git a/src/voice/ctrlm_voice_obj_generic.cpp b/src/voice/ctrlm_voice_obj_generic.cpp index 4cb35f99..73d08763 100644 --- a/src/voice/ctrlm_voice_obj_generic.cpp +++ b/src/voice/ctrlm_voice_obj_generic.cpp @@ -394,6 +394,10 @@ void ctrlm_voice_generic_t::voice_sdk_update_routes() { if(!xrsr_route(routes)) { XLOGD_ERROR("failed to set routes"); } + + //Updating routes means updating inputs and outputs, so refresh the privacy setting in case inputs changed + this->voice_update_privacy(); + } void ctrlm_voice_generic_t::query_strings_updated() { From 7d7159451eda405be600b6da2f4559cfce9e2f56 Mon Sep 17 00:00:00 2001 From: pthoms849 Date: Wed, 12 Aug 2026 15:23:10 +0000 Subject: [PATCH 2/3] Removing unwanted log line --- src/voice/ctrlm_voice_obj.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index 46f222c2..2e0fd908 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -3723,7 +3723,6 @@ void ctrlm_voice_t::voice_update_privacy() { if(this->device_status[CTRLM_VOICE_DEVICE_MICROPHONE] & CTRLM_VOICE_DEVICE_STATUS_DISABLED) { XLOGD_INFO("voice is disabled, skip privacy"); } else { - XLOGD_INFO("LLAMA-18353 Reading privacy mode from VSDK"); bool privacy_enabled = this->voice_is_privacy_enabled(); if(privacy_enabled != this->vsdk_is_privacy_enabled()) { privacy_enabled ? this->voice_privacy_enable(false) : this->voice_privacy_disable(false); From aba50f4183f3c2d8f351ba6d022113035b7691b9 Mon Sep 17 00:00:00 2001 From: pthoms849 Date: Wed, 12 Aug 2026 15:56:40 +0000 Subject: [PATCH 3/3] Updating voice_update_privacy behavior --- src/voice/ctrlm_voice_obj.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index 2e0fd908..71724db2 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -3718,18 +3718,25 @@ void ctrlm_voice_t::voice_privacy_disable(bool update_vsdk) { } void ctrlm_voice_t::voice_update_privacy() { - if(this->local_mic) { - // Read privacy mode state from the DB in case power cycle lost HW GPIO state - if(this->device_status[CTRLM_VOICE_DEVICE_MICROPHONE] & CTRLM_VOICE_DEVICE_STATUS_DISABLED) { - XLOGD_INFO("voice is disabled, skip privacy"); - } else { - bool privacy_enabled = this->voice_is_privacy_enabled(); - if(privacy_enabled != this->vsdk_is_privacy_enabled()) { - privacy_enabled ? this->voice_privacy_enable(false) : this->voice_privacy_disable(false); - } - } - } -} + if(!this->local_mic) { + return; + } + sem_wait(&this->device_status_semaphore); + bool mic_disabled = (this->device_status[CTRLM_VOICE_DEVICE_MICROPHONE] & CTRLM_VOICE_DEVICE_STATUS_DISABLED) != 0; + sem_post(&this->device_status_semaphore); + // If the mic is disabled, preserve the existing ctrlm/DB privacy state. + if(mic_disabled) { + XLOGD_INFO("voice is disabled, skip privacy"); + return; + } + + // Refresh ctrlm/DB privacy state from the VSDK after route/input updates. + const bool privacy_vsdk = this->vsdk_is_privacy_enabled(); + const bool privacy_ctrlm = this->voice_is_privacy_enabled(); + if(privacy_vsdk != privacy_ctrlm) { + privacy_vsdk ? this->voice_privacy_enable(false) : this->voice_privacy_disable(false); + } + } void ctrlm_voice_t::voice_device_enable(ctrlm_voice_device_t device, bool db_write, bool *update_routes) { sem_wait(&this->device_status_semaphore);