Skip to content

RDKEMW-14903: MFV Device Support in Control Manager - #244

Open
msmith113 wants to merge 95 commits into
developfrom
feature/RDKEMW-14903
Open

RDKEMW-14903: MFV Device Support in Control Manager#244
msmith113 wants to merge 95 commits into
developfrom
feature/RDKEMW-14903

Conversation

@msmith113

@msmith113 msmith113 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@msmith113
msmith113 force-pushed the feature/RDKEMW-14903 branch from 02c91ba to 7dbebb5 Compare June 23, 2026 15:27
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## WARNING: A Blackduck scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: ok

  • Commit: c469913
    '

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 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread src/ble/hal/blercu/bluez/blegattcharacteristic.cpp Outdated

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 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread src/ble/hal/blercu/bleservices/gatt/gatt_audioservice_rdk.cpp

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 1 comment.

Comment thread src/ble/hal/blercu/bleservices/gatt/gatt_audioservice_rdk.cpp

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 2 comments.

Comment thread src/ble/ctrlm_ble_network.cpp
Comment thread src/ble/hal/blercu/bleservices/gatt/gatt_audioservice_rdk.cpp

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 2 comments.

Comment thread src/ble/hal/blercu/bleservices/gatt/gatt_audioservice_rdk.cpp
Comment thread src/ble/hal/blercu/bleservices/gatt/gatt_audioservice_rdk.cpp
msmith113 and others added 3 commits July 17, 2026 13:15
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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 2 comments.

Comment on lines +2117 to +2119
ctrlm_voice_iarm_call_voice_session_t v_params;
v_params.ieee_address = dqm->rcu_data.ieee_address;

Comment on lines +550 to 551
ctrlm_voice_device_t device = dqm->voice_device;
ctrlm_voice_session_response_status_t voice_status;

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 20 out of 20 changed files in this pull request and generated 6 comments.

Comment thread src/ble/ctrlm_ble_controller.cpp Outdated
Comment on lines +489 to +491
bool ctrlm_obj_controller_ble_t::get_mid_field_voice_capable() const {
return true;
}
Comment on lines +547 to +549
// BLE RCUs use PTT for keypress-triggered sessions and FF for MFV wake-word sessions.
// The voice_device field of the message is set by the caller; it defaults to
// CTRLM_VOICE_DEVICE_PTT (0) when the struct is zeroed via memset.
Comment thread src/ble/ctrlm_ble_network.cpp Outdated
Comment on lines +2081 to +2082
//schedule_status_print();
//schedule_status_event();
Comment on lines +2087 to +2088
//schedule_status_print();
//schedule_status_event();
Comment thread src/ctrlm_controller.cpp Outdated
Comment on lines +335 to +337
void ctrlm_obj_controller_t::set_mid_field_voice_capable(bool capable) {
XLOGD_WARN("not implemented.");
}

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 20 out of 20 changed files in this pull request and generated 4 comments.

Comment thread src/ble/ctrlm_ble_controller.cpp Outdated
Comment on lines +489 to +491
bool ctrlm_obj_controller_ble_t::get_mid_field_voice_capable() const {
return true;
}
Comment thread src/ble/ctrlm_ble_network.cpp Outdated
Comment on lines +2117 to +2118
ctrlm_voice_iarm_call_voice_session_t v_params;
v_params.ieee_address = dqm->rcu_data.ieee_address;
Comment on lines +547 to +550
// BLE RCUs use PTT for keypress-triggered sessions and FF for MFV wake-word sessions.
// The voice_device field of the message is set by the caller; it defaults to
// CTRLM_VOICE_DEVICE_PTT (0) when the struct is zeroed via memset.
ctrlm_voice_device_t device = dqm->voice_device;

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 20 out of 20 changed files in this pull request and generated 5 comments.

Comment thread src/ble/ctrlm_ble_controller.cpp Outdated
Comment on lines +489 to +491
bool ctrlm_obj_controller_ble_t::get_mid_field_voice_capable() const {
return true;
}
Comment on lines +2117 to +2118
ctrlm_voice_iarm_call_voice_session_t v_params;
v_params.ieee_address = dqm->rcu_data.ieee_address;
Comment thread src/ble/ctrlm_ble_network.cpp
Comment on lines 2079 to +2082
controller->setWakeupConfig(dqm->rcu_data.wakeup_config);
XLOGD_INFO("Controller <%s> notified wakeup config = <%s>", controller->ieee_address_get().to_string().c_str(), ctrlm_rcu_wakeup_config_str(controller->get_wakeup_config()));
schedule_status_print();
schedule_status_event();
//schedule_status_print();
//schedule_status_event();
Comment on lines 2085 to +2088
controller->setWakeupCustomList(dqm->rcu_data.wakeup_custom_list, dqm->rcu_data.wakeup_custom_list_size);
XLOGD_INFO("Controller <%s> notified wakeup custom list = <%s>", controller->ieee_address_get().to_string().c_str(), controller->wakeupCustomListToString().c_str());
schedule_status_print();
schedule_status_event();
//schedule_status_print();
//schedule_status_event();

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 20 out of 20 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

src/ble/ctrlm_ble_controller.cpp:491

  • get_mid_field_voice_capable() always returns true, ignoring the mid_field_voice_capable_ state set by set_mid_field_voice_capable(). This makes the capability flag meaningless and will misreport MFV support.
bool ctrlm_obj_controller_ble_t::get_mid_field_voice_capable() const {
   return true;
}

src/ble/ctrlm_ble_network.cpp:550

  • The comment says MFV wake-word sessions use FF, but the code (and the rest of this PR) uses CTRLM_VOICE_DEVICE_MFV. This mismatch is confusing when debugging session source selection.
         // BLE RCUs use PTT for keypress-triggered sessions and FF for MFV wake-word sessions.
         // The voice_device field of the message is set by the caller; it defaults to
         // CTRLM_VOICE_DEVICE_PTT (0) when the struct is zeroed via memset.
         ctrlm_voice_device_t device = dqm->voice_device;

src/ble/ctrlm_ble_network.cpp:2088

  • These schedule_status_* calls were commented out rather than being removed or controlled via a flag, leaving dead/commented code in the event handler. If wakeup config/custom list changes should no longer trigger status print/event, consider deleting these lines and adding a short rationale (or gate via a config/verbosity knob). If they should still trigger, uncomment them.
                  controller->setWakeupConfig(dqm->rcu_data.wakeup_config);
                  XLOGD_INFO("Controller <%s> notified wakeup config = <%s>", controller->ieee_address_get().to_string().c_str(), ctrlm_rcu_wakeup_config_str(controller->get_wakeup_config()));
                  //schedule_status_print();
                  //schedule_status_event();
                  break;
               case CTRLM_HAL_BLE_PROPERTY_WAKEUP_CUSTOM_LIST:
                  controller->setWakeupCustomList(dqm->rcu_data.wakeup_custom_list, dqm->rcu_data.wakeup_custom_list_size);
                  XLOGD_INFO("Controller <%s> notified wakeup custom list = <%s>", controller->ieee_address_get().to_string().c_str(), controller->wakeupCustomListToString().c_str());
                  //schedule_status_print();
                  //schedule_status_event();

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 19 out of 19 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (3)

src/ble/ctrlm_ble_network.cpp:2124

  • The wakeup-config status update no longer schedules the status print/event because these calls were commented out. This looks like an accidental regression (UI/telemetry won’t reflect updated wakeup config).
                  //schedule_status_print();
                  //schedule_status_event();

src/ble/ctrlm_ble_network.cpp:2130

  • The wakeup-custom-list status update no longer schedules the status print/event because these calls were commented out. This looks like an accidental regression (UI/telemetry won’t reflect updated wakeup custom list).
                  //schedule_status_print();
                  //schedule_status_event();

src/ble/ctrlm_ble_network.cpp:557

  • The comment says MFV wake-word sessions use FF, but the code now uses the dedicated CTRLM_VOICE_DEVICE_MFV device type. This mismatch makes it harder to reason about routing behavior for BLE voice sessions.
         // BLE RCUs use PTT for keypress-triggered sessions and FF for MFV wake-word sessions.
         // The voice_device field of the message is set by the caller; it defaults to
         // CTRLM_VOICE_DEVICE_PTT (0) when the struct is zeroed via memset.

Comment on lines +169 to +176
// TEMPORARY: hardcode all voice server URLs used by ctrlm, overriding any configured/RFC/settings values.
// ctrlm selects the protocol handler by scheme prefix: "vrngs" -> secure ws_nextgen (vrex), translated
// internally to "wss". A raw "wss" prefix is not recognized and is rejected as "unsupported url".
static const char *CTRLM_VOICE_HARDCODED_URL = "vrngs://eng.voice.xvp.eu-1.xcal.tv/vrex/speech/websocket?stbSwVersion=QSE041.004.00U";
this->prefs.server_url_src_ptt = CTRLM_VOICE_HARDCODED_URL;
this->prefs.server_url_src_ff = CTRLM_VOICE_HARDCODED_URL;
this->prefs.server_url_src_mic_tap = CTRLM_VOICE_HARDCODED_URL;

Comment on lines +2176 to +2178
g_ctrlm_ble_network.mfv_detection_pending_ieee = dqm->rcu_data.ieee_address;
ctrlm_timeout_destroy(&g_ctrlm_ble_network.mfv_detection_timer_tag);
g_ctrlm_ble_network.mfv_detection_timer_tag = ctrlm_timeout_create(CTRLM_BLE_MFV_DETECTION_DATA_TIMEOUT, ctrlm_ble_mfv_detection_timer_cb, &id_);
Comment on lines +162 to +165
// MFV wake-word (detection-triggered) session state. Such a session starts audio streaming, waits
// for the detection data (wake word timing/confidence), then opens the voice session. See
// ctrlm_obj_network_ble_t::req_process_detection_voice_session_begin().
void setMfvDetectionPending(bool pending, int audio_fd = -1);

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 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (7)

src/ble/ctrlm_ble_network.cpp:652

  • MFV detection timeout tracking uses a single global ieee address (mfv_detection_pending_ieee) and a single global timer tag. If two MFV wake-word sessions become pending close together (different controllers or repeated detections), the global ieee can be overwritten and the timeout handler may release the wrong controller/session (or fail to release the original).
   unsigned long long ieee_address = g_ctrlm_ble_network.mfv_detection_pending_ieee;
   ctrlm_controller_id_t controller_id;

src/ble/ctrlm_ble_network.cpp:2124

  • These calls were previously active and are now commented out, which prevents wakeup-config changes from scheduling the usual status print/event updates.
                  //schedule_status_print();
                  //schedule_status_event();

src/ble/ctrlm_ble_network.cpp:2130

  • These calls were previously active and are now commented out, which prevents wakeup custom-list changes from scheduling the usual status print/event updates.
                  //schedule_status_print();
                  //schedule_status_event();

src/ble/ctrlm_ble_network.cpp:557

  • Comment says MFV wake-word sessions use the FF device type, but the MFV path sets msg.voice_device = CTRLM_VOICE_DEVICE_MFV. This mismatch is misleading when debugging/maintaining the session-begin flow.
         // BLE RCUs use PTT for keypress-triggered sessions and FF for MFV wake-word sessions.
         // The voice_device field of the message is set by the caller; it defaults to
         // CTRLM_VOICE_DEVICE_PTT (0) when the struct is zeroed via memset.

src/ble/ctrlm_ble_controller.h:165

  • This comment references ctrlm_obj_network_ble_t::req_process_detection_voice_session_begin(), but no such method exists (the MFV flow is handled in ind_process_rcu_status() / req_process_voice_session_begin()). The incorrect reference makes it harder to locate the implementation.
   // MFV wake-word (detection-triggered) session state.  Such a session starts audio streaming, waits
   // for the detection data (wake word timing/confidence), then opens the voice session.  See
   // ctrlm_obj_network_ble_t::req_process_detection_voice_session_begin().
   void                             setMfvDetectionPending(bool pending, int audio_fd = -1);

src/voice/ctrlm_voice_obj_generic.cpp:175

  • voice_sdk_update_routes() now unconditionally overrides configured/RFC voice server URLs with a hard-coded QA endpoint. This changes production behavior (routing, environment selection, failover) and makes the effective server destination opaque to configuration management.
    static const char *CTRLM_VOICE_HARDCODED_URL = "vrngs://voice-np-eks-ue2i.vrexcore.net/qa20/vrex/speech";
    this->prefs.server_url_src_ptt     = CTRLM_VOICE_HARDCODED_URL;
    this->prefs.server_url_src_ff      = CTRLM_VOICE_HARDCODED_URL;
    this->prefs.server_url_src_mic_tap = CTRLM_VOICE_HARDCODED_URL;

src/ble/ctrlm_ble_network.cpp:2178

  • The MFV detection handler starts the “detection data timeout” flow regardless of whether the voice session actually started successfully. If req_process_voice_session_begin fails (e.g., cannot acquire session / audio fd), the controller stays marked MFV-detection-pending and a timer is still started, which can later call voice_session_stream_params_update() for a session that never existed.
                     req_process_voice_session_begin(&msg, sizeof(msg));

                     g_ctrlm_ble_network.mfv_detection_pending_ieee = dqm->rcu_data.ieee_address;
                     ctrlm_timeout_destroy(&g_ctrlm_ble_network.mfv_detection_timer_tag);
                     g_ctrlm_ble_network.mfv_detection_timer_tag = ctrlm_timeout_create(CTRLM_BLE_MFV_DETECTION_DATA_TIMEOUT, ctrlm_ble_mfv_detection_timer_cb, &id_);

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