Skip to content

RDKEMW-25259: speechsynthesis firebolt api implementation - #17

Open
kkarup694 wants to merge 8 commits into
developfrom
topic/rdkemw-25259
Open

kkarup694 wants to merge 8 commits into
developfrom
topic/rdkemw-25259

Conversation

@kkarup694

Copy link
Copy Markdown
Contributor

Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Signed-off-by: kumar <kumar_Karuppiahyogarajah@comcast.com>
@kkarup694
kkarup694 requested a review from a team as a code owner October 27, 2026 10:44
Copilot AI balanced review requested due to automatic review settings October 27, 2026 10:44

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

12 open issues
What changed in this PR

Adds a native Firebolt SDK-based implementation for SpeechSynthesis/TTS, enabling a new Firebolt API integration path behind a build flag.

Changes:

  • Introduces TextToSpeechServiceNativeFirebolt and TTSClientPrivateNativeFirebolt implementations for native Firebolt SpeechSynthesis.
  • Extends SpeechData with Firebolt-native speak parameters when USE_NATIVE_FIREBOLT_SDK is enabled.
  • Updates build logic (CMake + includes) to select native vs existing Firebolt implementation and link the appropriate library.
File Description
ttsclient/​TextToSpeechServiceNativeFirebolt.h Declares native Firebolt TTS service API, event handling, and client callback interface.
ttsclient/​TextToSpeechServiceNativeFirebolt.cpp Implements native Firebolt connection lifecycle, subscriptions, and TTS control APIs (speak/pause/resume/cancel).
ttsclient/​TTSClientPrivateNativeFirebolt.h Adds a native Firebolt-backed TTS client private implementation and ID mapping helper.
ttsclient/​TTSClientPrivateNativeFirebolt.cpp Implements session/speech operations and translates Firebolt events to client callbacks.
ttsclient/​TTSClient.h Adds native Firebolt-specific fields to SpeechData behind a compile flag.
ttsclient/​TTSClient.cpp Switches include to native Firebolt client private implementation when configured.
ttsclient/​CMakeLists.txt Adds native Firebolt source selection, compile definition, and links against FireboltClient.

Review effort: Lite

Comment thread ttsclient/TTSClient.h Resolved
Comment on lines +52 to +66
uint32_t getServiceId(uint32_t clientid) {
std::lock_guard<std::mutex> lock(m_mutex);
for(auto it = m_map.begin(); it != m_map.end(); ++it)
if(it->first == clientid)
return it->second;
return 0;
}

uint32_t getClientId(uint32_t serviceid) {
std::lock_guard<std::mutex> lock(m_mutex);
for(auto it = m_map.begin(); it != m_map.end(); ++it)
if(it->second == serviceid)
return it->first;
return 0;
}
Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Signed-off-by: kumar <kumar_Karuppiahyogarajah@comcast.com>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 10: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.

🟡 Changes recommended

Unresolved critical defects break legacy Firebolt builds and risk undefined behavior and callback deadlocks, while unsupported operations incorrectly report success.

19 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Refresh the TTS-enabled cache without a callback

ttsclient/​TTSClientPrivateNativeFirebolt.cpp:202

A client created with a null connection callback does not refresh m_ttsEnabled when creating a session. Until a separate state query or change event occurs, speak() rejects requests as disabled even if voice guidance is enabled. Refresh the cache regardless of whether there is a callback to notify.

Medium severity Forward synthesis failures as terminal speech errors

ttsclient/​TextToSpeechServiceNativeFirebolt.cpp:269

A synthesis failure is discarded instead of being forwarded as a terminal speech error. The private client only removes speech-ID mappings and notifies the application in terminal-event handlers, so a failed synthesis leaves its request tracked and the application receives no completion or error notification. Translate this event to an appropriate terminal error callback, adding a synthesis-error path if needed.

Review effort: Balanced

Comment thread ttsclient/TTSClient.h Resolved
Comment thread ttsclient/TTSClientPrivateInterface.h Resolved
Comment on lines +98 to +101
std::lock_guard<std::mutex> lock(mtx);
isConnected = connected;
}
cv.notify_one();
Comment thread ttsclient/TTSClientPrivateCOMRPC.h Resolved
Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Signed-off-by: kumar <kumar_Karuppiahyogarajah@comcast.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 07:02

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.

🟡 Changes recommended

Unresolved defects break a supported Firebolt build, risk deadlocks and undefined behavior, expose utterance text in logs, and report API success without valid results.

19 open issues
3 previously missed issues

In code that hasn't changed since last review

Medium severity Populate structured voice lists on JSONRPC

ttsclient/​TTSClientPrivateJsonRPC.h:113

The new public structured-voice API forwards directly to this method, but it returns TTS_OK without retrieving voices or updating the caller's vector. On JSONRPC, callers therefore see an apparently successful empty or stale voice list even though the existing overload can enumerate voices. Implement the conversion, or report TTS_FAIL while this overload is unsupported.

Medium severity Query enabled state even without a connection callback

ttsclient/​TTSClientPrivateNativeFirebolt.cpp:201

With a null connection callback, createSession skips the initial enabled-state query. m_ttsEnabled therefore remains false, and speak() rejects requests with TTS_NOT_ENABLED even when voice guidance is enabled, until a state-change notification arrives or the caller explicitly queries the setting. Fetch the state independently of whether a notification callback is registered.

Medium severity Notify clients when synthesis fails

ttsclient/​TextToSpeechServiceNativeFirebolt.cpp:269

synthesisFailed is a terminal utterance failure, but this branch drops it without notifying the client. The request consequently remains in m_requestedSpeeches, whose entries are removed by terminal callbacks, and the application never receives a completion/error for that speech. Translate this event to an appropriate existing terminal-error callback or add a synthesis-error callback that also removes the request mapping.

1 resolved since last review

Review effort: Balanced

Comment thread common/logger.cpp Resolved
Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Signed-off-by: kumar <kumar_Karuppiahyogarajah@comcast.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 06:35

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.

🟡 Changes recommended

Unresolved build failures, undefined behavior in logging, and callback deadlock risks prevent supported configurations from compiling or operating safely.

21 open issues

And 1 more that still need to be addressed.

Review effort: Balanced

Comment thread ttsclient/TTSClient.h Resolved
Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Signed-off-by: kumar <kumar_Karuppiahyogarajah@comcast.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:52

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.

🔵 Needs a closer look

Unresolved critical defects break the legacy Firebolt build, introduce undefined behavior in logging, and allow application callbacks to deadlock the event thread.

19 open issues
1 resolved since last review

Review effort: Balanced

Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Signed-off-by: kumar <kumar_Karuppiahyogarajah@comcast.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 10:42

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.

🟡 Changes recommended

The change breaks the legacy Firebolt build and introduces critical runtime defects, including undefined behavior in logging, callback deadlocks, and inconsistent connection state.

20 open issues

Review effort: Balanced

… formatting function'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 07:06

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.

🔵 Needs a closer look

Unresolved critical defects break the legacy Firebolt build and can cause native speech crashes or callback deadlocks.

17 open issues
2 resolved since last review

Review effort: Balanced

Reason for change: new tts firebolt api integration
Test Procedure: Mentioned in ticket
Risks: Low
version: minor

Signed-off-by: kumar <kumar_Karuppiahyogarajah@comcast.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 10:24

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.

🟡 Changes recommended

Callback dispatch can dereference freed clients after concurrent unregistration, and voice-change notifications bypass the new vector overload, dropping voices and metadata.

4 open issues
15 resolved since last review

Review effort: Balanced

Comment on lines +255 to +259
ClientList currentClients;
{
std::lock_guard<std::mutex> lock(m_mutex);
currentClients = m_clients;
}
void TTSClientPrivateFirebolt::onVoiceChange(std::pmr::vector<Firebolt::SpeechSynthesis::Voice> newVoices) {
if(m_connectionCallback) {
TTSLOG_INFO("Got voice_changed event from TTS Manager %p, new voice count = %zu", this, newVoices.size());
m_connectionCallback->onVoiceChanged(newVoices[0].name); /* currently sending only the first voice */
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.

3 participants