Skip to content

RDKEMW-20784: Support ctrlmain to use thunder plugin for libds methods and events - #259

Open
balav08 wants to merge 41 commits into
developfrom
feature/RDKEMW-20784_1
Open

RDKEMW-20784: Support ctrlmain to use thunder plugin for libds methods and events#259
balav08 wants to merge 41 commits into
developfrom
feature/RDKEMW-20784_1

Conversation

@balav08

@balav08 balav08 commented Jul 3, 2026

Copy link
Copy Markdown

Reason for change: Support ctrlmain to use thunder plugin for libds methods.
Test procedure: refer ticket
Risks: Medium
Priority: P2
version: Patch

@balav08
balav08 requested a review from a team as a code owner July 3, 2026 04:04
Copilot AI review requested due to automatic review settings July 3, 2026 04:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ControlMgr to use Thunder plugin APIs (instead of direct libds/DSMgr calls) for audio ducking and front panel LED control, and extends the Thunder plugin wrapper utilities to better support these calls.

Changes:

  • Added a new FrontPanel Thunder plugin wrapper to control the power LED.
  • Added DisplaySettings.setAudioDucking wrapper and migrated audio mute/ducking callers to use it.
  • Added a retry-capable call_plugin() overload and updated build files to compile/link the new Thunder sources (including for factory builds).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/voice/ctrlm_voice_obj.cpp Minor whitespace-only change in voice session request code.
src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h New FrontPanel wrapper interface for power LED operations.
src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp New FrontPanel wrapper implementation (setLED / powerLedOn/Off / setBrightness).
src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h Added set_audio_ducking() API using dsAudio ducking enums.
src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp Implemented Thunder call to setAudioDucking and checks response.
src/factory/thunder/ctrlmf_thunder_plugin.h Added retry-capable call_plugin() overload declaration.
src/factory/thunder/ctrlmf_thunder_plugin.cpp Implemented retry-on-timeout logic for Thunder JSON-RPC calls.
src/factory/ctrlmf_audio_control.cpp Migrated mute/attenuation audio ducking to Thunder DisplaySettings plugin.
src/factory/CMakeLists.txt Removed ds link from ctrlm-fta; added Thunder sources and WPEFramework link libs for factory.
src/ctrlm_utils.cpp Migrated DSMgr helper functions (audio ducking + LED) to Thunder plugin wrappers.
src/CMakeLists.txt Added new FrontPanel plugin wrapper source to the main build.

Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/factory/ctrlmf_audio_control.cpp
Comment thread src/ctrlm_utils.cpp Outdated
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.

Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h
Comment thread src/factory/CMakeLists.txt Outdated
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/ctrlm_utils.cpp Outdated
Comment thread src/CMakeLists.txt Outdated
Comment thread src/factory/thunder/ctrlmf_thunder_plugin.h Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 12:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Comment thread src/factory/CMakeLists.txt
Comment thread src/ctrlm_utils.cpp Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 12:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Comment thread src/factory/CMakeLists.txt
Comment thread src/ctrlm_utils.cpp Outdated
Comment thread src/factory/thunder/ctrlmf_thunder_plugin.cpp
Comment thread src/factory/thunder/ctrlmf_thunder_plugin.h Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 12:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 13 comments.

Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_display_settings.h
Comment thread src/factory/thunder/ctrlmf_thunder_plugin_display_settings.h
Comment thread CMakeLists.txt Outdated
Comment thread src/CMakeLists.txt Outdated
Comment thread src/factory/CMakeLists.txt Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.

Comment thread CMakeLists.txt
Comment thread src/CMakeLists.txt Outdated
Comment thread src/factory/CMakeLists.txt Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp
Comment thread src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 11:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.

Comment thread CMakeLists.txt Outdated
Comment thread src/CMakeLists.txt Outdated
Comment thread src/factory/CMakeLists.txt Outdated
Comment thread src/factory/CMakeLists.txt Outdated
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.h Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 11:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.

Comment thread src/CMakeLists.txt Outdated
Comment thread src/factory/CMakeLists.txt Outdated
Comment thread src/factory/CMakeLists.txt Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_front_panel.cpp Outdated
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp
Comment thread src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp
Copilot AI review requested due to automatic review settings July 16, 2026 03:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 12 comments.

Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/factory/ctrlmf_audio_control.cpp
Comment thread src/factory/ctrlmf_audio_control.cpp
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Copilot AI review requested due to automatic review settings July 16, 2026 03:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

src/factory/ctrlmf_audio_control.cpp:127

  • Same issue as above: CTRLM_USE_THUNDER_FR_DS is undefined, so the Thunder attenuate path is dead code. Use CTRLMF_THUNDER for consistency with the rest of the factory Thunder code.

Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/ctrlm_utils.cpp
Comment thread src/factory/ctrlmf_audio_control.cpp Outdated
Comment thread src/factory/CMakeLists.txt
Copilot AI review requested due to automatic review settings July 16, 2026 03:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Comment thread src/thunder/plugins/ctrlm_thunder_plugin_display_settings.cpp
Comment thread src/factory/thunder/ctrlmf_thunder_plugin_display_settings.cpp
Comment thread src/factory/ctrlmf_audio_control.cpp
Comment thread src/factory/ctrlmf_audio_control.cpp
Comment thread src/factory/ctrlmf_audio_control.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp
Comment thread src/ctrlm_utils.cpp

@dwolaver dwolaver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly investigate and resolve all copilot comments.
The build must complete successfully when THUNDER is disabled.
Re-submit for code review after all the changes are completed. Thanks!

Comment thread src/ctrlm_utils.cpp
if(vol < 0 || vol > 1) {
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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line. This doesn't add any value.

Comment thread src/ctrlm_utils.cpp

bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) {
if(vol < 0 || vol > 1) {
XLOGD_INFO("[CTRLM_DUCK_AUDIO] Function called: enable=%d, relative=%d, vol=%f", enable, relative, vol);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all the extra log lines that were added in this function. They look like unnecessary debug logs that don't belong in the final implementation.

Comment thread src/ctrlm_utils.cpp
return ret;
}

bool ctrlm_dsmgr_duck_audio(bool enable, bool relative, double vol) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this function will not compile when thunder is disabled. The build must complete successfully when thunder is disabled.


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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part adds no value "[THUNDER_DS_DUCKING] Function called: ". Please remove it.

Each log line includes the function name automatically.

A function should only print one log line (at most) under normal circumstances. It can print two lines when there is an error/warning. The rest of the logs need to be removed or set to DEBUG level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants