From 9c39fc14d11044b185f74f867b5f87bd5ac98787 Mon Sep 17 00:00:00 2001 From: Preeja Raveendran Date: Wed, 1 Jul 2026 17:03:12 +0530 Subject: [PATCH 01/41] dsmgr removal --- src/CMakeLists.txt | 1 + src/ctrlm_utils.cpp | 126 +++++++----------- src/factory/ctrlmf_audio_control.cpp | 88 +++++------- .../ctrlm_thunder_plugin_display_settings.cpp | 22 +++ .../ctrlm_thunder_plugin_display_settings.h | 10 ++ .../ctrlm_thunder_plugin_front_panel.cpp | 88 ++++++++++++ .../ctrlm_thunder_plugin_front_panel.h | 96 +++++++++++++ 7 files changed, 296 insertions(+), 135 deletions(-) create mode 100644 src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp create mode 100644 src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93f3f745..6ed5b279 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -196,6 +196,7 @@ if(THUNDER) thunder/plugins/ctrlm_thunder_plugin_cec_sink.cpp thunder/plugins/ctrlm_thunder_plugin_cec_source.cpp thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp + thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp thunder/plugins/ctrlm_thunder_plugin_device_info.cpp thunder/plugins/ctrlm_thunder_plugin_av_input.cpp thunder/plugins/ctrlm_thunder_plugin_hdmi_input.cpp diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index eb8c7b7e..9a291735 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -32,20 +32,10 @@ #include #include -// dsMgr includes -#include "host.hpp" -#include "exception.hpp" -#include "videoOutputPort.hpp" -#include "videoOutputPortType.hpp" -#include "videoOutputPortConfig.hpp" -#include "audioOutputPort.hpp" -#include "frontPanelIndicator.hpp" -#include "manager.hpp" -#include "dsMgr.h" -#include "dsRpc.h" -#include "dsDisplay.h" +#include #include -// end dsMgr includes +#include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" +#include "thunder/plugins/ctrlm_thunder_plugin_front_panel.h" #define BLOCK_SIZE (1024 * 4 * 10) /* bytes */ #define MAX_RECURSE_DEPTH 20 @@ -1574,87 +1564,69 @@ char *ctrlm_do_regex(char *re, char *str) { } bool ctrlm_dsmgr_init() { - if(device::Manager::IsInitialized) { - XLOGD_INFO("DSMgr already initialized"); - return true; - } - try { - device::Manager::Initialize(); - XLOGD_INFO("DSMgr is initialized"); - } - catch (...) { - XLOGD_WARN("Failed to initialize DSMgr"); - return false; - } + // DSMgr initialization is no longer needed; Thunder plugins self-initialise. return true; } bool ctrlm_dsmgr_deinit() { - try { - if(device::Manager::IsInitialized) { - device::Manager::DeInitialize(); - } - } - catch(...) { - XLOGD_WARN("Failed to deinitialize DSMgr"); - return false; - } + // DSMgr deinitialization is no longer needed; Thunder plugins self-manage. return true; } bool ctrlm_dsmgr_mute_audio(bool mute) { - try { - dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); - XLOGD_INFO("Audio is %smuted", mute?"":"un-"); - } - catch(std::exception& error) { - XLOGD_WARN("Muting sound error : %s", error.what()); - return false; - } - return true; + dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); + if(!ds) { + XLOGD_ERROR("DisplaySettings plugin not available"); + return false; + } + bool ret = ds->set_audio_ducking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); + if(ret) { + XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); + } else { + XLOGD_WARN("Muting sound via Thunder failed"); + } + return ret; } bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { - if(vol < 0 || vol > 1) { + if(vol < 0 || vol > 1) { XLOGD_ERROR("Invalid volume"); return false; - } - try { - unsigned char level = (unsigned char)((vol * 100) + 0.5); - - dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; - - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); + } + unsigned char level = (unsigned char)((vol * 100) + 0.5); + dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; - if(enable) { - XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); - } else { - XLOGD_INFO("Audio ducking disabled"); - } - } - catch(std::exception& error) { - XLOGD_WARN("Ducking sound error : %s", error.what()); - return false; - } - return true; + auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); + if(!ds) { + XLOGD_ERROR("DisplaySettings plugin not available"); + return false; + } + bool ret = ds->set_audio_ducking(action, type, level); + if(ret) { + if(enable) { + XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); + } else { + XLOGD_INFO("Audio ducking disabled"); + } + } else { + XLOGD_WARN("Ducking sound via Thunder failed"); + } + return ret; } bool ctrlm_dsmgr_LED(bool on) { - try { - device::FrontPanelIndicator &led = device::FrontPanelIndicator::getInstance("Power"); - if (on) { - led.setColor(0xFFFFFF); - led.setBrightness(100); - } - led.setState(on); - } - catch(std::exception& error) { - XLOGD_WARN("LED error : %s", error.what()); - return false; - } - return true; + auto *fp = Thunder::FrontPanel::ctrlm_thunder_plugin_front_panel_t::getInstance(); + if(!fp) { + XLOGD_ERROR("FrontPanel plugin not available"); + return false; + } + bool ret = on ? fp->power_led_on(100) : fp->power_led_off(); + if(!ret) { + XLOGD_WARN("LED control via Thunder failed"); + } + return ret; } bool ctrlm_is_voice_assistant(ctrlm_rcu_controller_type_t controller_type) { diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index f8f4d7e2..6329c7b0 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -5,46 +5,16 @@ #include #include #include -// dsMgr includes -#include "host.hpp" -#include "exception.hpp" -#include "videoOutputPort.hpp" -#include "videoOutputPortType.hpp" -#include "videoOutputPortConfig.hpp" -#include "audioOutputPort.hpp" -#include "frontPanelIndicator.hpp" -#include "manager.hpp" -#include "dsMgr.h" -#include "dsRpc.h" -#include "dsDisplay.h" -// end dsMgr includes +#include +#include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" bool ctrlmf_audio_control_init(void) { - if(device::Manager::IsInitialized) { - XLOGD_INFO("DSMgr already initialized"); - return(true); - } - try { - device::Manager::Initialize(); - XLOGD_INFO("DSMgr is initialized"); - } - catch (...) { - XLOGD_WARN("Failed to initialize DSMgr"); - return(false); - } + // DSMgr initialization is no longer needed; Thunder plugins self-initialise. return(true); } bool ctrlmf_audio_control_term(void) { - try { - if(device::Manager::IsInitialized) { - device::Manager::DeInitialize(); - } - } - catch(...) { - XLOGD_WARN("Failed to deinitialize DSMgr"); - return(false); - } + // DSMgr deinitialization is no longer needed; Thunder plugins self-manage. return(true); } @@ -53,17 +23,19 @@ bool ctrlmf_audio_control_mute(bool mute) { XLOGD_ERROR("not initialized"); return(false); } - - try { - dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); - XLOGD_INFO("Audio is %smuted", mute?"":"un-"); + dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); + if(!ds) { + XLOGD_ERROR("DisplaySettings plugin not available"); + return(false); } - catch(std::exception& error) { - XLOGD_WARN("Muting sound error : %s", error.what()); - return(false); + bool ret = ds->set_audio_ducking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); + if(ret) { + XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); + } else { + XLOGD_WARN("Muting sound via Thunder failed"); } - return(true); + return(ret); } bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { @@ -71,28 +43,28 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { XLOGD_ERROR("not initialized"); return(false); } - if(vol < 0 || vol > 1) { - XLOGD_ERROR("Invalid volume"); - return(false); + XLOGD_ERROR("Invalid volume"); + return(false); } - try { - unsigned char level = (unsigned char)((vol * 100) + 0.5); - - dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; - - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); + unsigned char level = (unsigned char)((vol * 100) + 0.5); + dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; + auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); + if(!ds) { + XLOGD_ERROR("DisplaySettings plugin not available"); + return(false); + } + bool ret = ds->set_audio_ducking(action, type, level); + if(ret) { if(enable) { XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); } else { XLOGD_INFO("Audio ducking disabled"); } + } else { + XLOGD_WARN("Ducking sound via Thunder failed"); } - catch(std::exception& error) { - XLOGD_WARN("Ducking sound error : %s", error.what()); - return(false); - } - return(true); + return(ret); } diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp index b11001e6..18a51be9 100644 --- a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp +++ b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp @@ -186,3 +186,25 @@ void ctrlm_thunder_plugin_display_settings_t::on_initial_activation() { Thunder::Plugin::ctrlm_thunder_plugin_t::on_initial_activation(); } + +bool ctrlm_thunder_plugin_display_settings_t::set_audio_ducking( + dsAudioDuckingAction_t action, dsAudioDuckingType_t type, unsigned char level) { + JsonObject params, response; + params["audioPort"] = "SPEAKER0"; + params["mode"] = "raw"; + params["action"] = (action == dsAUDIO_DUCKINGACTION_START) ? "start" : "stop"; + params["duckingType"] = (type == dsAUDIO_DUCKINGTYPE_RELATIVE) ? "relative" : "absolute"; + params["level"] = (int)level; + + if(!this->call_plugin("setAudioDucking", (void *)¶ms, (void *)&response)) { + XLOGD_ERROR("DisplaySettings setAudioDucking call failed"); + return false; + } + if(!response["success"].Boolean()) { + std::string resp_str; + response.ToString(resp_str); + XLOGD_ERROR("DisplaySettings setAudioDucking returned failure: %s", resp_str.c_str()); + return false; + } + return true; +} diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h index b7f068fc..56aeee3a 100644 --- a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h +++ b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h @@ -20,6 +20,7 @@ #define __CTRLM_THUNDER_PLUGIN_DISPLAY_SETTINGS_H__ #include "ctrlm_thunder_plugin.h" #include +#include namespace Thunder { namespace DisplaySettings { @@ -46,6 +47,15 @@ class ctrlm_thunder_plugin_display_settings_t : public Thunder::Plugin::ctrlm_th */ void get_edid(std::vector &edid); + /** + * Calls DisplaySettings.setAudioDucking on the SPEAKER0 audio port. + * @param action dsAUDIO_DUCKINGACTION_START or dsAUDIO_DUCKINGACTION_STOP + * @param type dsAUDIO_DUCKINGTYPE_ABSOLUTE or dsAUDIO_DUCKINGTYPE_RELATIVE + * @param level Volume level 0-100 + * @return true on success + */ + bool set_audio_ducking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, unsigned char level); + public: /** * This function is technically used internally but from static function. This is used to handle hotplug events. diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp b/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp new file mode 100644 index 00000000..c69953c5 --- /dev/null +++ b/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp @@ -0,0 +1,88 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2015 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +#include "ctrlm_thunder_plugin_front_panel.h" +#include "ctrlm_log.h" +#include +#include +#include + +using namespace Thunder; +using namespace FrontPanel; +using namespace WPEFramework; + +ctrlm_thunder_plugin_front_panel_t::ctrlm_thunder_plugin_front_panel_t() + : ctrlm_thunder_plugin_t("FrontPanel", "org.rdk.FrontPanel", 1) { +} + +ctrlm_thunder_plugin_front_panel_t::~ctrlm_thunder_plugin_front_panel_t() { +} + +ctrlm_thunder_plugin_front_panel_t *ctrlm_thunder_plugin_front_panel_t::getInstance() { + static ctrlm_thunder_plugin_front_panel_t instance; + return &instance; +} + +void ctrlm_thunder_plugin_front_panel_t::on_initial_activation() { + Thunder::Plugin::ctrlm_thunder_plugin_t::on_initial_activation(); +} + +bool ctrlm_thunder_plugin_front_panel_t::power_led_on(int brightness) { + // Set LED colour (white = 0xFFFFFF) and brightness via setLED first + JsonObject params_led, response_led; + params_led["ledIndicator"] = "power_led"; + params_led["brightness"] = brightness; + params_led["color"] = "white"; + params_led["red"] = 255; + params_led["green"] = 255; + params_led["blue"] = 255; + bool ret = this->call_plugin("setLED", (void *)¶ms_led, (void *)&response_led); + if(!ret) { + XLOGD_ERROR("FrontPanel setLED call failed"); + } + + // Activate the LED via powerLedOn + JsonObject params_on, response_on; + params_on["index"] = "power_led"; + if(!this->call_plugin("powerLedOn", (void *)¶ms_on, (void *)&response_on)) { + XLOGD_ERROR("FrontPanel powerLedOn call failed"); + ret = false; + } + return ret; +} + +bool ctrlm_thunder_plugin_front_panel_t::power_led_off() { + JsonObject params, response; + params["index"] = "power_led"; + if(!this->call_plugin("powerLedOff", (void *)¶ms, (void *)&response)) { + XLOGD_ERROR("FrontPanel powerLedOff call failed"); + return false; + } + return true; +} + +bool ctrlm_thunder_plugin_front_panel_t::set_brightness(int brightness) { + JsonObject params, response; + params["index"] = "power_led"; + params["brightness"] = brightness; + if(!this->call_plugin("setBrightness", (void *)¶ms, (void *)&response)) { + XLOGD_ERROR("FrontPanel setBrightness call failed"); + return false; + } + return true; +} diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h b/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h new file mode 100644 index 00000000..de0bccd3 --- /dev/null +++ b/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h @@ -0,0 +1,96 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2015 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +#ifndef __CTRLM_THUNDER_PLUGIN_FRONT_PANEL_H__ +#define __CTRLM_THUNDER_PLUGIN_FRONT_PANEL_H__ +#include "ctrlm_thunder_plugin.h" + +namespace Thunder { +namespace FrontPanel { + +/** + * This class is used within ControlMgr to interact with the FrontPanel Thunder Plugin. + * It replaces direct libds device::FrontPanelIndicator calls with Thunder plugin calls. + * + * libds → Thunder mapping: + * FrontPanelIndicator::setColor(0xFFFFFF) + * + FrontPanelIndicator::setBrightness() → setLED (ledIndicator="power_led", brightness, color, red, green, blue) + * FrontPanelIndicator::setState(true) → powerLedOn (index="power_led") + * FrontPanelIndicator::setState(false) → powerLedOff (index="power_led") + * FrontPanelIndicator::setBrightness() → setBrightness (index="power_led", brightness) + * Note: toPersist semantics are not preserved by the FrontPanel Thunder plugin API. + */ +class ctrlm_thunder_plugin_front_panel_t : public Thunder::Plugin::ctrlm_thunder_plugin_t { +public: + /** + * Returns the singleton instance of the FrontPanel Thunder plugin. + * @return The instance, or NULL on error. + */ + static ctrlm_thunder_plugin_front_panel_t *getInstance(); + + /** + * FrontPanel Thunder Plugin Destructor + */ + virtual ~ctrlm_thunder_plugin_front_panel_t(); + + /** + * Turns the Power LED on: sets colour (white/0xFFFFFF) and brightness via setLED, + * then activates the LED via powerLedOn. + * Calls Thunder: org.rdk.FrontPanel.setLED + org.rdk.FrontPanel.powerLedOn + * Note: toPersist semantics are not preserved (not supported by the plugin API). + * @param brightness Level 0-100, default 100. + * @return true on success. + */ + bool power_led_on(int brightness = 100); + + /** + * Turns the Power LED off. + * Calls Thunder: org.rdk.FrontPanel.powerLedOff + * @return true on success. + */ + bool power_led_off(); + + /** + * Sets the brightness of the Power LED without changing its on/off state. + * Calls Thunder: org.rdk.FrontPanel.setBrightness + * Note: persist semantics are not preserved (not supported by the plugin API). + * @param brightness Level 0-100. + * @return true on success. + */ + bool set_brightness(int brightness); + +protected: + /** + * FrontPanel Thunder Plugin Default Constructor + */ + ctrlm_thunder_plugin_front_panel_t(); + + /** + * No events to register for this plugin. + */ + virtual bool register_events() { return true; } + + /** + * Nothing to do on initial activation. + */ + virtual void on_initial_activation(); +}; + +}; +}; +#endif From ab694e47223332e5d2784402b6dc8faaa47206d3 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:13:41 +0530 Subject: [PATCH 02/41] Update ctrlm_utils.cpp --- src/ctrlm_utils.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index 9a291735..2266b5ff 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -29,14 +29,21 @@ #include "ctrlm_utils.h" #include #include +#include +#include #include #include -#include +#include #include #include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" #include "thunder/plugins/ctrlm_thunder_plugin_front_panel.h" +using std::map; +using std::tuple; +using std::get; +using std::string; + #define BLOCK_SIZE (1024 * 4 * 10) /* bytes */ #define MAX_RECURSE_DEPTH 20 From a163e6e6f186ac685b635c5b4f144c6c8b2cb3f1 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:18:14 +0530 Subject: [PATCH 03/41] Update CMakeLists.txt to include thunder plugins --- src/factory/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/factory/CMakeLists.txt b/src/factory/CMakeLists.txt index 530cbf5b..a4df9114 100644 --- a/src/factory/CMakeLists.txt +++ b/src/factory/CMakeLists.txt @@ -26,6 +26,7 @@ set_target_properties( ctrlm-fta PROPERTIES include_directories( . + .. iarm thunder ${CMAKE_SYSROOT}/usr/include/rdk/ds @@ -47,7 +48,7 @@ target_sources(ctrlm-fta PRIVATE iarm/ctrlmf_iarm_control_manager.cpp ) -target_link_libraries(ctrlm-fta c rdkversion dbus-1 glib-2.0 IARMBus xr-voice-sdk pthread nopoll secure_wrapper ds) +target_link_libraries(ctrlm-fta c rdkversion dbus-1 glib-2.0 IARMBus xr-voice-sdk pthread nopoll secure_wrapper) target_link_libraries(controlFactory c ctrlm-fta secure_wrapper) if(AUTH_ENABLED) @@ -61,18 +62,25 @@ if(THUNDER) thunder/ctrlmf_thunder_controller.cpp thunder/ctrlmf_thunder_plugin.cpp thunder/ctrlmf_thunder_plugin_system_audio_player.cpp + ../thunder/helpers/ctrlm_thunder_helpers.cpp + ../thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp + ../thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp ) + target_link_libraries(ctrlm-fta WPEFrameworkCore WPEFrameworkPlugins) target_link_libraries(controlFactory WPEFrameworkCore WPEFrameworkPlugins) if(WPE_FRAMEWORK_COM_SOCKET) + target_link_libraries(ctrlm-fta WPEFrameworkCOM WPEFrameworkWebSocket) target_link_libraries(controlFactory WPEFrameworkCOM WPEFrameworkWebSocket) endif() if(WPE_FRAMEWORK_PROTO_TRACING) + target_link_libraries(ctrlm-fta WPEFrameworkProtocols WPEFrameworkTracing) target_link_libraries(controlFactory WPEFrameworkProtocols WPEFrameworkTracing) endif() if(THUNDER_SECURITY) add_compile_definitions(PRIVATE THUNDER_SECURITY) + target_link_libraries(ctrlm-fta WPEFrameworkSecurityUtil secure_wrapper) target_link_libraries(controlFactory WPEFrameworkSecurityUtil secure_wrapper) endif() endif() From 56db84fdf8ecef6ccf0b3fd2eba0e95c32bc308c Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:20:13 +0530 Subject: [PATCH 04/41] Update ctrlmf_thunder_plugin.h --- src/factory/thunder/ctrlmf_thunder_plugin.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/factory/thunder/ctrlmf_thunder_plugin.h b/src/factory/thunder/ctrlmf_thunder_plugin.h index 4c5ea2e5..a3962999 100644 --- a/src/factory/thunder/ctrlmf_thunder_plugin.h +++ b/src/factory/thunder/ctrlmf_thunder_plugin.h @@ -106,6 +106,16 @@ class ctrlm_thunder_plugin_t { */ bool call_plugin(std::string method, void *params, void *response); + /** + * This functions is used to call a Thunder Plugin method with retry support. + * @param method The method in which the user wants to call. + * @param params The WPEFramework JsonObject containing the parameters for the call. + * @param response The WPEFramework JsonObject containing the response from the call. + * @param retries The number of retries if the call times out. + * @return True if the call succeeded, otherwise False. + */ + bool call_plugin(std::string method, void *params, void *response, unsigned int retries); + /** * This functions is used to call a Thunder Controller method. * @param method The method in which the user wants to call. @@ -146,4 +156,4 @@ class ctrlm_thunder_plugin_t { }; }; -#endif \ No newline at end of file +#endif From fac7942df7c4e0c09edddad10a98fe4401bc08aa Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:21:22 +0530 Subject: [PATCH 05/41] Update ctrlmf_thunder_plugin.cpp --- src/factory/thunder/ctrlmf_thunder_plugin.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/factory/thunder/ctrlmf_thunder_plugin.cpp b/src/factory/thunder/ctrlmf_thunder_plugin.cpp index 4f95cb07..e8560649 100644 --- a/src/factory/thunder/ctrlmf_thunder_plugin.cpp +++ b/src/factory/thunder/ctrlmf_thunder_plugin.cpp @@ -208,6 +208,33 @@ bool ctrlm_thunder_plugin_t::call_plugin(std::string method, void *params, void return(ret); } +bool ctrlm_thunder_plugin_t::call_plugin(std::string method, void *params, void *response, unsigned int retries) { + bool ret = false; + unsigned int attempts = 0; + auto clientObject = (JSONRPC::LinkType*)this->plugin_client; + JsonObject *jsonParams = (JsonObject *)params; + JsonObject *jsonResponse = (JsonObject *)response; + if(clientObject) { + if(!method.empty() && jsonParams && jsonResponse) { + uint32_t thunderRet = Core::ERROR_TIMEDOUT; + while(thunderRet == Core::ERROR_TIMEDOUT && attempts <= retries) { + thunderRet = clientObject->Invoke(CALL_TIMEOUT, _T(method), *jsonParams, *jsonResponse); + if(thunderRet == Core::ERROR_NONE) { + ret = true; + } else { + XLOGD_ERROR("%s: Thunder call failed <%s> <%u>\n", __FUNCTION__, method.c_str(), thunderRet); + attempts++; + } + } + } else { + XLOGD_ERROR("%s: Invalid parameters\n", __FUNCTION__); + } + } else { + XLOGD_ERROR("%s: Client is NULL\n", __FUNCTION__); + } + return(ret); +} + bool ctrlm_thunder_plugin_t::call_controller(std::string method, void *params, void *response) { bool ret = false; if(this->controller) { From f6a8ec7eb6d1c2eeec89df44695f21d661ee6d63 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:42:49 +0530 Subject: [PATCH 06/41] Update ctrlm_voice_obj.cpp --- src/voice/ctrlm_voice_obj.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index c81a629a..f27b1075 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -1372,8 +1372,6 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net xrsr_session_request_t request_params; request_params.type = XRSR_SESSION_REQUEST_TYPE_INVALID; - uint8_t dst_index = 0; - if(is_session_by_text) { XLOGD_INFO("Requesting the speech router start a text-only session with transcription = <%s>", l_transcription_in); if(session->state_src == CTRLM_VOICE_STATE_SRC_STREAMING || session->state_dst != CTRLM_VOICE_STATE_DST_READY) { @@ -1386,7 +1384,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net xrsr_audio_format_t xrsr_format = { .type = XRSR_AUDIO_FORMAT_NONE}; - if (false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, xrsr_format, request_params, uuid, false, false)) { + if (false == xrsr_session_request(voice_device_to_xrsr(device_type), xrsr_format, request_params, uuid, false, false)) { XLOGD_ERROR("Failed to acquire the text-only session from the speech router."); return VOICE_SESSION_RESPONSE_BUSY; } @@ -1406,7 +1404,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net xrsr_format.type = XRSR_AUDIO_FORMAT_PCM; } - if (false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, xrsr_format, request_params, uuid, false, false)) { + if (false == xrsr_session_request(voice_device_to_xrsr(device_type), xrsr_format, request_params, uuid, false, false)) { XLOGD_ERROR("Failed to acquire the audio file session from the speech router."); return VOICE_SESSION_RESPONSE_BUSY; } @@ -1423,7 +1421,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net request_params.type = XRSR_SESSION_REQUEST_TYPE_AUDIO_MIC; request_params.value.audio_mic.stream_params_required = this->nsm_voice_session; - if(false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, xrsr_format, request_params, uuid, low_latency, low_cpu_util)) { + if(false == xrsr_session_request(voice_device_to_xrsr(device_type), xrsr_format, request_params, uuid, low_latency, low_cpu_util)) { XLOGD_ERROR("Failed to acquire the microphone session from the speech router."); return VOICE_SESSION_RESPONSE_BUSY; } @@ -1452,7 +1450,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net request_params.value.audio_fd.callback = (create_pipe) ? NULL : ctrlm_voice_data_post_processing_cb; // RF4CE does not use pipe read callback request_params.value.audio_fd.user_data = (create_pipe) ? NULL : (void *)this; - if(false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, voice_format_to_xrsr(format), request_params, uuid, false, false)) { + if(false == xrsr_session_request(voice_device_to_xrsr(device_type), voice_format_to_xrsr(format), request_params, uuid, false, false)) { XLOGD_TELEMETRY("Failed to acquire voice session"); this->voice_session_notify_abort(network_id, controller_id, 0, CTRLM_VOICE_SESSION_ABORT_REASON_BUSY); if(create_pipe) { From f4764d28648d98047157d70734cbd220cce68285 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 2 Jul 2026 14:00:37 +0530 Subject: [PATCH 07/41] Update ctrlm_voice_obj.cpp --- src/voice/ctrlm_voice_obj.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index f27b1075..983e06bc 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -1372,6 +1372,8 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net xrsr_session_request_t request_params; request_params.type = XRSR_SESSION_REQUEST_TYPE_INVALID; + uint8_t dst_index = 0; + if(is_session_by_text) { XLOGD_INFO("Requesting the speech router start a text-only session with transcription = <%s>", l_transcription_in); if(session->state_src == CTRLM_VOICE_STATE_SRC_STREAMING || session->state_dst != CTRLM_VOICE_STATE_DST_READY) { @@ -1384,7 +1386,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net xrsr_audio_format_t xrsr_format = { .type = XRSR_AUDIO_FORMAT_NONE}; - if (false == xrsr_session_request(voice_device_to_xrsr(device_type), xrsr_format, request_params, uuid, false, false)) { + if (false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, xrsr_format, request_params, uuid, false, false)) { XLOGD_ERROR("Failed to acquire the text-only session from the speech router."); return VOICE_SESSION_RESPONSE_BUSY; } @@ -1404,7 +1406,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net xrsr_format.type = XRSR_AUDIO_FORMAT_PCM; } - if (false == xrsr_session_request(voice_device_to_xrsr(device_type), xrsr_format, request_params, uuid, false, false)) { + if (false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, xrsr_format, request_params, uuid, false, false)) { XLOGD_ERROR("Failed to acquire the audio file session from the speech router."); return VOICE_SESSION_RESPONSE_BUSY; } @@ -1421,7 +1423,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net request_params.type = XRSR_SESSION_REQUEST_TYPE_AUDIO_MIC; request_params.value.audio_mic.stream_params_required = this->nsm_voice_session; - if(false == xrsr_session_request(voice_device_to_xrsr(device_type), xrsr_format, request_params, uuid, low_latency, low_cpu_util)) { + if(false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, xrsr_format, request_params, uuid, low_latency, low_cpu_util)) { XLOGD_ERROR("Failed to acquire the microphone session from the speech router."); return VOICE_SESSION_RESPONSE_BUSY; } @@ -1450,7 +1452,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net request_params.value.audio_fd.callback = (create_pipe) ? NULL : ctrlm_voice_data_post_processing_cb; // RF4CE does not use pipe read callback request_params.value.audio_fd.user_data = (create_pipe) ? NULL : (void *)this; - if(false == xrsr_session_request(voice_device_to_xrsr(device_type), voice_format_to_xrsr(format), request_params, uuid, false, false)) { + if(false == xrsr_session_request(voice_device_to_xrsr(device_type), dst_index, voice_format_to_xrsr(format), request_params, uuid, false, false)) { XLOGD_TELEMETRY("Failed to acquire voice session"); this->voice_session_notify_abort(network_id, controller_id, 0, CTRLM_VOICE_SESSION_ABORT_REASON_BUSY); if(create_pipe) { From 5e022b4182bf65f49382297510b852ffa229777e Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 17:56:55 +0530 Subject: [PATCH 08/41] Update CMakeLists.txt with macro --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ed5b279..234040cc 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,6 +188,7 @@ if(TELEMETRY_SUPPORT) endif() if(THUNDER) + add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) target_sources(controlMgr PRIVATE thunder/ctrlm_thunder_controller.cpp thunder/ctrlm_thunder_plugin.cpp From d976f1dd61d1b39377380e9169230135560fbc11 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:02:31 +0530 Subject: [PATCH 09/41] Update ctrlm_utils.cpp --- src/ctrlm_utils.cpp | 96 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index 2266b5ff..eb3288ee 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -34,10 +34,24 @@ #include #include +#ifdef CTRLM_USE_THUNDER_FR_DS #include -#include #include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" #include "thunder/plugins/ctrlm_thunder_plugin_front_panel.h" +#else +#include "host.hpp" +#include "exception.hpp" +#include "videoOutputPort.hpp" +#include "videoOutputPortType.hpp" +#include "videoOutputPortConfig.hpp" +#include "audioOutputPort.hpp" +#include "frontPanelIndicator.hpp" +#include "manager.hpp" +#include "dsMgr.h" +#include "dsRpc.h" +#include "dsDisplay.h" +#endif +#include using std::map; using std::tuple; @@ -1571,16 +1585,46 @@ char *ctrlm_do_regex(char *re, char *str) { } bool ctrlm_dsmgr_init() { +#ifdef CTRLM_USE_THUNDER_FR_DS // DSMgr initialization is no longer needed; Thunder plugins self-initialise. return true; +#else + if(device::Manager::IsInitialized) { + XLOGD_INFO("DSMgr already initialized"); + return true; + } + try { + device::Manager::Initialize(); + XLOGD_INFO("DSMgr is initialized"); + } + catch (...) { + XLOGD_WARN("Failed to initialize DSMgr"); + return false; + } + return true; +#endif } bool ctrlm_dsmgr_deinit() { +#ifdef CTRLM_USE_THUNDER_FR_DS // DSMgr deinitialization is no longer needed; Thunder plugins self-manage. return true; +#else + try { + if(device::Manager::IsInitialized) { + device::Manager::DeInitialize(); + } + } + catch(...) { + XLOGD_WARN("Failed to deinitialize DSMgr"); + return false; + } + return true; +#endif } bool ctrlm_dsmgr_mute_audio(bool mute) { +#ifdef CTRLM_USE_THUNDER_FR_DS dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { @@ -1594,6 +1638,18 @@ bool ctrlm_dsmgr_mute_audio(bool mute) { XLOGD_WARN("Muting sound via Thunder failed"); } return ret; +#else + try { + dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); + XLOGD_INFO("Audio is %smuted", mute?"":"un-"); + } + catch(std::exception& error) { + XLOGD_WARN("Muting sound error : %s", error.what()); + return false; + } + return true; +#endif } bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { @@ -1601,6 +1657,7 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { XLOGD_ERROR("Invalid volume"); return false; } +#ifdef CTRLM_USE_THUNDER_FR_DS unsigned char level = (unsigned char)((vol * 100) + 0.5); dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; @@ -1621,9 +1678,31 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { XLOGD_WARN("Ducking sound via Thunder failed"); } return ret; +#else + try { + unsigned char level = (unsigned char)((vol * 100) + 0.5); + + dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; + + device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); + + if(enable) { + XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); + } else { + XLOGD_INFO("Audio ducking disabled"); + } + } + catch(std::exception& error) { + XLOGD_WARN("Ducking sound error : %s", error.what()); + return false; + } + return true; +#endif } bool ctrlm_dsmgr_LED(bool on) { +#ifdef CTRLM_USE_THUNDER_FR_DS auto *fp = Thunder::FrontPanel::ctrlm_thunder_plugin_front_panel_t::getInstance(); if(!fp) { XLOGD_ERROR("FrontPanel plugin not available"); @@ -1634,6 +1713,21 @@ bool ctrlm_dsmgr_LED(bool on) { XLOGD_WARN("LED control via Thunder failed"); } return ret; +#else + try { + device::FrontPanelIndicator &led = device::FrontPanelIndicator::getInstance("Power"); + if (on) { + led.setColor(0xFFFFFF); + led.setBrightness(100); + } + led.setState(on); + } + catch(std::exception& error) { + XLOGD_WARN("LED error : %s", error.what()); + return false; + } + return true; +#endif } bool ctrlm_is_voice_assistant(ctrlm_rcu_controller_type_t controller_type) { From c597cc55bc5cf90f4acf831410835444b47ad8e1 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:04:44 +0530 Subject: [PATCH 10/41] Update ctrlmf_audio_control.cpp --- src/factory/ctrlmf_audio_control.cpp | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index 6329c7b0..a87fb3b3 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -6,16 +6,60 @@ #include #include #include + +#ifdef CTRLMF_THUNDER #include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" +#else +#include "host.hpp" +#include "exception.hpp" +#include "videoOutputPort.hpp" +#include "videoOutputPortType.hpp" +#include "videoOutputPortConfig.hpp" +#include "audioOutputPort.hpp" +#include "frontPanelIndicator.hpp" +#include "manager.hpp" +#include "dsMgr.h" +#include "dsRpc.h" +#include "dsDisplay.h" +#endif bool ctrlmf_audio_control_init(void) { +#ifdef CTRLMF_THUNDER // DSMgr initialization is no longer needed; Thunder plugins self-initialise. return(true); +#else + if(device::Manager::IsInitialized) { + XLOGD_INFO("DSMgr already initialized"); + return(true); + } + try { + device::Manager::Initialize(); + XLOGD_INFO("DSMgr is initialized"); + } + catch (...) { + XLOGD_WARN("Failed to initialize DSMgr"); + return(false); + } + return(true); +#endif } bool ctrlmf_audio_control_term(void) { +#ifdef CTRLMF_THUNDER // DSMgr deinitialization is no longer needed; Thunder plugins self-manage. return(true); +#else + try { + if(device::Manager::IsInitialized) { + device::Manager::DeInitialize(); + } + } + catch(...) { + XLOGD_WARN("Failed to deinitialize DSMgr"); + return(false); + } + return(true); +#endif } bool ctrlmf_audio_control_mute(bool mute) { @@ -23,6 +67,7 @@ bool ctrlmf_audio_control_mute(bool mute) { XLOGD_ERROR("not initialized"); return(false); } +#ifdef CTRLMF_THUNDER dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { @@ -36,6 +81,18 @@ bool ctrlmf_audio_control_mute(bool mute) { XLOGD_WARN("Muting sound via Thunder failed"); } return(ret); +#else + try { + dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); + XLOGD_INFO("Audio is %smuted", mute?"":"un-"); + } + catch(std::exception& error) { + XLOGD_WARN("Muting sound error : %s", error.what()); + return(false); + } + return(true); +#endif } bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { @@ -47,6 +104,7 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { XLOGD_ERROR("Invalid volume"); return(false); } +#ifdef CTRLMF_THUNDER unsigned char level = (unsigned char)((vol * 100) + 0.5); dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; @@ -67,4 +125,25 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { XLOGD_WARN("Ducking sound via Thunder failed"); } return(ret); +#else + try { + unsigned char level = (unsigned char)((vol * 100) + 0.5); + + dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; + dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; + + device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); + + if(enable) { + XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); + } else { + XLOGD_INFO("Audio ducking disabled"); + } + } + catch(std::exception& error) { + XLOGD_WARN("Ducking sound error : %s", error.what()); + return(false); + } + return(true); +#endif } From 18e32e22845dadcc72f2653b713d8d7df5f9929d Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:10:41 +0530 Subject: [PATCH 11/41] Update CMakeLists.txt --- src/factory/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/factory/CMakeLists.txt b/src/factory/CMakeLists.txt index a4df9114..17da1cea 100644 --- a/src/factory/CMakeLists.txt +++ b/src/factory/CMakeLists.txt @@ -58,6 +58,7 @@ endif() if(THUNDER) add_compile_definitions(PRIVATE CTRLMF_THUNDER) + add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) target_sources(ctrlm-fta PRIVATE thunder/ctrlmf_thunder_controller.cpp thunder/ctrlmf_thunder_plugin.cpp From 1d4e4c624f797717ecfb0480270d4b1cd8e98ccb Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:11:38 +0530 Subject: [PATCH 12/41] Update ctrlmf_audio_control.cpp --- src/factory/ctrlmf_audio_control.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index a87fb3b3..05741e2b 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -7,7 +7,7 @@ #include #include -#ifdef CTRLMF_THUNDER +#ifdef CTRLM_USE_THUNDER_FR_DS #include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" #else #include "host.hpp" @@ -24,7 +24,7 @@ #endif bool ctrlmf_audio_control_init(void) { -#ifdef CTRLMF_THUNDER +#ifdef CTRLM_USE_THUNDER_FR_DS // DSMgr initialization is no longer needed; Thunder plugins self-initialise. return(true); #else @@ -45,7 +45,7 @@ bool ctrlmf_audio_control_init(void) { } bool ctrlmf_audio_control_term(void) { -#ifdef CTRLMF_THUNDER +#ifdef CTRLM_USE_THUNDER_FR_DS // DSMgr deinitialization is no longer needed; Thunder plugins self-manage. return(true); #else @@ -67,7 +67,7 @@ bool ctrlmf_audio_control_mute(bool mute) { XLOGD_ERROR("not initialized"); return(false); } -#ifdef CTRLMF_THUNDER +#ifdef CTRLM_USE_THUNDER_FR_DS dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { @@ -104,7 +104,7 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { XLOGD_ERROR("Invalid volume"); return(false); } -#ifdef CTRLMF_THUNDER +#ifdef CTRLM_USE_THUNDER_FR_DS unsigned char level = (unsigned char)((vol * 100) + 0.5); dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; From 9ca67fbac2dbc135369154689899906167cae80c Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:20:16 +0530 Subject: [PATCH 13/41] Update CMakeLists.txt --- src/factory/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/factory/CMakeLists.txt b/src/factory/CMakeLists.txt index 17da1cea..d67eca59 100644 --- a/src/factory/CMakeLists.txt +++ b/src/factory/CMakeLists.txt @@ -58,7 +58,6 @@ endif() if(THUNDER) add_compile_definitions(PRIVATE CTRLMF_THUNDER) - add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) target_sources(ctrlm-fta PRIVATE thunder/ctrlmf_thunder_controller.cpp thunder/ctrlmf_thunder_plugin.cpp @@ -86,5 +85,9 @@ if(THUNDER) endif() endif() +if(CTRLM_USE_THUNDER_FR_DS) + add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) +endif() + install(TARGETS controlFactory DESTINATION bin) install(TARGETS ctrlm-fta LIBRARY DESTINATION lib) From 7efaff40181d5e201da8398881507fc2b8ab4bdf Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:22:12 +0530 Subject: [PATCH 14/41] Update CMakeLists.txt --- src/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 234040cc..e5d98424 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,7 +188,6 @@ if(TELEMETRY_SUPPORT) endif() if(THUNDER) - add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) target_sources(controlMgr PRIVATE thunder/ctrlm_thunder_controller.cpp thunder/ctrlm_thunder_plugin.cpp @@ -217,6 +216,10 @@ if(THUNDER) endif() endif() +if(CTRLM_USE_THUNDER_FR_DS) + add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) +endif() + if(XRSR_HTTP) target_sources(controlMgr PRIVATE voice/endpoints/ctrlm_voice_endpoint_http.cpp From 9a6dc375d1a3420f30c4baac9e48d2acfb741602 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:23:08 +0530 Subject: [PATCH 15/41] Update CMakeLists.txt --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00266a6f..c5103c20 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ option(RF4CE_ENABLED "Enable RF4CE" ON) option(TELEMETRY_SUPPORT "Enable TELEMETRY_SUPPORT" OFF) option(THUNDER "Enable THUNDER" ON) option(THUNDER_SECURITY "Enable THUNDER_SECURITY" OFF) +option(CTRLM_USE_THUNDER_FR_DS "Use Thunder for DisplaySettings and FrontPanel instead of DSMgr" ON) option(USE_SAFEC "Use safec" OFF) option(USE_IARM_POWER_MANAGER "Use IARM Power Manager" OFF) option(XRSR_HTTP "Enable XRSR_HTTP" OFF) From 5f96e85790bad170d433659984def4bb0bddd4f1 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:34:51 +0530 Subject: [PATCH 16/41] Update CMakeLists.txt --- src/factory/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/factory/CMakeLists.txt b/src/factory/CMakeLists.txt index d67eca59..66503201 100644 --- a/src/factory/CMakeLists.txt +++ b/src/factory/CMakeLists.txt @@ -51,6 +51,10 @@ target_sources(ctrlm-fta PRIVATE target_link_libraries(ctrlm-fta c rdkversion dbus-1 glib-2.0 IARMBus xr-voice-sdk pthread nopoll secure_wrapper) target_link_libraries(controlFactory c ctrlm-fta secure_wrapper) +if(NOT CTRLM_USE_THUNDER_FR_DS) + target_link_libraries(ctrlm-fta ds) +endif() + if(AUTH_ENABLED) add_compile_definitions(PRIVATE CTRLMF_WSS_ENABLED) target_link_libraries(ctrlm-fta RdkCertSelector rdkconfig) From f24349572594db943be6f9a765cb4e5bfa035bab Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 15:09:57 +0530 Subject: [PATCH 17/41] Update ctrlm_thunder_plugin_display_settings.cpp --- .../plugins/ctrlm_thunder_plugin_display_settings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp index 18a51be9..a56c0d24 100644 --- a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp +++ b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp @@ -188,12 +188,12 @@ void ctrlm_thunder_plugin_display_settings_t::on_initial_activation() { } bool ctrlm_thunder_plugin_display_settings_t::set_audio_ducking( - dsAudioDuckingAction_t action, dsAudioDuckingType_t type, unsigned char level) { + bool action, bool type, unsigned char level) { JsonObject params, response; params["audioPort"] = "SPEAKER0"; params["mode"] = "raw"; - params["action"] = (action == dsAUDIO_DUCKINGACTION_START) ? "start" : "stop"; - params["duckingType"] = (type == dsAUDIO_DUCKINGTYPE_RELATIVE) ? "relative" : "absolute"; + params["action"] = action ? "start" : "stop"; + params["duckingType"] = type ? "relative" : "absolute"; params["level"] = (int)level; if(!this->call_plugin("setAudioDucking", (void *)¶ms, (void *)&response)) { From a5cd360fde11468d5c36121287390d1c3cba47f7 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 15:12:33 +0530 Subject: [PATCH 18/41] Update ctrlm_thunder_plugin_display_settings.h --- .../plugins/ctrlm_thunder_plugin_display_settings.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h index 56aeee3a..86f0bfb7 100644 --- a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h +++ b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h @@ -20,7 +20,6 @@ #define __CTRLM_THUNDER_PLUGIN_DISPLAY_SETTINGS_H__ #include "ctrlm_thunder_plugin.h" #include -#include namespace Thunder { namespace DisplaySettings { @@ -49,12 +48,12 @@ class ctrlm_thunder_plugin_display_settings_t : public Thunder::Plugin::ctrlm_th /** * Calls DisplaySettings.setAudioDucking on the SPEAKER0 audio port. - * @param action dsAUDIO_DUCKINGACTION_START or dsAUDIO_DUCKINGACTION_STOP - * @param type dsAUDIO_DUCKINGTYPE_ABSOLUTE or dsAUDIO_DUCKINGTYPE_RELATIVE + * @param action true to start ducking, false to stop + * @param type true for relative ducking, false for absolute * @param level Volume level 0-100 * @return true on success */ - bool set_audio_ducking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, unsigned char level); + bool set_audio_ducking(bool action, bool type, unsigned char level); public: /** @@ -99,4 +98,4 @@ class ctrlm_thunder_plugin_display_settings_t : public Thunder::Plugin::ctrlm_th }; }; }; -#endif \ No newline at end of file +#endif From 2a831a6b7f045136fb11eef9329019ef77315f6e Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 15:15:21 +0530 Subject: [PATCH 19/41] Update ctrlm_utils.cpp --- src/ctrlm_utils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index eb3288ee..afa83528 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -1625,13 +1625,12 @@ bool ctrlm_dsmgr_deinit() { bool ctrlm_dsmgr_mute_audio(bool mute) { #ifdef CTRLM_USE_THUNDER_FR_DS - dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return false; } - bool ret = ds->set_audio_ducking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); + bool ret = ds->set_audio_ducking(mute, false, mute ? 0 : 100); if(ret) { XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); } else { @@ -1659,15 +1658,13 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { } #ifdef CTRLM_USE_THUNDER_FR_DS unsigned char level = (unsigned char)((vol * 100) + 0.5); - dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return false; } - bool ret = ds->set_audio_ducking(action, type, level); + bool ret = ds->set_audio_ducking(enable, relative, level); if(ret) { if(enable) { XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); From 80118a5ffe3b7f3edb98c23668110328622ac584 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 15:20:43 +0530 Subject: [PATCH 20/41] Update ctrlmf_audio_control.cpp --- src/factory/ctrlmf_audio_control.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index 05741e2b..fda2d61d 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -68,13 +68,14 @@ bool ctrlmf_audio_control_mute(bool mute) { return(false); } #ifdef CTRLM_USE_THUNDER_FR_DS - dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return(false); } - bool ret = ds->set_audio_ducking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); + bool action = mute; // true = start ducking (mute), false = stop ducking (unmute) + bool type = false; // false = absolute ducking + bool ret = ds->set_audio_ducking(action, type, mute ? 0 : 100); if(ret) { XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); } else { @@ -106,8 +107,8 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { } #ifdef CTRLM_USE_THUNDER_FR_DS unsigned char level = (unsigned char)((vol * 100) + 0.5); - dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; + bool action = enable; // true = start ducking, false = stop ducking + bool type = relative; // true = relative, false = absolute auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { From 2d284d5ce5be9f0fb23f7d6e864759c1746d5814 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 15:22:18 +0530 Subject: [PATCH 21/41] Update ctrlm_utils.cpp --- src/ctrlm_utils.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index afa83528..2e60487f 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -1630,7 +1630,9 @@ bool ctrlm_dsmgr_mute_audio(bool mute) { XLOGD_ERROR("DisplaySettings plugin not available"); return false; } - bool ret = ds->set_audio_ducking(mute, false, mute ? 0 : 100); + bool action = mute; // true = start ducking (mute), false = stop ducking (unmute) + bool type = false; // false = absolute ducking + bool ret = ds->set_audio_ducking(action, type, mute ? 0 : 100); if(ret) { XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); } else { @@ -1658,13 +1660,15 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { } #ifdef CTRLM_USE_THUNDER_FR_DS unsigned char level = (unsigned char)((vol * 100) + 0.5); + bool action = enable; // true = start ducking, false = stop ducking + bool type = relative; // true = relative, false = absolute auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return false; } - bool ret = ds->set_audio_ducking(enable, relative, level); + bool ret = ds->set_audio_ducking(action, type, level); if(ret) { if(enable) { XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); From f5d9461e15eb282a316d02fca7bffb9662f41799 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 15:35:29 +0530 Subject: [PATCH 22/41] Update ctrlmf_audio_control.cpp --- src/factory/ctrlmf_audio_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index fda2d61d..73d62abd 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #ifdef CTRLM_USE_THUNDER_FR_DS #include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" @@ -21,6 +20,7 @@ #include "dsMgr.h" #include "dsRpc.h" #include "dsDisplay.h" +#include #endif bool ctrlmf_audio_control_init(void) { From bbff62d8b9f38d70fe37025b48a3c74779ff52ab Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 16:15:22 +0530 Subject: [PATCH 23/41] Update CMakeLists.txt --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e5d98424..f22410cd 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -217,7 +217,7 @@ if(THUNDER) endif() if(CTRLM_USE_THUNDER_FR_DS) - add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) + target_compile_definitions(controlMgr PRIVATE CTRLM_USE_THUNDER_FR_DS) endif() if(XRSR_HTTP) From 270edef7344113f358e51f5294f0bc987d8bb18b Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Mon, 6 Jul 2026 16:16:03 +0530 Subject: [PATCH 24/41] Update CMakeLists.txt --- src/factory/CMakeLists.txt | 15 ++--- src/factory/ctrlmf_audio_control.cpp | 8 +-- ...ctrlmf_thunder_plugin_display_settings.cpp | 61 +++++++++++++++++++ .../ctrlmf_thunder_plugin_display_settings.h | 59 ++++++++++++++++++ 4 files changed, 130 insertions(+), 13 deletions(-) create mode 100644 src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp create mode 100644 src/factory/thunder/ctrlmf_thunder_plugin_display_settings.h diff --git a/src/factory/CMakeLists.txt b/src/factory/CMakeLists.txt index 66503201..ebaca4d1 100644 --- a/src/factory/CMakeLists.txt +++ b/src/factory/CMakeLists.txt @@ -26,7 +26,6 @@ set_target_properties( ctrlm-fta PROPERTIES include_directories( . - .. iarm thunder ${CMAKE_SYSROOT}/usr/include/rdk/ds @@ -66,31 +65,29 @@ if(THUNDER) thunder/ctrlmf_thunder_controller.cpp thunder/ctrlmf_thunder_plugin.cpp thunder/ctrlmf_thunder_plugin_system_audio_player.cpp - ../thunder/helpers/ctrlm_thunder_helpers.cpp - ../thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp - ../thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp ) + if(CTRLM_USE_THUNDER_FR_DS) + target_sources(ctrlm-fta PRIVATE + thunder/ctrlmf_thunder_plugin_display_settings.cpp + ) + endif() target_link_libraries(ctrlm-fta WPEFrameworkCore WPEFrameworkPlugins) - target_link_libraries(controlFactory WPEFrameworkCore WPEFrameworkPlugins) if(WPE_FRAMEWORK_COM_SOCKET) target_link_libraries(ctrlm-fta WPEFrameworkCOM WPEFrameworkWebSocket) - target_link_libraries(controlFactory WPEFrameworkCOM WPEFrameworkWebSocket) endif() if(WPE_FRAMEWORK_PROTO_TRACING) target_link_libraries(ctrlm-fta WPEFrameworkProtocols WPEFrameworkTracing) - target_link_libraries(controlFactory WPEFrameworkProtocols WPEFrameworkTracing) endif() if(THUNDER_SECURITY) add_compile_definitions(PRIVATE THUNDER_SECURITY) target_link_libraries(ctrlm-fta WPEFrameworkSecurityUtil secure_wrapper) - target_link_libraries(controlFactory WPEFrameworkSecurityUtil secure_wrapper) endif() endif() if(CTRLM_USE_THUNDER_FR_DS) - add_compile_definitions(PRIVATE CTRLM_USE_THUNDER_FR_DS) + target_compile_definitions(ctrlm-fta PRIVATE CTRLM_USE_THUNDER_FR_DS) endif() install(TARGETS controlFactory DESTINATION bin) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index 73d62abd..51e9ad05 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -7,7 +7,7 @@ #include #ifdef CTRLM_USE_THUNDER_FR_DS -#include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" +#include "thunder/ctrlmf_thunder_plugin_display_settings.h" #else #include "host.hpp" #include "exception.hpp" @@ -68,7 +68,7 @@ bool ctrlmf_audio_control_mute(bool mute) { return(false); } #ifdef CTRLM_USE_THUNDER_FR_DS - auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); + auto *ds = Thunder::DisplaySettings::ctrlmf_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return(false); @@ -79,7 +79,7 @@ bool ctrlmf_audio_control_mute(bool mute) { if(ret) { XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); } else { - XLOGD_WARN("Muting sound via Thunder failed"); + XLOGD_WARN("Muting sound error"); } return(ret); #else @@ -123,7 +123,7 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { XLOGD_INFO("Audio ducking disabled"); } } else { - XLOGD_WARN("Ducking sound via Thunder failed"); + XLOGD_WARN("Ducking sound error"); } return(ret); #else diff --git a/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp b/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp new file mode 100644 index 00000000..3344a288 --- /dev/null +++ b/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp @@ -0,0 +1,61 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2015 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +#include "ctrlmf_thunder_plugin_display_settings.h" +#include +#include +#include +#include +#include + +using namespace Thunder; +using namespace DisplaySettings; +using namespace WPEFramework; + +ctrlmf_thunder_plugin_display_settings_t::ctrlmf_thunder_plugin_display_settings_t() : ctrlm_thunder_plugin_t("DisplaySettings", "org.rdk.DisplaySettings", 1) { +} + +ctrlmf_thunder_plugin_display_settings_t::~ctrlmf_thunder_plugin_display_settings_t() { +} + +ctrlmf_thunder_plugin_display_settings_t *ctrlmf_thunder_plugin_display_settings_t::getInstance() { + static ctrlmf_thunder_plugin_display_settings_t instance; + return &instance; +} + +bool ctrlmf_thunder_plugin_display_settings_t::set_audio_ducking( + bool action, bool type, unsigned char level) { + JsonObject params, response; + params["audioPort"] = "SPEAKER0"; + params["mode"] = "raw"; + params["action"] = action ? "start" : "stop"; + params["duckingType"] = type ? "relative" : "absolute"; + params["level"] = (int)level; + + if(!this->call_plugin("setAudioDucking", (void *)¶ms, (void *)&response)) { + XLOGD_ERROR("DisplaySettings setAudioDucking call failed"); + return false; + } + if(!response["success"].Boolean()) { + std::string resp_str; + response.ToString(resp_str); + XLOGD_ERROR("DisplaySettings setAudioDucking returned failure: %s", resp_str.c_str()); + return false; + } + return true; +} diff --git a/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.h b/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.h new file mode 100644 index 00000000..c0cb4ee4 --- /dev/null +++ b/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.h @@ -0,0 +1,59 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2014 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +#ifndef __CTRLMF_THUNDER_PLUGIN_DISPLAY_SETTINGS_H__ +#define __CTRLMF_THUNDER_PLUGIN_DISPLAY_SETTINGS_H__ +#include "ctrlmf_thunder_plugin.h" + +namespace Thunder { +namespace DisplaySettings { + +/** + * This class is used within Control Factory to interact with the DisplaySettings Thunder Plugin. + */ +class ctrlmf_thunder_plugin_display_settings_t : public Thunder::Plugin::ctrlm_thunder_plugin_t { +public: + /** + * This function is used to get the Thunder Display Settings instance, as it is a Singleton. + * @return The instance of the Thunder Display Settings, or NULL on error. + */ + static ctrlmf_thunder_plugin_display_settings_t *getInstance(); + + /** + * Display Settings Thunder Plugin Destructor + */ + virtual ~ctrlmf_thunder_plugin_display_settings_t(); + + /** + * Calls DisplaySettings.setAudioDucking on the SPEAKER0 audio port. + * @param action true to start ducking, false to stop + * @param type true for relative ducking, false for absolute + * @param level Volume level 0-100 + * @return true on success + */ + bool set_audio_ducking(bool action, bool type, unsigned char level); + +protected: + /** + * DisplaySettings Thunder Plugin Default Constructor + */ + ctrlmf_thunder_plugin_display_settings_t(); +}; +}; +}; +#endif From 593bac6ef5268a8fc9acbc9c3ba3ff7189b0b65d Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 10 Jul 2026 21:08:54 +0530 Subject: [PATCH 25/41] Update call_plugin on ctrlmf_thunder_plugin.h --- src/factory/thunder/ctrlmf_thunder_plugin.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/factory/thunder/ctrlmf_thunder_plugin.h b/src/factory/thunder/ctrlmf_thunder_plugin.h index a3962999..6403236e 100644 --- a/src/factory/thunder/ctrlmf_thunder_plugin.h +++ b/src/factory/thunder/ctrlmf_thunder_plugin.h @@ -101,20 +101,11 @@ class ctrlm_thunder_plugin_t { * This functions is used to call a Thunder Plugin method. * @param method The method in which the user wants to call. * @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) - * @param params The WPEFramework JsonObject containing the response from the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) - * @return True if the call succeeded, otherwise False. - */ - bool call_plugin(std::string method, void *params, void *response); - - /** - * This functions is used to call a Thunder Plugin method with retry support. - * @param method The method in which the user wants to call. - * @param params The WPEFramework JsonObject containing the parameters for the call. - * @param response The WPEFramework JsonObject containing the response from the call. - * @param retries The number of retries if the call times out. + * @param response The WPEFramework JsonObject containing the response from the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) + * @param retries The number of retries if the call times out (defaults to 0). * @return True if the call succeeded, otherwise False. */ - bool call_plugin(std::string method, void *params, void *response, unsigned int retries); + bool call_plugin(std::string method, void *params, void *response, unsigned int retries = 0); /** * This functions is used to call a Thunder Controller method. From d282cf951e5ef5d81e3aa3ac5aee9a6b7b7e7beb Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 10 Jul 2026 21:10:50 +0530 Subject: [PATCH 26/41] Update ctrlmf_thunder_plugin.cpp --- src/factory/thunder/ctrlmf_thunder_plugin.cpp | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/factory/thunder/ctrlmf_thunder_plugin.cpp b/src/factory/thunder/ctrlmf_thunder_plugin.cpp index e8560649..756a3cf5 100644 --- a/src/factory/thunder/ctrlmf_thunder_plugin.cpp +++ b/src/factory/thunder/ctrlmf_thunder_plugin.cpp @@ -186,28 +186,6 @@ void ctrlm_thunder_plugin_t::on_thunder_ready(bool boot) { } } -bool ctrlm_thunder_plugin_t::call_plugin(std::string method, void *params, void *response) { - bool ret = false; - auto clientObject = (JSONRPC::LinkType*)this->plugin_client; - JsonObject *jsonParams = (JsonObject *)params; - JsonObject *jsonResponse = (JsonObject *)response; - if(clientObject) { - if(!method.empty() && jsonParams && jsonResponse) { - uint32_t thunderRet = clientObject->Invoke(CALL_TIMEOUT, _T(method), *jsonParams, *jsonResponse); - if(thunderRet == Core::ERROR_NONE) { - ret = true; - } else { - XLOGD_ERROR("%s: Thunder call failed <%s> <%u>\n", __FUNCTION__, method.c_str(), thunderRet); - } - } else { - XLOGD_ERROR("%s: Invalid parameters\n", __FUNCTION__); - } - } else { - XLOGD_ERROR("%s: Client is NULL\n", __FUNCTION__); - } - return(ret); -} - bool ctrlm_thunder_plugin_t::call_plugin(std::string method, void *params, void *response, unsigned int retries) { bool ret = false; unsigned int attempts = 0; From 569d8624da00af179a8b84f48a7a1c4ac900c87e Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 10 Jul 2026 22:13:52 +0530 Subject: [PATCH 27/41] Update ctrlmf_audio_control.cpp --- src/factory/ctrlmf_audio_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index 51e9ad05..0eacb2da 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -110,7 +110,7 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { bool action = enable; // true = start ducking, false = stop ducking bool type = relative; // true = relative, false = absolute - auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); + auto *ds = Thunder::DisplaySettings::ctrlmf_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return(false); From 53d8d0237de044d3e7b50f98c2b1ad2d78dfeacd Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 10 Jul 2026 22:17:04 +0530 Subject: [PATCH 28/41] Update ctrlm_utils.cpp --- src/ctrlm_utils.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index 2e60487f..e9d6e9a4 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -35,7 +35,6 @@ #include #ifdef CTRLM_USE_THUNDER_FR_DS -#include #include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" #include "thunder/plugins/ctrlm_thunder_plugin_front_panel.h" #else @@ -1634,9 +1633,9 @@ bool ctrlm_dsmgr_mute_audio(bool mute) { bool type = false; // false = absolute ducking bool ret = ds->set_audio_ducking(action, type, mute ? 0 : 100); if(ret) { - XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); + XLOGD_INFO("Audio is %smuted", mute?"":"un-"); } else { - XLOGD_WARN("Muting sound via Thunder failed"); + XLOGD_WARN("Muting sound error"); } return ret; #else @@ -1676,7 +1675,7 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { XLOGD_INFO("Audio ducking disabled"); } } else { - XLOGD_WARN("Ducking sound via Thunder failed"); + XLOGD_WARN("Muting sound error"); } return ret; #else @@ -1711,7 +1710,7 @@ bool ctrlm_dsmgr_LED(bool on) { } bool ret = on ? fp->power_led_on(100) : fp->power_led_off(); if(!ret) { - XLOGD_WARN("LED control via Thunder failed"); + XLOGD_WARN("LED error"); } return ret; #else From 610ae7be1beb7027a5f40e2eb81167769daf7fd5 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 10 Jul 2026 22:18:10 +0530 Subject: [PATCH 29/41] Update ctrlm_voice_obj.cpp --- src/voice/ctrlm_voice_obj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index 983e06bc..c81a629a 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -1373,7 +1373,7 @@ ctrlm_voice_session_response_status_t ctrlm_voice_t::voice_session_req(ctrlm_net request_params.type = XRSR_SESSION_REQUEST_TYPE_INVALID; uint8_t dst_index = 0; - + if(is_session_by_text) { XLOGD_INFO("Requesting the speech router start a text-only session with transcription = <%s>", l_transcription_in); if(session->state_src == CTRLM_VOICE_STATE_SRC_STREAMING || session->state_dst != CTRLM_VOICE_STATE_DST_READY) { From 0ff2be65a235c6dad344420e60b3bea8361b6598 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:40:00 +0530 Subject: [PATCH 30/41] Update ctrlm_utils.cpp --- src/ctrlm_utils.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index e9d6e9a4..23c4e9a2 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -1653,21 +1653,30 @@ bool ctrlm_dsmgr_mute_audio(bool mute) { } bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Function called: enable=%d, relative=%d, vol=%f", enable, relative, vol); if(vol < 0 || vol > 1) { + XLOGD_ERROR("[CTRLM_DUCK_AUDIO] Invalid volume %f (must be 0.0-1.0)", vol); XLOGD_ERROR("Invalid volume"); return false; } #ifdef CTRLM_USE_THUNDER_FR_DS + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Using CTRLM_USE_THUNDER_FR_DS path"); unsigned char level = (unsigned char)((vol * 100) + 0.5); bool action = enable; // true = start ducking, false = stop ducking bool type = relative; // true = relative, false = absolute + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Calculated: action=%d, type=%d, level=%u", action, type, level); + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Getting DisplaySettings instance..."); auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { + XLOGD_ERROR("[CTRLM_DUCK_AUDIO] DisplaySettings plugin not available"); XLOGD_ERROR("DisplaySettings plugin not available"); return false; } + XLOGD_INFO("[CTRLM_DUCK_AUDIO] DisplaySettings instance obtained successfully"); + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Calling set_audio_ducking..."); bool ret = ds->set_audio_ducking(action, type, level); + XLOGD_INFO("[CTRLM_DUCK_AUDIO] set_audio_ducking returned: %d", ret); if(ret) { if(enable) { XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); @@ -1677,15 +1686,20 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { } else { XLOGD_WARN("Muting sound error"); } + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Returning: %d", ret); return ret; #else + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Using device::Host (non-Thunder) path"); try { unsigned char level = (unsigned char)((vol * 100) + 0.5); dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Calculated: action=%d, type=%d, level=%u", action, type, level); + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Calling device::Host::getInstance().getAudioOutputPort(SPEAKER0).setAudioDucking..."); device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); + XLOGD_INFO("[CTRLM_DUCK_AUDIO] setAudioDucking call completed successfully"); if(enable) { XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); @@ -1697,6 +1711,7 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { XLOGD_WARN("Ducking sound error : %s", error.what()); return false; } + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Returning: true"); return true; #endif } From 3a5429581c24487b4474bec2243e5da8d8fbf5dc Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:43:52 +0530 Subject: [PATCH 31/41] Update ctrlm_thunder_plugin_display_settings.cpp --- .../ctrlm_thunder_plugin_display_settings.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp index a56c0d24..80551a46 100644 --- a/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp +++ b/src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp @@ -189,6 +189,7 @@ void ctrlm_thunder_plugin_display_settings_t::on_initial_activation() { bool ctrlm_thunder_plugin_display_settings_t::set_audio_ducking( bool action, bool type, unsigned char level) { + XLOGD_INFO("[THUNDER_DS_DUCKING] Function called: action=%d (%s), type=%d (%s), level=%u", action, action ? "start" : "stop", type, type ? "relative" : "absolute", level); JsonObject params, response; params["audioPort"] = "SPEAKER0"; params["mode"] = "raw"; @@ -196,15 +197,26 @@ bool ctrlm_thunder_plugin_display_settings_t::set_audio_ducking( params["duckingType"] = type ? "relative" : "absolute"; params["level"] = (int)level; + std::string params_str; + params.ToString(params_str); + XLOGD_INFO("[THUNDER_DS_DUCKING] JSON params: %s", params_str.c_str()); + + XLOGD_INFO("[THUNDER_DS_DUCKING] Calling DisplaySettings plugin 'setAudioDucking'..."); if(!this->call_plugin("setAudioDucking", (void *)¶ms, (void *)&response)) { XLOGD_ERROR("DisplaySettings setAudioDucking call failed"); return false; } + XLOGD_INFO("[THUNDER_DS_DUCKING] call_plugin returned true, checking response..."); + + std::string response_str; + response.ToString(response_str); + XLOGD_INFO("[THUNDER_DS_DUCKING] Response JSON: %s", response_str.c_str()); + if(!response["success"].Boolean()) { - std::string resp_str; - response.ToString(resp_str); - XLOGD_ERROR("DisplaySettings setAudioDucking returned failure: %s", resp_str.c_str()); + XLOGD_ERROR("[THUNDER_DS_DUCKING] success=false in response"); + XLOGD_ERROR("DisplaySettings setAudioDucking returned failure: %s", response_str.c_str()); return false; } + XLOGD_INFO("[THUNDER_DS_DUCKING] SUCCESS: Returning true"); return true; } From 9bc6f4efdb2796b02107671667b3fafb3a7638ea Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Wed, 15 Jul 2026 17:03:52 +0530 Subject: [PATCH 32/41] Update ctrlmf_audio_control.cpp --- src/factory/ctrlmf_audio_control.cpp | 35 ++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index 0eacb2da..07e46e58 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -63,40 +63,59 @@ bool ctrlmf_audio_control_term(void) { } bool ctrlmf_audio_control_mute(bool mute) { + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Function called: mute=%d", mute); if(!ctrlmf_is_initialized()) { XLOGD_ERROR("not initialized"); return(false); } #ifdef CTRLM_USE_THUNDER_FR_DS + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Using CTRLM_USE_THUNDER_FR_DS path"); + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Getting DisplaySettings instance..."); + auto *ds = Thunder::DisplaySettings::ctrlmf_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return(false); } + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] DisplaySettings instance obtained"); bool action = mute; // true = start ducking (mute), false = stop ducking (unmute) bool type = false; // false = absolute ducking - bool ret = ds->set_audio_ducking(action, type, mute ? 0 : 100); + unsigned char level = mute ? 0 : 100; + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Calculated: action=%d, type=%d, level=%u", action, type, level); + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Calling set_audio_ducking..."); + bool ret = ds->set_audio_ducking(action, type, level); + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] set_audio_ducking returned: %d", ret); + if(ret) { XLOGD_INFO("Audio is %smuted", mute ? "" : "un-"); } else { XLOGD_WARN("Muting sound error"); } + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Returning: %d", ret); return(ret); #else + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Using device::Host (non-Thunder) path"); try { dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); + unsigned char level = mute ? 0 : 100; + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Calculated: action=%d, level=%u", action, level); + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Calling device::Host::getInstance().getAudioOutputPort(SPEAKER0).setAudioDucking..."); + device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, level); + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] setAudioDucking call completed successfully"); + XLOGD_INFO("Audio is %smuted", mute?"":"un-"); } catch(std::exception& error) { XLOGD_WARN("Muting sound error : %s", error.what()); return(false); } + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Returning: true"); return(true); #endif } bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Function called: enable=%d, relative=%d, vol=%f", enable, relative, vol); if(!ctrlmf_is_initialized()) { XLOGD_ERROR("not initialized"); return(false); @@ -106,16 +125,22 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { return(false); } #ifdef CTRLM_USE_THUNDER_FR_DS + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Using CTRLM_USE_THUNDER_FR_DS path"); unsigned char level = (unsigned char)((vol * 100) + 0.5); bool action = enable; // true = start ducking, false = stop ducking bool type = relative; // true = relative, false = absolute + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Calculated: action=%d, type=%d, level=%u", action, type, level); + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Getting DisplaySettings instance..."); auto *ds = Thunder::DisplaySettings::ctrlmf_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); return(false); } + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] DisplaySettings instance obtained successfully"); + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Calling set_audio_ducking..."); bool ret = ds->set_audio_ducking(action, type, level); + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] set_audio_ducking returned: %d", ret); if(ret) { if(enable) { XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); @@ -125,15 +150,20 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { } else { XLOGD_WARN("Ducking sound error"); } + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Returning: %d", ret); return(ret); #else + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Using device::Host (non-Thunder) path"); try { unsigned char level = (unsigned char)((vol * 100) + 0.5); dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Calculated: action=%d, type=%d, level=%u", action, type, level); + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Calling device::Host::getInstance().getAudioOutputPort(SPEAKER0).setAudioDucking..."); device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] setAudioDucking call completed successfully"); if(enable) { XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); @@ -145,6 +175,7 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { XLOGD_WARN("Ducking sound error : %s", error.what()); return(false); } + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Returning: true"); return(true); #endif } From 99ed73740c10c37fe8ca6af350586cfd793c4269 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Wed, 15 Jul 2026 17:06:28 +0530 Subject: [PATCH 33/41] Update ctrlmf_thunder_plugin_display_settings.cpp --- .../ctrlmf_thunder_plugin_display_settings.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp b/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp index 3344a288..3635bf05 100644 --- a/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp +++ b/src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp @@ -40,6 +40,7 @@ ctrlmf_thunder_plugin_display_settings_t *ctrlmf_thunder_plugin_display_settings bool ctrlmf_thunder_plugin_display_settings_t::set_audio_ducking( bool action, bool type, unsigned char level) { + XLOGD_INFO("[CTRLMF_THUNDER_DS_DUCKING] Function called: action=%d (%s), type=%d (%s), level=%u", action, action ? "start" : "stop", type, type ? "relative" : "absolute", level); JsonObject params, response; params["audioPort"] = "SPEAKER0"; params["mode"] = "raw"; @@ -47,15 +48,25 @@ bool ctrlmf_thunder_plugin_display_settings_t::set_audio_ducking( params["duckingType"] = type ? "relative" : "absolute"; params["level"] = (int)level; + std::string params_str; + params.ToString(params_str); + XLOGD_INFO("[CTRLMF_THUNDER_DS_DUCKING] JSON params: %s", params_str.c_str()); + + XLOGD_INFO("[CTRLMF_THUNDER_DS_DUCKING] Calling DisplaySettings plugin 'setAudioDucking'..."); if(!this->call_plugin("setAudioDucking", (void *)¶ms, (void *)&response)) { XLOGD_ERROR("DisplaySettings setAudioDucking call failed"); return false; } + XLOGD_INFO("[CTRLMF_THUNDER_DS_DUCKING] call_plugin returned true, checking response..."); + + std::string response_str; + response.ToString(response_str); + XLOGD_INFO("[CTRLMF_THUNDER_DS_DUCKING] Response JSON: %s", response_str.c_str()); + if(!response["success"].Boolean()) { - std::string resp_str; - response.ToString(resp_str); - XLOGD_ERROR("DisplaySettings setAudioDucking returned failure: %s", resp_str.c_str()); + XLOGD_ERROR("DisplaySettings setAudioDucking returned failure: %s", response_str.c_str()); return false; } + XLOGD_INFO("[CTRLMF_THUNDER_DS_DUCKING] SUCCESS: Returning true"); return true; } From 68611eaa437cfee4a276c88d2f5deb480fe79213 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:16:16 +0530 Subject: [PATCH 34/41] Update ctrlm_utils.cpp --- src/ctrlm_utils.cpp | 120 ++------------------------------------------ 1 file changed, 3 insertions(+), 117 deletions(-) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index 23c4e9a2..77e4167c 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -34,22 +34,7 @@ #include #include -#ifdef CTRLM_USE_THUNDER_FR_DS #include "thunder/plugins/ctrlm_thunder_plugin_display_settings.h" -#include "thunder/plugins/ctrlm_thunder_plugin_front_panel.h" -#else -#include "host.hpp" -#include "exception.hpp" -#include "videoOutputPort.hpp" -#include "videoOutputPortType.hpp" -#include "videoOutputPortConfig.hpp" -#include "audioOutputPort.hpp" -#include "frontPanelIndicator.hpp" -#include "manager.hpp" -#include "dsMgr.h" -#include "dsRpc.h" -#include "dsDisplay.h" -#endif #include using std::map; @@ -1584,46 +1569,14 @@ char *ctrlm_do_regex(char *re, char *str) { } bool ctrlm_dsmgr_init() { -#ifdef CTRLM_USE_THUNDER_FR_DS - // DSMgr initialization is no longer needed; Thunder plugins self-initialise. - return true; -#else - if(device::Manager::IsInitialized) { - XLOGD_INFO("DSMgr already initialized"); - return true; - } - try { - device::Manager::Initialize(); - XLOGD_INFO("DSMgr is initialized"); - } - catch (...) { - XLOGD_WARN("Failed to initialize DSMgr"); - return false; - } return true; -#endif } bool ctrlm_dsmgr_deinit() { -#ifdef CTRLM_USE_THUNDER_FR_DS - // DSMgr deinitialization is no longer needed; Thunder plugins self-manage. - return true; -#else - try { - if(device::Manager::IsInitialized) { - device::Manager::DeInitialize(); - } - } - catch(...) { - XLOGD_WARN("Failed to deinitialize DSMgr"); - return false; - } return true; -#endif } bool ctrlm_dsmgr_mute_audio(bool mute) { -#ifdef CTRLM_USE_THUNDER_FR_DS auto *ds = Thunder::DisplaySettings::ctrlm_thunder_plugin_display_settings_t::getInstance(); if(!ds) { XLOGD_ERROR("DisplaySettings plugin not available"); @@ -1638,18 +1591,6 @@ bool ctrlm_dsmgr_mute_audio(bool mute) { XLOGD_WARN("Muting sound error"); } return ret; -#else - try { - dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, mute ? 0 : 100); - XLOGD_INFO("Audio is %smuted", mute?"":"un-"); - } - catch(std::exception& error) { - XLOGD_WARN("Muting sound error : %s", error.what()); - return false; - } - return true; -#endif } bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { @@ -1659,8 +1600,8 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { XLOGD_ERROR("Invalid volume"); return false; } -#ifdef CTRLM_USE_THUNDER_FR_DS - XLOGD_INFO("[CTRLM_DUCK_AUDIO] Using CTRLM_USE_THUNDER_FR_DS path"); + + XLOGD_INFO("[CTRLM_DUCK_AUDIO] Using thunder displaysetting path"); unsigned char level = (unsigned char)((vol * 100) + 0.5); bool action = enable; // true = start ducking, false = stop ducking bool type = relative; // true = relative, false = absolute @@ -1688,63 +1629,8 @@ bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) { } XLOGD_INFO("[CTRLM_DUCK_AUDIO] Returning: %d", ret); return ret; -#else - XLOGD_INFO("[CTRLM_DUCK_AUDIO] Using device::Host (non-Thunder) path"); - try { - unsigned char level = (unsigned char)((vol * 100) + 0.5); - - dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; - XLOGD_INFO("[CTRLM_DUCK_AUDIO] Calculated: action=%d, type=%d, level=%u", action, type, level); - - XLOGD_INFO("[CTRLM_DUCK_AUDIO] Calling device::Host::getInstance().getAudioOutputPort(SPEAKER0).setAudioDucking..."); - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); - XLOGD_INFO("[CTRLM_DUCK_AUDIO] setAudioDucking call completed successfully"); - - if(enable) { - XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); - } else { - XLOGD_INFO("Audio ducking disabled"); - } - } - catch(std::exception& error) { - XLOGD_WARN("Ducking sound error : %s", error.what()); - return false; - } - XLOGD_INFO("[CTRLM_DUCK_AUDIO] Returning: true"); - return true; -#endif -} - -bool ctrlm_dsmgr_LED(bool on) { -#ifdef CTRLM_USE_THUNDER_FR_DS - auto *fp = Thunder::FrontPanel::ctrlm_thunder_plugin_front_panel_t::getInstance(); - if(!fp) { - XLOGD_ERROR("FrontPanel plugin not available"); - return false; - } - bool ret = on ? fp->power_led_on(100) : fp->power_led_off(); - if(!ret) { - XLOGD_WARN("LED error"); - } - return ret; -#else - try { - device::FrontPanelIndicator &led = device::FrontPanelIndicator::getInstance("Power"); - if (on) { - led.setColor(0xFFFFFF); - led.setBrightness(100); - } - led.setState(on); - } - catch(std::exception& error) { - XLOGD_WARN("LED error : %s", error.what()); - return false; - } - return true; -#endif } - + bool ctrlm_is_voice_assistant(ctrlm_rcu_controller_type_t controller_type) { switch(controller_type) { case CTRLM_RCU_CONTROLLER_TYPE_XR19: From 44d965dcf8f3308d028f5d7a182d444037d654a2 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:16:49 +0530 Subject: [PATCH 35/41] Delete src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp --- .../ctrlm_thunder_plugin_front_panel.cpp | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100644 src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp b/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp deleted file mode 100644 index c69953c5..00000000 --- a/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2015 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ -#include "ctrlm_thunder_plugin_front_panel.h" -#include "ctrlm_log.h" -#include -#include -#include - -using namespace Thunder; -using namespace FrontPanel; -using namespace WPEFramework; - -ctrlm_thunder_plugin_front_panel_t::ctrlm_thunder_plugin_front_panel_t() - : ctrlm_thunder_plugin_t("FrontPanel", "org.rdk.FrontPanel", 1) { -} - -ctrlm_thunder_plugin_front_panel_t::~ctrlm_thunder_plugin_front_panel_t() { -} - -ctrlm_thunder_plugin_front_panel_t *ctrlm_thunder_plugin_front_panel_t::getInstance() { - static ctrlm_thunder_plugin_front_panel_t instance; - return &instance; -} - -void ctrlm_thunder_plugin_front_panel_t::on_initial_activation() { - Thunder::Plugin::ctrlm_thunder_plugin_t::on_initial_activation(); -} - -bool ctrlm_thunder_plugin_front_panel_t::power_led_on(int brightness) { - // Set LED colour (white = 0xFFFFFF) and brightness via setLED first - JsonObject params_led, response_led; - params_led["ledIndicator"] = "power_led"; - params_led["brightness"] = brightness; - params_led["color"] = "white"; - params_led["red"] = 255; - params_led["green"] = 255; - params_led["blue"] = 255; - bool ret = this->call_plugin("setLED", (void *)¶ms_led, (void *)&response_led); - if(!ret) { - XLOGD_ERROR("FrontPanel setLED call failed"); - } - - // Activate the LED via powerLedOn - JsonObject params_on, response_on; - params_on["index"] = "power_led"; - if(!this->call_plugin("powerLedOn", (void *)¶ms_on, (void *)&response_on)) { - XLOGD_ERROR("FrontPanel powerLedOn call failed"); - ret = false; - } - return ret; -} - -bool ctrlm_thunder_plugin_front_panel_t::power_led_off() { - JsonObject params, response; - params["index"] = "power_led"; - if(!this->call_plugin("powerLedOff", (void *)¶ms, (void *)&response)) { - XLOGD_ERROR("FrontPanel powerLedOff call failed"); - return false; - } - return true; -} - -bool ctrlm_thunder_plugin_front_panel_t::set_brightness(int brightness) { - JsonObject params, response; - params["index"] = "power_led"; - params["brightness"] = brightness; - if(!this->call_plugin("setBrightness", (void *)¶ms, (void *)&response)) { - XLOGD_ERROR("FrontPanel setBrightness call failed"); - return false; - } - return true; -} From 5b2a8074208ca50d6cbbbc5bd8267a2b1cc75cf1 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:17:11 +0530 Subject: [PATCH 36/41] Delete src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h --- .../ctrlm_thunder_plugin_front_panel.h | 96 ------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h diff --git a/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h b/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h deleted file mode 100644 index de0bccd3..00000000 --- a/src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2015 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ -#ifndef __CTRLM_THUNDER_PLUGIN_FRONT_PANEL_H__ -#define __CTRLM_THUNDER_PLUGIN_FRONT_PANEL_H__ -#include "ctrlm_thunder_plugin.h" - -namespace Thunder { -namespace FrontPanel { - -/** - * This class is used within ControlMgr to interact with the FrontPanel Thunder Plugin. - * It replaces direct libds device::FrontPanelIndicator calls with Thunder plugin calls. - * - * libds → Thunder mapping: - * FrontPanelIndicator::setColor(0xFFFFFF) - * + FrontPanelIndicator::setBrightness() → setLED (ledIndicator="power_led", brightness, color, red, green, blue) - * FrontPanelIndicator::setState(true) → powerLedOn (index="power_led") - * FrontPanelIndicator::setState(false) → powerLedOff (index="power_led") - * FrontPanelIndicator::setBrightness() → setBrightness (index="power_led", brightness) - * Note: toPersist semantics are not preserved by the FrontPanel Thunder plugin API. - */ -class ctrlm_thunder_plugin_front_panel_t : public Thunder::Plugin::ctrlm_thunder_plugin_t { -public: - /** - * Returns the singleton instance of the FrontPanel Thunder plugin. - * @return The instance, or NULL on error. - */ - static ctrlm_thunder_plugin_front_panel_t *getInstance(); - - /** - * FrontPanel Thunder Plugin Destructor - */ - virtual ~ctrlm_thunder_plugin_front_panel_t(); - - /** - * Turns the Power LED on: sets colour (white/0xFFFFFF) and brightness via setLED, - * then activates the LED via powerLedOn. - * Calls Thunder: org.rdk.FrontPanel.setLED + org.rdk.FrontPanel.powerLedOn - * Note: toPersist semantics are not preserved (not supported by the plugin API). - * @param brightness Level 0-100, default 100. - * @return true on success. - */ - bool power_led_on(int brightness = 100); - - /** - * Turns the Power LED off. - * Calls Thunder: org.rdk.FrontPanel.powerLedOff - * @return true on success. - */ - bool power_led_off(); - - /** - * Sets the brightness of the Power LED without changing its on/off state. - * Calls Thunder: org.rdk.FrontPanel.setBrightness - * Note: persist semantics are not preserved (not supported by the plugin API). - * @param brightness Level 0-100. - * @return true on success. - */ - bool set_brightness(int brightness); - -protected: - /** - * FrontPanel Thunder Plugin Default Constructor - */ - ctrlm_thunder_plugin_front_panel_t(); - - /** - * No events to register for this plugin. - */ - virtual bool register_events() { return true; } - - /** - * Nothing to do on initial activation. - */ - virtual void on_initial_activation(); -}; - -}; -}; -#endif From 90fe8f5449de2532b2890d7d561aed89873a5434 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:18:44 +0530 Subject: [PATCH 37/41] Update CMakeLists.txt --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5103c20..00266a6f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ option(RF4CE_ENABLED "Enable RF4CE" ON) option(TELEMETRY_SUPPORT "Enable TELEMETRY_SUPPORT" OFF) option(THUNDER "Enable THUNDER" ON) option(THUNDER_SECURITY "Enable THUNDER_SECURITY" OFF) -option(CTRLM_USE_THUNDER_FR_DS "Use Thunder for DisplaySettings and FrontPanel instead of DSMgr" ON) option(USE_SAFEC "Use safec" OFF) option(USE_IARM_POWER_MANAGER "Use IARM Power Manager" OFF) option(XRSR_HTTP "Enable XRSR_HTTP" OFF) From 1eab5981bba57f2e3027bf424cc45ae3cda3013c Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:19:52 +0530 Subject: [PATCH 38/41] Update CMakeLists.txt --- src/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f22410cd..93f3f745 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -196,7 +196,6 @@ if(THUNDER) thunder/plugins/ctrlm_thunder_plugin_cec_sink.cpp thunder/plugins/ctrlm_thunder_plugin_cec_source.cpp thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp - thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp thunder/plugins/ctrlm_thunder_plugin_device_info.cpp thunder/plugins/ctrlm_thunder_plugin_av_input.cpp thunder/plugins/ctrlm_thunder_plugin_hdmi_input.cpp @@ -216,10 +215,6 @@ if(THUNDER) endif() endif() -if(CTRLM_USE_THUNDER_FR_DS) - target_compile_definitions(controlMgr PRIVATE CTRLM_USE_THUNDER_FR_DS) -endif() - if(XRSR_HTTP) target_sources(controlMgr PRIVATE voice/endpoints/ctrlm_voice_endpoint_http.cpp From 6b3a6ff706d13586c9fe763490f9d6c1d2cd7184 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:21:46 +0530 Subject: [PATCH 39/41] Update CMakeLists.txt --- src/factory/CMakeLists.txt | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/factory/CMakeLists.txt b/src/factory/CMakeLists.txt index ebaca4d1..535481f3 100644 --- a/src/factory/CMakeLists.txt +++ b/src/factory/CMakeLists.txt @@ -50,10 +50,6 @@ target_sources(ctrlm-fta PRIVATE target_link_libraries(ctrlm-fta c rdkversion dbus-1 glib-2.0 IARMBus xr-voice-sdk pthread nopoll secure_wrapper) target_link_libraries(controlFactory c ctrlm-fta secure_wrapper) -if(NOT CTRLM_USE_THUNDER_FR_DS) - target_link_libraries(ctrlm-fta ds) -endif() - if(AUTH_ENABLED) add_compile_definitions(PRIVATE CTRLMF_WSS_ENABLED) target_link_libraries(ctrlm-fta RdkCertSelector rdkconfig) @@ -65,12 +61,8 @@ if(THUNDER) thunder/ctrlmf_thunder_controller.cpp thunder/ctrlmf_thunder_plugin.cpp thunder/ctrlmf_thunder_plugin_system_audio_player.cpp + thunder/ctrlmf_thunder_plugin_display_settings.cpp ) - if(CTRLM_USE_THUNDER_FR_DS) - target_sources(ctrlm-fta PRIVATE - thunder/ctrlmf_thunder_plugin_display_settings.cpp - ) - endif() target_link_libraries(ctrlm-fta WPEFrameworkCore WPEFrameworkPlugins) if(WPE_FRAMEWORK_COM_SOCKET) @@ -86,9 +78,5 @@ if(THUNDER) endif() endif() -if(CTRLM_USE_THUNDER_FR_DS) - target_compile_definitions(ctrlm-fta PRIVATE CTRLM_USE_THUNDER_FR_DS) -endif() - install(TARGETS controlFactory DESTINATION bin) install(TARGETS ctrlm-fta LIBRARY DESTINATION lib) From ffa57b61c3409fb56b665a31b0f17f27176fe684 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:24:38 +0530 Subject: [PATCH 40/41] Update ctrlmf_audio_control.cpp --- src/factory/ctrlmf_audio_control.cpp | 95 +--------------------------- 1 file changed, 2 insertions(+), 93 deletions(-) diff --git a/src/factory/ctrlmf_audio_control.cpp b/src/factory/ctrlmf_audio_control.cpp index 07e46e58..0a450d3a 100644 --- a/src/factory/ctrlmf_audio_control.cpp +++ b/src/factory/ctrlmf_audio_control.cpp @@ -6,60 +6,16 @@ #include #include -#ifdef CTRLM_USE_THUNDER_FR_DS #include "thunder/ctrlmf_thunder_plugin_display_settings.h" -#else -#include "host.hpp" -#include "exception.hpp" -#include "videoOutputPort.hpp" -#include "videoOutputPortType.hpp" -#include "videoOutputPortConfig.hpp" -#include "audioOutputPort.hpp" -#include "frontPanelIndicator.hpp" -#include "manager.hpp" -#include "dsMgr.h" -#include "dsRpc.h" -#include "dsDisplay.h" -#include -#endif bool ctrlmf_audio_control_init(void) { -#ifdef CTRLM_USE_THUNDER_FR_DS // DSMgr initialization is no longer needed; Thunder plugins self-initialise. return(true); -#else - if(device::Manager::IsInitialized) { - XLOGD_INFO("DSMgr already initialized"); - return(true); - } - try { - device::Manager::Initialize(); - XLOGD_INFO("DSMgr is initialized"); - } - catch (...) { - XLOGD_WARN("Failed to initialize DSMgr"); - return(false); - } - return(true); -#endif } bool ctrlmf_audio_control_term(void) { -#ifdef CTRLM_USE_THUNDER_FR_DS // DSMgr deinitialization is no longer needed; Thunder plugins self-manage. return(true); -#else - try { - if(device::Manager::IsInitialized) { - device::Manager::DeInitialize(); - } - } - catch(...) { - XLOGD_WARN("Failed to deinitialize DSMgr"); - return(false); - } - return(true); -#endif } bool ctrlmf_audio_control_mute(bool mute) { @@ -68,8 +24,7 @@ bool ctrlmf_audio_control_mute(bool mute) { XLOGD_ERROR("not initialized"); return(false); } -#ifdef CTRLM_USE_THUNDER_FR_DS - XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Using CTRLM_USE_THUNDER_FR_DS path"); + XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Using Displaysettings path"); XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Getting DisplaySettings instance..."); auto *ds = Thunder::DisplaySettings::ctrlmf_thunder_plugin_display_settings_t::getInstance(); @@ -93,25 +48,6 @@ bool ctrlmf_audio_control_mute(bool mute) { } XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Returning: %d", ret); return(ret); -#else - XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Using device::Host (non-Thunder) path"); - try { - dsAudioDuckingAction_t action = mute ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - unsigned char level = mute ? 0 : 100; - XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Calculated: action=%d, level=%u", action, level); - XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Calling device::Host::getInstance().getAudioOutputPort(SPEAKER0).setAudioDucking..."); - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, dsAUDIO_DUCKINGTYPE_ABSOLUTE, level); - XLOGD_INFO("[CTRLMF_AUDIO_MUTE] setAudioDucking call completed successfully"); - - XLOGD_INFO("Audio is %smuted", mute?"":"un-"); - } - catch(std::exception& error) { - XLOGD_WARN("Muting sound error : %s", error.what()); - return(false); - } - XLOGD_INFO("[CTRLMF_AUDIO_MUTE] Returning: true"); - return(true); -#endif } bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { @@ -124,8 +60,7 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { XLOGD_ERROR("Invalid volume"); return(false); } -#ifdef CTRLM_USE_THUNDER_FR_DS - XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Using CTRLM_USE_THUNDER_FR_DS path"); + XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Using Displaysettings path"); unsigned char level = (unsigned char)((vol * 100) + 0.5); bool action = enable; // true = start ducking, false = stop ducking bool type = relative; // true = relative, false = absolute @@ -152,30 +87,4 @@ bool ctrlmf_audio_control_attenuate(bool enable, bool relative, double vol) { } XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Returning: %d", ret); return(ret); -#else - XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Using device::Host (non-Thunder) path"); - try { - unsigned char level = (unsigned char)((vol * 100) + 0.5); - - dsAudioDuckingAction_t action = enable ? dsAUDIO_DUCKINGACTION_START : dsAUDIO_DUCKINGACTION_STOP; - dsAudioDuckingType_t type = relative ? dsAUDIO_DUCKINGTYPE_RELATIVE : dsAUDIO_DUCKINGTYPE_ABSOLUTE; - XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Calculated: action=%d, type=%d, level=%u", action, type, level); - - XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Calling device::Host::getInstance().getAudioOutputPort(SPEAKER0).setAudioDucking..."); - device::Host::getInstance().getAudioOutputPort("SPEAKER0").setAudioDucking(action, type, level); - XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] setAudioDucking call completed successfully"); - - if(enable) { - XLOGD_INFO("Audio ducking enabled - type <%s> level <%u%%>", relative ? "RELATIVE" : "ABSOLUTE", level); - } else { - XLOGD_INFO("Audio ducking disabled"); - } - } - catch(std::exception& error) { - XLOGD_WARN("Ducking sound error : %s", error.what()); - return(false); - } - XLOGD_INFO("[CTRLMF_AUDIO_ATTENUATE] Returning: true"); - return(true); -#endif } From fc18d455c42ae258de7549bae572680666324c14 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:26:19 +0530 Subject: [PATCH 41/41] Update ctrlm_utils.h --- src/ctrlm_utils.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ctrlm_utils.h b/src/ctrlm_utils.h index baed40e7..23f97184 100644 --- a/src/ctrlm_utils.h +++ b/src/ctrlm_utils.h @@ -231,7 +231,6 @@ char *ctrlm_do_regex(char *re, char *str); bool ctrlm_dsmgr_init(); bool ctrlm_dsmgr_mute_audio(bool mute); bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol); -bool ctrlm_dsmgr_LED(bool on); bool ctrlm_dsmgr_deinit(); bool ctrlm_is_voice_assistant(ctrlm_rcu_controller_type_t controller_type);