From 7dfcd39211c2045978d5c0c217cde995bd0cebaa Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 13:21:45 +0000 Subject: [PATCH 01/39] RDKEMW-18082: ctrlm coverity cleanup --- ci/build_dependencies.sh | 7 +---- ci/cov_build.sh | 2 -- ci/mocks/devicesettings_ctrlm.patch | 40 ------------------------ ci/mocks/testframework_overrides.h | 48 ----------------------------- 4 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 ci/mocks/devicesettings_ctrlm.patch delete mode 100644 ci/mocks/testframework_overrides.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 9abff1c9..27bac62d 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -53,12 +53,7 @@ python3 -m pip install jsonref XRSDK_REF="1.0.13" git clone --depth 1 --filter=blob:none --branch "${XRSDK_REF}" https://github.com/rdkcentral/xr-voice-sdk.git -git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/entservices-testframework.git - -# Patch the upstream testframework devicesettings.h with ctrlm-specific -# additions (ducking types, setAudioDucking, Manager::IsInitialized). -# We can remove this if added to upstream testframework -git -C entservices-testframework apply "$GITHUB_WORKSPACE/ci/mocks/devicesettings_ctrlm.patch" +git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git git -C iarmmgrs sparse-checkout set hal diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 3a51b921..a8ae6f79 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -30,7 +30,6 @@ echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" XLOG_COMPAT="$GITHUB_WORKSPACE/ci/mocks/xlog_ci_compat.h" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" -MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" GLIB_CFLAGS="$(pkg-config --cflags glib-2.0)" @@ -79,7 +78,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ ${GLIB_CFLAGS} \ -include ${XLOG_COMPAT} \ -include ${MOCK_DIR}/Iarm.h \ --include ${MOCK_OVERRIDES} \ -include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ -Wall -Wno-error \ diff --git a/ci/mocks/devicesettings_ctrlm.patch b/ci/mocks/devicesettings_ctrlm.patch deleted file mode 100644 index d2faf8a8..00000000 --- a/ci/mocks/devicesettings_ctrlm.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/Tests/mocks/devicesettings.h 2026-04-21 19:12:58.154981897 +0000 -+++ b/Tests/mocks/devicesettings.h 2026-04-21 19:13:50.591192520 +0000 -@@ -72,6 +72,16 @@ - dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ - } dsAudioPortType_t; - -+typedef enum _dsAudioDuckingAction_t { -+ dsAUDIO_DUCKINGACTION_START = 0, -+ dsAUDIO_DUCKINGACTION_STOP = 1 -+} dsAudioDuckingAction_t; -+ -+typedef enum _dsAudioDuckingType_t { -+ dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0, -+ dsAUDIO_DUCKINGTYPE_RELATIVE = 1 -+} dsAudioDuckingType_t; -+ - typedef enum _dsVideoPortType_t { - dsVIDEOPORT_TYPE_RF = 0, ///< RF modulator (channel 3/4) video output - dsVIDEOPORT_TYPE_BB, ///< Baseband (composite, RCA) video output -@@ -934,6 +944,11 @@ - void enableARC(dsAudioARCTypes_t type, bool enable); - uint32_t getDolbyVolumeMode() const; - void setStereoMode(const std::string &mode, bool persist); -+ void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) { -+ (void)action; -+ (void)type; -+ (void)level; -+ } - - - -@@ -1420,6 +1435,8 @@ - static ManagerImpl* impl; - - public: -+ static bool IsInitialized; -+ - Manager(); - - static void setImpl(ManagerImpl* newImpl); diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h deleted file mode 100644 index 22b8a0a2..00000000 --- a/ci/mocks/testframework_overrides.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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. - */ -/* - * CI patch layer for gaps in the entservices-testframework mock headers. - * - * ctrlm needs a few IARM declarations that are missing from the testframework - * headers used by this reduced build. This file adds only those missing pieces - * and can be removed once they exist upstream. - */ -#ifndef CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ -#define CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ - -/* Pinned testframework Iarm.h stops at UNKNOWN; ctrlm also references MAX. */ -#ifndef DEEPSLEEP_WAKEUPREASON_MAX -#define DEEPSLEEP_WAKEUPREASON_MAX (DEEPSLEEP_WAKEUPREASON_UNKNOWN + 1) -#endif - -/* IARM common API string not present in the pinned testframework mock */ -#ifndef IARM_BUS_COMMON_API_PowerPreChange -#define IARM_BUS_COMMON_API_PowerPreChange "PowerPreChange" -#endif - -/* Struct not present in the pinned testframework mock */ -#ifndef CTRLM_IARM_BUS_COMMON_API_POWERPRECHANGE_PARAM_T_DEFINED -#define CTRLM_IARM_BUS_COMMON_API_POWERPRECHANGE_PARAM_T_DEFINED -typedef struct { - IARM_Bus_PWRMgr_PowerState_t newState; - IARM_Bus_PWRMgr_PowerState_t curState; -} IARM_Bus_CommonAPI_PowerPreChange_Param_t; -#endif - -#endif /* CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ */ From d662739a063f1b677ab591986a823eb070e3adf8 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 13:29:53 +0000 Subject: [PATCH 02/39] Testing removing xlog_ci_compat.h Co-authored-by: Copilot --- ci/cov_build.sh | 2 -- ci/mocks/xlog_ci_compat.h | 42 --------------------------------------- src/ctrlm_utils.cpp | 5 +++++ 3 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 ci/mocks/xlog_ci_compat.h diff --git a/ci/cov_build.sh b/ci/cov_build.sh index a8ae6f79..e3181ddc 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -28,7 +28,6 @@ ls -la "${GITHUB_WORKSPACE}" echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" -XLOG_COMPAT="$GITHUB_WORKSPACE/ci/mocks/xlog_ci_compat.h" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" @@ -76,7 +75,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I ${GITHUB_WORKSPACE}/install/usr/include \ -I /usr/include/libdrm \ ${GLIB_CFLAGS} \ --include ${XLOG_COMPAT} \ -include ${MOCK_DIR}/Iarm.h \ -include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ diff --git a/ci/mocks/xlog_ci_compat.h b/ci/mocks/xlog_ci_compat.h deleted file mode 100644 index 43836b73..00000000 --- a/ci/mocks/xlog_ci_compat.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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. - */ - -/* - * CI compatibility shim. - * - * The production rdkx_logger.h is included transitively everywhere via - * ctrlm_log.h. In the Yocto build the SDK headers pull several std:: names - * into the global namespace. A handful of ctrlm TUs (e.g. ctrlm_utils.cpp) - * rely on those names being globally visible. This tiny header replicates - * that behaviour for the CI native build. - */ -#ifndef CTRLM_CI_XLOG_COMPAT_H_ -#define CTRLM_CI_XLOG_COMPAT_H_ - -#ifdef __cplusplus -#include -#include -#include -using std::get; -using std::map; -using std::string; -using std::tuple; -#endif - -#endif /* CTRLM_CI_XLOG_COMPAT_H_ */ diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index b77595ac..e28bfb1d 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -47,6 +47,11 @@ #include // end dsMgr includes +using std::get; +using std::map; +using std::string; +using std::tuple; + #define BLOCK_SIZE (1024 * 4 * 10) /* bytes */ #define MAX_RECURSE_DEPTH 20 From e1b5beb59da0de8c17fa7fb90cf1e7c91af36005 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 13:40:22 +0000 Subject: [PATCH 03/39] Calling cmake on xr-voice-sdk for headers Co-authored-by: Copilot --- ci/build_dependencies.sh | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 27bac62d..bf8a9240 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -44,13 +44,15 @@ apt install -y \ libevdev-dev \ libdrm-dev \ libsafec-dev \ + libbsd-dev \ + gperf \ python3-pip python3 -m pip install jsonref ########################################### # 2. Clone the required repositories -XRSDK_REF="1.0.13" +XRSDK_REF="feature/RDKEMW-18082" git clone --depth 1 --filter=blob:none --branch "${XRSDK_REF}" https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git @@ -78,30 +80,24 @@ echo "========================================================================== echo "Creating stub headers" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" -XRSDK_HEADERS_DIR="$HEADERS_DIR/xr-voice-sdk" mkdir -p "${HEADERS_DIR}" mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" -mkdir -p "${XRSDK_HEADERS_DIR}" - -# Copy real xr-voice-sdk headers. -# xr_fdc.h is NOT copied: only needed when FDC_ENABLED=ON -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-router/xrsr.h" "${XRSDK_HEADERS_DIR}/" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-mq/xr_mq.h" "${XRSDK_HEADERS_DIR}/" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_http/xrsv_http.h" "${XRSDK_HEADERS_DIR}/" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_ws_nextgen/xrsv_ws_nextgen.h" "${XRSDK_HEADERS_DIR}/" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-timestamp/xr_timestamp.h" "${XRSDK_HEADERS_DIR}/" - -# Generate rdkx_logger_modules.h from xr-voice-sdk's module configuration, -# then copy the real rdkx_logger and xr_voice_sdk headers. -# This replaces the hand-written ci/mocks/control/ stubs. -python3 "$GITHUB_WORKSPACE/xr-voice-sdk/scripts/rdkx_logger_modules_to_c.py" \ - "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-logger/rdkv/rdkx_logger_modules.json" \ - "${XRSDK_HEADERS_DIR}/rdkx_logger_modules" "mw" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-logger/rdkx_logger_mw.h" "${XRSDK_HEADERS_DIR}/rdkx_logger.h" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr_voice_sdk.h" "${XRSDK_HEADERS_DIR}/xr_voice_sdk.h" + +# Build xr-voice-sdk with cmake and install its headers. +# This uses the COMPONENT headers install target added to xr-voice-sdk/src/CMakeLists.txt, +# which covers all headers including the generated rdkx_logger.h and rdkx_logger_modules.h. +# CMAKE_INSTALL_INCLUDEDIR=xr-voice-sdk places headers under ${HEADERS_DIR}/xr-voice-sdk/. +cmake -G Ninja \ + -S "$GITHUB_WORKSPACE/xr-voice-sdk" \ + -B "$GITHUB_WORKSPACE/build/xr-voice-sdk" \ + -DCMAKE_INSTALL_PREFIX="${HEADERS_DIR}" \ + -DCMAKE_INSTALL_INCLUDEDIR="xr-voice-sdk" \ + -DSTAGING_BINDIR_NATIVE="/usr/bin" \ + -DCMAKE_PROJECT_VERSION="1.0.13" +cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" +cmake --install "$GITHUB_WORKSPACE/build/xr-voice-sdk" --component headers cd "${HEADERS_DIR}" @@ -188,10 +184,14 @@ STUB_EOF # Build stub .so for each missing library # nopoll and dshalcli are unused (factory-only) but unconditionally linked by CMakeLists.txt # We can remove them from the link list in the future if desired, but for now just provide stubs to satisfy the linker. -for lib in xr-voice-sdk rdkversion IARMBus ds nopoll dshalcli rfcapi secure_wrapper evdev; do +# xr-voice-sdk is not stubbed here: the real .so is produced by the cmake build above. +for lib in rdkversion IARMBus ds nopoll dshalcli rfcapi secure_wrapper evdev; do gcc -shared -fPIC -o "${STUB_LIB_DIR}/lib${lib}.so" /tmp/stub.c done +# Copy the real xr-voice-sdk .so built by cmake into the stub lib dir. +cp "$GITHUB_WORKSPACE/build/xr-voice-sdk/src/libxr-voice-sdk.so" "${STUB_LIB_DIR}/libxr-voice-sdk.so" + rm /tmp/stub.c echo "Stub libraries created in ${STUB_LIB_DIR}" From 950a494ef070d9f1001cec663f3b8cfb3e4644b5 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 14:12:00 +0000 Subject: [PATCH 04/39] Test Co-authored-by: Copilot --- ci/build_dependencies.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index bf8a9240..5e2a9717 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -85,6 +85,10 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" +# safec compatibility header - committed in ci/mocks. xr-voice-sdk includes +# safec_lib.h during its own build, so make it available before invoking cmake. +cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" "$HEADERS_DIR/safec_lib.h" + # Build xr-voice-sdk with cmake and install its headers. # This uses the COMPONENT headers install target added to xr-voice-sdk/src/CMakeLists.txt, # which covers all headers including the generated rdkx_logger.h and rdkx_logger_modules.h. @@ -94,6 +98,7 @@ cmake -G Ninja \ -B "$GITHUB_WORKSPACE/build/xr-voice-sdk" \ -DCMAKE_INSTALL_PREFIX="${HEADERS_DIR}" \ -DCMAKE_INSTALL_INCLUDEDIR="xr-voice-sdk" \ + -DCMAKE_C_FLAGS="-I${HEADERS_DIR}" \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ -DCMAKE_PROJECT_VERSION="1.0.13" cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" @@ -157,10 +162,6 @@ cp "$RDKVERSION_DIR/src/rdkversion.h" rdkversion.h # secure_wrapper (types provided via empty stub — no v_secure_* calls in core) touch secure_wrapper.h -# safec compatibility header - committed in ci/mocks, copied here so it is -# resolved on the generated-headers include path. -cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" safec_lib.h - echo "Stub headers created successfully" cd "${GITHUB_WORKSPACE}" From 68debec79c75abfa94b256a94112c35258a35dcc Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 14:25:07 +0000 Subject: [PATCH 05/39] Fixing xr-voice-sdk cmake run Co-authored-by: Copilot --- ci/build_dependencies.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 5e2a9717..0976a005 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -101,6 +101,12 @@ cmake -G Ninja \ -DCMAKE_C_FLAGS="-I${HEADERS_DIR}" \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ -DCMAKE_PROJECT_VERSION="1.0.13" + +# xr-voice-sdk unconditionally appends -Werror via target_compile_options. +# Strip it from generated build files for this reduced CI build, matching the +# control build workaround below. +find "$GITHUB_WORKSPACE/build/xr-voice-sdk" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; + cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" cmake --install "$GITHUB_WORKSPACE/build/xr-voice-sdk" --component headers From de998e79399a5785e68006f92ec576958bee88c3 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 14:28:24 +0000 Subject: [PATCH 06/39] Another fix Co-authored-by: Copilot --- ci/build_dependencies.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 0976a005..8fd8e15e 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -89,6 +89,10 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" # safec_lib.h during its own build, so make it available before invoking cmake. cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" "$HEADERS_DIR/safec_lib.h" +# rdkversion.h is included by xr-voice-sdk during its own build, so stage it +# before invoking cmake. +cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" + # Build xr-voice-sdk with cmake and install its headers. # This uses the COMPONENT headers install target added to xr-voice-sdk/src/CMakeLists.txt, # which covers all headers including the generated rdkx_logger.h and rdkx_logger_modules.h. @@ -161,8 +165,7 @@ touch rfcapi.h find "$IARMMGRS_DIR" -name comcastIrKeyCodes.h -print -quit | xargs -r -I{} cp "{}" comcastIrKeyCodes.h [ -f comcastIrKeyCodes.h ] -# rdkversion.h (used by ctrlm_main.cpp) -cp "$RDKVERSION_DIR/src/rdkversion.h" rdkversion.h +# rdkversion.h (used by ctrlm_main.cpp and xr-voice-sdk) [ -f rdkversion.h ] # secure_wrapper (types provided via empty stub — no v_secure_* calls in core) From 33b07b6254b17dd169038328cc98ce98e8040c84 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 14:49:34 +0000 Subject: [PATCH 07/39] Addressing copilot comment about missing includes --- src/ctrlm_utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ctrlm_utils.cpp b/src/ctrlm_utils.cpp index e28bfb1d..40f355ed 100644 --- a/src/ctrlm_utils.cpp +++ b/src/ctrlm_utils.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "ctrlm.h" #include "ctrlm_utils.h" #include From 755f6619308eb13577c1096d5044ddc8763b805b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2026 15:51:50 +0000 Subject: [PATCH 08/39] Removing unused var --- src/voice/ctrlm_voice_obj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index a6787b1e..54f4ad42 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -2921,11 +2921,11 @@ void ctrlm_voice_t::voice_stream_end_callback(ctrlm_voice_stream_end_cb_t *strea if(session->packets_processed > 0) { uint32_t stream_duration = session->packets_processed * 20; // assume 20 ms per packet - uint32_t samples_per_packet = 320; // 16 kHz samples at 20 ms per packet + // uint32_t samples_per_packet = 320; // 16 kHz samples at 20 ms per packet if(session->format.type == CTRLM_VOICE_FORMAT_ADPCM_FRAME) { uint32_t frame_duration_us = (session->format.value.adpcm_frame.size_packet - session->format.value.adpcm_frame.size_header) * 125; // 125 us per byte for ADPCM at 16 kHz stream_duration = (session->packets_processed * frame_duration_us) / 1000; - samples_per_packet = (session->format.value.adpcm_frame.size_packet - session->format.value.adpcm_frame.size_header) * 2; // 2 samples per byte for ADPCM + // samples_per_packet = (session->format.value.adpcm_frame.size_packet - session->format.value.adpcm_frame.size_header) * 2; // 2 samples per byte for ADPCM } XLOGD_AUTOMATION_TELEMETRY("src <%s> Packets Lost/Total <%u/%u> %.02f%% duration <%u> ms", ctrlm_voice_device_str(session->voice_device), session->packets_lost, session->packets_lost + session->packets_processed, 100.0 * ((double)session->packets_lost / (double)(session->packets_lost + session->packets_processed)), stream_duration); #ifdef TELEMETRY_SUPPORT From f28a94dad9eda706f3844b6035129933c004332a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 7 May 2026 13:35:15 +0000 Subject: [PATCH 09/39] Update --- ci/build_dependencies.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 8fd8e15e..79788df3 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -194,12 +194,11 @@ STUB_EOF # Build stub .so for each missing library # nopoll and dshalcli are unused (factory-only) but unconditionally linked by CMakeLists.txt # We can remove them from the link list in the future if desired, but for now just provide stubs to satisfy the linker. -# xr-voice-sdk is not stubbed here: the real .so is produced by the cmake build above. for lib in rdkversion IARMBus ds nopoll dshalcli rfcapi secure_wrapper evdev; do gcc -shared -fPIC -o "${STUB_LIB_DIR}/lib${lib}.so" /tmp/stub.c done -# Copy the real xr-voice-sdk .so built by cmake into the stub lib dir. +# Copy the real xr-voice-sdk .so built by cmake into the lib dir alongside the stubs. cp "$GITHUB_WORKSPACE/build/xr-voice-sdk/src/libxr-voice-sdk.so" "${STUB_LIB_DIR}/libxr-voice-sdk.so" rm /tmp/stub.c From 03c2ff8f2c3461a8555b7d9a25606064da15b191 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 7 May 2026 14:09:40 +0000 Subject: [PATCH 10/39] Removing sefec mock --- ci/build_dependencies.sh | 15 +++++++++----- ci/mocks/safec_lib.h | 44 ---------------------------------------- 2 files changed, 10 insertions(+), 49 deletions(-) delete mode 100644 ci/mocks/safec_lib.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 79788df3..ea8974ae 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -43,7 +43,6 @@ apt install -y \ uuid-dev \ libevdev-dev \ libdrm-dev \ - libsafec-dev \ libbsd-dev \ gperf \ python3-pip @@ -69,10 +68,14 @@ git -C rdk-halif-power_manager sparse-checkout set include git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/rdkversion.git git -C rdkversion sparse-checkout set src +git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/meta-rdk-oss-reference.git +git -C meta-rdk-oss-reference sparse-checkout set recipes-common/safec-common-wrapper/files + IARMMGRS_DIR="$GITHUB_WORKSPACE/iarmmgrs" DEEPSLEEP_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-deepsleep_manager" POWER_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-power_manager" RDKVERSION_DIR="$GITHUB_WORKSPACE/rdkversion" +SAFEC_WRAPPER_DIR="$GITHUB_WORKSPACE/meta-rdk-oss-reference/recipes-common/safec-common-wrapper/files" ############################ # 3. Create stub/empty headers for external dependencies @@ -85,9 +88,11 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" -# safec compatibility header - committed in ci/mocks. xr-voice-sdk includes -# safec_lib.h during its own build, so make it available before invoking cmake. -cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" "$HEADERS_DIR/safec_lib.h" +# safec_lib.h from meta-rdk-oss-reference/safec-common-wrapper — the same header +# the Yocto build installs into the sysroot. Both ctrlm and xr-voice-sdk include +# it directly. We build without real safec (SAFEC_DUMMY_API), so the header's +# inline stubs handle everything and libsafec-dev is not needed. +cp "$SAFEC_WRAPPER_DIR/safec_lib.h" "$HEADERS_DIR/safec_lib.h" # rdkversion.h is included by xr-voice-sdk during its own build, so stage it # before invoking cmake. @@ -102,7 +107,7 @@ cmake -G Ninja \ -B "$GITHUB_WORKSPACE/build/xr-voice-sdk" \ -DCMAKE_INSTALL_PREFIX="${HEADERS_DIR}" \ -DCMAKE_INSTALL_INCLUDEDIR="xr-voice-sdk" \ - -DCMAKE_C_FLAGS="-I${HEADERS_DIR}" \ + -DCMAKE_C_FLAGS="-I${HEADERS_DIR} -DSAFEC_DUMMY_API" \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ -DCMAKE_PROJECT_VERSION="1.0.13" diff --git a/ci/mocks/safec_lib.h b/ci/mocks/safec_lib.h deleted file mode 100644 index 37d75748..00000000 --- a/ci/mocks/safec_lib.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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. - */ - -/* - * Compatibility header: maps ctrlm's local include name to the real libsafec - * package headers (libsafec-dev / safec-common-wrapper in production). - * - * In CI this file is copied from ci/mocks/ into ci/headers/ by - * build_dependencies.sh so it is resolved on the generated-headers include - * path used by cov_build.sh. - * - * This exists because ctrlm includes safec_lib.h directly, while the native CI - * environment provides the underlying libsafec package headers instead of that - * project-local wrapper. - */ - -#ifndef CTRLM_CI_SAFEC_LIB_H_ -#define CTRLM_CI_SAFEC_LIB_H_ - -#include -#include -#include - -#ifndef ERR_CHK -#define ERR_CHK(rc) do { (void)(rc); } while(0) -#endif - -#endif /* CTRLM_CI_SAFEC_LIB_H_ */ From bce2fb37281eb89475da4f5a85272c9a2f6b7c9b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 7 May 2026 14:30:24 +0000 Subject: [PATCH 11/39] Fix --- ci/build_dependencies.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index ea8974ae..c27183dd 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -92,7 +92,11 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" # the Yocto build installs into the sysroot. Both ctrlm and xr-voice-sdk include # it directly. We build without real safec (SAFEC_DUMMY_API), so the header's # inline stubs handle everything and libsafec-dev is not needed. +# The upstream file lacks include guards, so add them to prevent redefinition +# errors when a translation unit includes safec_lib.h more than once. cp "$SAFEC_WRAPPER_DIR/safec_lib.h" "$HEADERS_DIR/safec_lib.h" +sed -i '1s/^/#ifndef CTRLM_CI_SAFEC_LIB_H\n#define CTRLM_CI_SAFEC_LIB_H\n/' "$HEADERS_DIR/safec_lib.h" +printf '\n#endif /* CTRLM_CI_SAFEC_LIB_H */\n' >> "$HEADERS_DIR/safec_lib.h" # rdkversion.h is included by xr-voice-sdk during its own build, so stage it # before invoking cmake. From eca9dde71c814377aa326c63b12900c698b75133 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 7 May 2026 15:00:08 +0000 Subject: [PATCH 12/39] Updates --- ci/build_dependencies.sh | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index c27183dd..b641e9d0 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -88,24 +88,16 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" -# safec_lib.h from meta-rdk-oss-reference/safec-common-wrapper — the same header -# the Yocto build installs into the sysroot. Both ctrlm and xr-voice-sdk include -# it directly. We build without real safec (SAFEC_DUMMY_API), so the header's -# inline stubs handle everything and libsafec-dev is not needed. -# The upstream file lacks include guards, so add them to prevent redefinition -# errors when a translation unit includes safec_lib.h more than once. +# Use the Yocto safec_lib.h sysroot header for CI builds without libsafec. +# Add include guards because the upstream header does not provide them. cp "$SAFEC_WRAPPER_DIR/safec_lib.h" "$HEADERS_DIR/safec_lib.h" sed -i '1s/^/#ifndef CTRLM_CI_SAFEC_LIB_H\n#define CTRLM_CI_SAFEC_LIB_H\n/' "$HEADERS_DIR/safec_lib.h" printf '\n#endif /* CTRLM_CI_SAFEC_LIB_H */\n' >> "$HEADERS_DIR/safec_lib.h" -# rdkversion.h is included by xr-voice-sdk during its own build, so stage it -# before invoking cmake. +# Stage rdkversion.h before building xr-voice-sdk. cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" -# Build xr-voice-sdk with cmake and install its headers. -# This uses the COMPONENT headers install target added to xr-voice-sdk/src/CMakeLists.txt, -# which covers all headers including the generated rdkx_logger.h and rdkx_logger_modules.h. -# CMAKE_INSTALL_INCLUDEDIR=xr-voice-sdk places headers under ${HEADERS_DIR}/xr-voice-sdk/. +# Build xr-voice-sdk and install its headers under ${HEADERS_DIR}/xr-voice-sdk/. cmake -G Ninja \ -S "$GITHUB_WORKSPACE/xr-voice-sdk" \ -B "$GITHUB_WORKSPACE/build/xr-voice-sdk" \ @@ -115,9 +107,7 @@ cmake -G Ninja \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ -DCMAKE_PROJECT_VERSION="1.0.13" -# xr-voice-sdk unconditionally appends -Werror via target_compile_options. -# Strip it from generated build files for this reduced CI build, matching the -# control build workaround below. +# xr-voice-sdk adds -Werror unconditionally, strip it for CI until warnings are dealt with find "$GITHUB_WORKSPACE/build/xr-voice-sdk" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" @@ -131,10 +121,7 @@ touch rdk/iarmbus/libIBus.h touch rdk/iarmbus/libIBusDaemon.h # IARM manager headers -# sysMgr.h conflicts with the forced Iarm.h mock, which already provides the -# needed SYSMgr types. Use a shim here. To remove it later, either stop -# force-including those overlapping Iarm.h declarations or drop sysMgr.h from -# ctrlm source. +# sysMgr.h conflicts with the forced Iarm.h mock, so use a shim instead. cat > rdk/iarmmgrs-hal/sysMgr.h <<'EOF' #ifndef CTRLM_CI_SYSMGR_SHIM_H #define CTRLM_CI_SYSMGR_SHIM_H @@ -200,14 +187,13 @@ cat > /tmp/stub.c << 'STUB_EOF' void __stub_placeholder(void) {} STUB_EOF -# Build stub .so for each missing library -# nopoll and dshalcli are unused (factory-only) but unconditionally linked by CMakeLists.txt -# We can remove them from the link list in the future if desired, but for now just provide stubs to satisfy the linker. +# Build stub .so files for libraries still linked in CI. +# nopoll and dshalcli are factory-only but still linked unconditionally. for lib in rdkversion IARMBus ds nopoll dshalcli rfcapi secure_wrapper evdev; do gcc -shared -fPIC -o "${STUB_LIB_DIR}/lib${lib}.so" /tmp/stub.c done -# Copy the real xr-voice-sdk .so built by cmake into the lib dir alongside the stubs. +# Copy the real xr-voice-sdk .so alongside the stubs. cp "$GITHUB_WORKSPACE/build/xr-voice-sdk/src/libxr-voice-sdk.so" "${STUB_LIB_DIR}/libxr-voice-sdk.so" rm /tmp/stub.c From 2baae1d15b17b2ca05a13a3137a8a42baf3d331a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 13:55:45 +0000 Subject: [PATCH 13/39] Test --- ci/build_dependencies.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index b641e9d0..e5154e27 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -104,8 +104,7 @@ cmake -G Ninja \ -DCMAKE_INSTALL_PREFIX="${HEADERS_DIR}" \ -DCMAKE_INSTALL_INCLUDEDIR="xr-voice-sdk" \ -DCMAKE_C_FLAGS="-I${HEADERS_DIR} -DSAFEC_DUMMY_API" \ - -DSTAGING_BINDIR_NATIVE="/usr/bin" \ - -DCMAKE_PROJECT_VERSION="1.0.13" + -DSTAGING_BINDIR_NATIVE="/usr/bin" # xr-voice-sdk adds -Werror unconditionally, strip it for CI until warnings are dealt with find "$GITHUB_WORKSPACE/build/xr-voice-sdk" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; From 4bd79b1c824624b72c85630c11153d4f438a337d Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 14:58:55 +0000 Subject: [PATCH 14/39] Update --- ci/build_dependencies.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index e5154e27..a9e73069 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -51,8 +51,9 @@ python3 -m pip install jsonref ########################################### # 2. Clone the required repositories -XRSDK_REF="feature/RDKEMW-18082" -git clone --depth 1 --filter=blob:none --branch "${XRSDK_REF}" https://github.com/rdkcentral/xr-voice-sdk.git +XRSDK_REF="1.0.13" +# git clone --depth 1 --filter=blob:none --branch "${XRSDK_REF}" https://github.com/rdkcentral/xr-voice-sdk.git +git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git @@ -104,7 +105,8 @@ cmake -G Ninja \ -DCMAKE_INSTALL_PREFIX="${HEADERS_DIR}" \ -DCMAKE_INSTALL_INCLUDEDIR="xr-voice-sdk" \ -DCMAKE_C_FLAGS="-I${HEADERS_DIR} -DSAFEC_DUMMY_API" \ - -DSTAGING_BINDIR_NATIVE="/usr/bin" + -DSTAGING_BINDIR_NATIVE="/usr/bin" \ + -DCMAKE_PROJECT_VERSION="${XRSDK_REF}" # xr-voice-sdk adds -Werror unconditionally, strip it for CI until warnings are dealt with find "$GITHUB_WORKSPACE/build/xr-voice-sdk" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; From 0593333f3805d9e7499238cfe2e1da6127539b5e Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 15:27:24 +0000 Subject: [PATCH 15/39] Test --- ci/build_dependencies.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index a9e73069..3c786eb9 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -51,8 +51,7 @@ python3 -m pip install jsonref ########################################### # 2. Clone the required repositories -XRSDK_REF="1.0.13" -# git clone --depth 1 --filter=blob:none --branch "${XRSDK_REF}" https://github.com/rdkcentral/xr-voice-sdk.git +git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git @@ -99,6 +98,9 @@ printf '\n#endif /* CTRLM_CI_SAFEC_LIB_H */\n' >> "$HEADERS_DIR/safec_lib.h" cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" # Build xr-voice-sdk and install its headers under ${HEADERS_DIR}/xr-voice-sdk/. +# Version doesn't matter here, but we try to get the latest tag for good measure since it's included in the generated headers and may be used by downstream code. +XRSDK_REF=$(git ls-remote --tags https://github.com/rdkcentral/xr-voice-sdk.git \ + | grep -oP '\d+\.\d+\.\d+$' | sort -V | tail -1) cmake -G Ninja \ -S "$GITHUB_WORKSPACE/xr-voice-sdk" \ -B "$GITHUB_WORKSPACE/build/xr-voice-sdk" \ From b61a90dbd865f22b48f719d709040d38d80b2819 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 15:32:00 +0000 Subject: [PATCH 16/39] Fix --- ci/build_dependencies.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 3c786eb9..6f0522d1 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -51,7 +51,8 @@ python3 -m pip install jsonref ########################################### # 2. Clone the required repositories -git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/xr-voice-sdk.git +# Will uncomment the following lines and update the branch to main once the changes in feature/RDKEMW-18082 are merged and released. +# git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git From 995c93b48b4e974be799895d94dd6eff15b8767c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 15:36:09 +0000 Subject: [PATCH 17/39] Update --- ci/build_dependencies.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 6f0522d1..4772ebb5 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -102,11 +102,13 @@ cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" # Version doesn't matter here, but we try to get the latest tag for good measure since it's included in the generated headers and may be used by downstream code. XRSDK_REF=$(git ls-remote --tags https://github.com/rdkcentral/xr-voice-sdk.git \ | grep -oP '\d+\.\d+\.\d+$' | sort -V | tail -1) +echo "Building xr-voice-sdk at ref ${XRSDK_REF}" cmake -G Ninja \ -S "$GITHUB_WORKSPACE/xr-voice-sdk" \ -B "$GITHUB_WORKSPACE/build/xr-voice-sdk" \ -DCMAKE_INSTALL_PREFIX="${HEADERS_DIR}" \ -DCMAKE_INSTALL_INCLUDEDIR="xr-voice-sdk" \ + -DCMAKE_INSTALL_SYSCONFDIR="${HEADERS_DIR}/etc" \ -DCMAKE_C_FLAGS="-I${HEADERS_DIR} -DSAFEC_DUMMY_API" \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ -DCMAKE_PROJECT_VERSION="${XRSDK_REF}" From a0595cbca6c9114343eb5364642fe74353d8af52 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 16:41:23 +0000 Subject: [PATCH 18/39] Update to prevent warning from copied safec header --- ci/build_dependencies.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 4772ebb5..8000e480 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -94,6 +94,8 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" cp "$SAFEC_WRAPPER_DIR/safec_lib.h" "$HEADERS_DIR/safec_lib.h" sed -i '1s/^/#ifndef CTRLM_CI_SAFEC_LIB_H\n#define CTRLM_CI_SAFEC_LIB_H\n/' "$HEADERS_DIR/safec_lib.h" printf '\n#endif /* CTRLM_CI_SAFEC_LIB_H */\n' >> "$HEADERS_DIR/safec_lib.h" +# patching parseFormat to avoid -Wmaybe-uninitialized warnings in ctrlm_database.cpp from the safec wrapper's dummy implementation +sed -i 's/static inline int parseFormat(const char \*dst,/static inline int parseFormat(char *dst,/' "$HEADERS_DIR/safec_lib.h" # Stage rdkversion.h before building xr-voice-sdk. cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" From a55c5331474caa33bc9326b1551b3a8d6d434b62 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 17:18:07 +0000 Subject: [PATCH 19/39] Test --- ci/cov_build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/cov_build.sh b/ci/cov_build.sh index e3181ddc..13ace02d 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -79,6 +79,7 @@ ${GLIB_CFLAGS} \ -include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ -Wall -Wno-error \ +-Wno-stringop-truncation \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ -DCMAKE_C_FLAGS=" \ @@ -92,6 +93,7 @@ ${GLIB_CFLAGS} \ -I /usr/include/libdrm \ ${GLIB_CFLAGS} \ -Wall -Wno-error \ +-Wno-stringop-truncation \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ -DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" From 37bf0e96048622b4452550fdba6fe841dce9e435 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 17:33:32 +0000 Subject: [PATCH 20/39] Test --- ci/build_dependencies.sh | 18 ++++++++++++++++++ ci/cov_build.sh | 2 -- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 8000e480..4bab8de9 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -96,6 +96,24 @@ sed -i '1s/^/#ifndef CTRLM_CI_SAFEC_LIB_H\n#define CTRLM_CI_SAFEC_LIB_H\n/' "$HE printf '\n#endif /* CTRLM_CI_SAFEC_LIB_H */\n' >> "$HEADERS_DIR/safec_lib.h" # patching parseFormat to avoid -Wmaybe-uninitialized warnings in ctrlm_database.cpp from the safec wrapper's dummy implementation sed -i 's/static inline int parseFormat(const char \*dst,/static inline int parseFormat(char *dst,/' "$HEADERS_DIR/safec_lib.h" +# patching strncpy_s to avoid the wrapper's raw strncpy expansion, which triggers +# -Wstringop-truncation in CI even though ctrlm manually terminates the destination buffer. +python3 - "$HEADERS_DIR/safec_lib.h" <<'PY' +from pathlib import Path +import sys + +header = Path(sys.argv[1]) +content = header.read_text() +old = """#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\ + if((src != NULL) && (len <= max)) strncpy(dst,src,len);""" +new = """#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\ + if((src != NULL) && (len <= max)) { memcpy(dst,src,len); if((len) < (max)) ((char *)(dst))[len] = '\\0'; }""" + +if old not in content: + raise SystemExit("failed to patch strncpy_s in safec_lib.h") + +header.write_text(content.replace(old, new, 1)) +PY # Stage rdkversion.h before building xr-voice-sdk. cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 13ace02d..e3181ddc 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -79,7 +79,6 @@ ${GLIB_CFLAGS} \ -include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ -Wall -Wno-error \ --Wno-stringop-truncation \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ -DCMAKE_C_FLAGS=" \ @@ -93,7 +92,6 @@ ${GLIB_CFLAGS} \ -I /usr/include/libdrm \ ${GLIB_CFLAGS} \ -Wall -Wno-error \ --Wno-stringop-truncation \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ -DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" From 6bb60498c376cd083cfcddb2a2cf243d2498ff2b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 17:38:19 +0000 Subject: [PATCH 21/39] Testing --- ci/build_dependencies.sh | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 4bab8de9..890fbcb5 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -98,22 +98,7 @@ printf '\n#endif /* CTRLM_CI_SAFEC_LIB_H */\n' >> "$HEADERS_DIR/safec_lib.h" sed -i 's/static inline int parseFormat(const char \*dst,/static inline int parseFormat(char *dst,/' "$HEADERS_DIR/safec_lib.h" # patching strncpy_s to avoid the wrapper's raw strncpy expansion, which triggers # -Wstringop-truncation in CI even though ctrlm manually terminates the destination buffer. -python3 - "$HEADERS_DIR/safec_lib.h" <<'PY' -from pathlib import Path -import sys - -header = Path(sys.argv[1]) -content = header.read_text() -old = """#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\ - if((src != NULL) && (len <= max)) strncpy(dst,src,len);""" -new = """#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\ - if((src != NULL) && (len <= max)) { memcpy(dst,src,len); if((len) < (max)) ((char *)(dst))[len] = '\\0'; }""" - -if old not in content: - raise SystemExit("failed to patch strncpy_s in safec_lib.h") - -header.write_text(content.replace(old, new, 1)) -PY +perl -0pi -e 's{#define strncpy_s\(dst,max,src,len\) \(src != NULL\)\?\(\(len <= max\)\?EOK:ESLEMAX\):ESNULLP; \\\n if\(\(src != NULL\) && \(len <= max\)\) strncpy\(dst,src,len\);}{#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\\n if((src != NULL) && (len <= max)) { size_t copy_len = strnlen(src, len); memcpy(dst, src, copy_len); if(copy_len < (size_t)(max)) memset((char *)(dst) + copy_len, 0, (size_t)(max) - copy_len); }}s or die "failed to patch strncpy_s in safec_lib.h\n"' "$HEADERS_DIR/safec_lib.h" # Stage rdkversion.h before building xr-voice-sdk. cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" From 72bf7ca8929784f803a7e4c0adec5193574b8b1a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 8 May 2026 21:15:27 +0000 Subject: [PATCH 22/39] Update --- ci/build_dependencies.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 890fbcb5..488d0878 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -123,6 +123,7 @@ find "$GITHUB_WORKSPACE/build/xr-voice-sdk" \( -name "*.ninja" -o -name "flags.m cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" cmake --install "$GITHUB_WORKSPACE/build/xr-voice-sdk" --component headers +cmake --install "$GITHUB_WORKSPACE/build/xr-voice-sdk" --component internal-headers cd "${HEADERS_DIR}" From f5068400e208e85b534dbdb2a771547d91fb2f87 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 11 May 2026 19:34:16 +0000 Subject: [PATCH 23/39] Test --- ci/build_dependencies.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 488d0878..7e007d50 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -118,9 +118,6 @@ cmake -G Ninja \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ -DCMAKE_PROJECT_VERSION="${XRSDK_REF}" -# xr-voice-sdk adds -Werror unconditionally, strip it for CI until warnings are dealt with -find "$GITHUB_WORKSPACE/build/xr-voice-sdk" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; - cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" cmake --install "$GITHUB_WORKSPACE/build/xr-voice-sdk" --component headers cmake --install "$GITHUB_WORKSPACE/build/xr-voice-sdk" --component internal-headers From 95695a23a8f4b21eb3848a4f42675a5d12788d68 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 11 May 2026 19:55:50 +0000 Subject: [PATCH 24/39] Updates --- ci/build_dependencies.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 7e007d50..18c52752 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -116,7 +116,8 @@ cmake -G Ninja \ -DCMAKE_INSTALL_SYSCONFDIR="${HEADERS_DIR}/etc" \ -DCMAKE_C_FLAGS="-I${HEADERS_DIR} -DSAFEC_DUMMY_API" \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ - -DCMAKE_PROJECT_VERSION="${XRSDK_REF}" + -DCMAKE_PROJECT_VERSION="${XRSDK_REF}" \ + -DINSTALL_INTERNAL_HEADERS=ON cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" cmake --install "$GITHUB_WORKSPACE/build/xr-voice-sdk" --component headers From 93041b55923247c1dae4ab6abb7de2b7a5eaa259 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 28 May 2026 13:41:40 +0000 Subject: [PATCH 25/39] Update --- ci/build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 18c52752..bf8e074e 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -55,7 +55,7 @@ python3 -m pip install jsonref # git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/xr-voice-sdk.git -git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git +git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/entservices-testframework.git git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git git -C iarmmgrs sparse-checkout set hal From 2255d47384992be3f13e937d86cc8e88513c4525 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 28 May 2026 14:34:33 +0000 Subject: [PATCH 26/39] Test --- ci/build_dependencies.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index bf8e074e..20e5b50a 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -27,6 +27,10 @@ git config --global --add safe.directory "${GITHUB_WORKSPACE}" # ############################# # 1. Install Dependencies and packages +echo "======================================================================================" +# CI workaround: symlink to match expected include path for audio_processing.h +mkdir -p /usr/include/webrtc/modules/audio_processing/include/ +ln -sf /usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h /usr/include/webrtc/modules/audio_processing/include/audio_processing.h apt update apt install -y \ @@ -45,7 +49,9 @@ apt install -y \ libdrm-dev \ libbsd-dev \ gperf \ - python3-pip + python3-pip \ + libwebrtc-audio-processing-dev + python3 -m pip install jsonref ########################################### From 1f6d6a282548ac1eb48a340c6387d9fe51d8610e Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 28 May 2026 14:35:10 +0000 Subject: [PATCH 27/39] Fix --- ci/build_dependencies.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 20e5b50a..f8cd16ea 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -28,9 +28,6 @@ git config --global --add safe.directory "${GITHUB_WORKSPACE}" # ############################# # 1. Install Dependencies and packages echo "======================================================================================" -# CI workaround: symlink to match expected include path for audio_processing.h -mkdir -p /usr/include/webrtc/modules/audio_processing/include/ -ln -sf /usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h /usr/include/webrtc/modules/audio_processing/include/audio_processing.h apt update apt install -y \ @@ -95,6 +92,10 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" +# CI workaround: symlink to match expected include path for audio_processing.h +mkdir -p /usr/include/webrtc/modules/audio_processing/include/ +ln -sf /usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h /usr/include/webrtc/modules/audio_processing/include/audio_processing.h + # Use the Yocto safec_lib.h sysroot header for CI builds without libsafec. # Add include guards because the upstream header does not provide them. cp "$SAFEC_WRAPPER_DIR/safec_lib.h" "$HEADERS_DIR/safec_lib.h" From 830304a9d08f5f00904ca04a78d3a4257ddfc3da Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 28 May 2026 14:45:22 +0000 Subject: [PATCH 28/39] Update --- ci/build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index f8cd16ea..af77dbb1 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -58,7 +58,7 @@ python3 -m pip install jsonref # git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/xr-voice-sdk.git -git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/entservices-testframework.git +git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git git -C iarmmgrs sparse-checkout set hal From dd517be028a478f9a18b861d5d68204a3a8f1454 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 28 May 2026 15:09:56 +0000 Subject: [PATCH 29/39] Test --- ci/build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index af77dbb1..bbf28e5b 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -92,7 +92,7 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" -# CI workaround: symlink to match expected include path for audio_processing.h +# Symlink to match expected include path for audio_processing.h mkdir -p /usr/include/webrtc/modules/audio_processing/include/ ln -sf /usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h /usr/include/webrtc/modules/audio_processing/include/audio_processing.h From b1f0c4abb9125b9fd45456da3553389c32e399a4 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 1 Jun 2026 12:19:57 +0000 Subject: [PATCH 30/39] Updates --- ci/build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index bbf28e5b..8a5e115a 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -58,7 +58,7 @@ python3 -m pip install jsonref # git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/xr-voice-sdk.git -git clone --depth 1 --filter=blob:none --branch feature/RDKEMW-18082 https://github.com/rdkcentral/entservices-testframework.git +git clone --depth 1 --filter=blob:none https://github.com/rdkcentral/entservices-testframework.git git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git git -C iarmmgrs sparse-checkout set hal From 98aeabaa8905d2b355efbe2d878dd9cf727cac2f Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 1 Jun 2026 12:27:43 +0000 Subject: [PATCH 31/39] Adding guards around samples_per_packet instead of commenting --- src/voice/ctrlm_voice_obj.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index 54f4ad42..af6b1731 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -2921,11 +2921,15 @@ void ctrlm_voice_t::voice_stream_end_callback(ctrlm_voice_stream_end_cb_t *strea if(session->packets_processed > 0) { uint32_t stream_duration = session->packets_processed * 20; // assume 20 ms per packet - // uint32_t samples_per_packet = 320; // 16 kHz samples at 20 ms per packet + #ifdef TELEMETRY_SUPPORT + uint32_t samples_per_packet = 320; // 16 kHz samples at 20 ms per packet + #endif if(session->format.type == CTRLM_VOICE_FORMAT_ADPCM_FRAME) { uint32_t frame_duration_us = (session->format.value.adpcm_frame.size_packet - session->format.value.adpcm_frame.size_header) * 125; // 125 us per byte for ADPCM at 16 kHz stream_duration = (session->packets_processed * frame_duration_us) / 1000; - // samples_per_packet = (session->format.value.adpcm_frame.size_packet - session->format.value.adpcm_frame.size_header) * 2; // 2 samples per byte for ADPCM + #ifdef TELEMETRY_SUPPORT + samples_per_packet = (session->format.value.adpcm_frame.size_packet - session->format.value.adpcm_frame.size_header) * 2; // 2 samples per byte for ADPCM + #endif } XLOGD_AUTOMATION_TELEMETRY("src <%s> Packets Lost/Total <%u/%u> %.02f%% duration <%u> ms", ctrlm_voice_device_str(session->voice_device), session->packets_lost, session->packets_lost + session->packets_processed, 100.0 * ((double)session->packets_lost / (double)(session->packets_lost + session->packets_processed)), stream_duration); #ifdef TELEMETRY_SUPPORT From 3149a74c84127a466036a18e5494735fb5532787 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 1 Jun 2026 14:03:01 +0000 Subject: [PATCH 32/39] Updates --- ci/build_dependencies.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 8a5e115a..f954c5be 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -27,7 +27,6 @@ git config --global --add safe.directory "${GITHUB_WORKSPACE}" # ############################# # 1. Install Dependencies and packages -echo "======================================================================================" apt update apt install -y \ From 842403b681f4ddd70a0072d46e98a7c34078c727 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 1 Jun 2026 20:30:15 +0000 Subject: [PATCH 33/39] testing VAD_ENABLED feature to remove webrtc dependency during native build in ci --- ci/build_dependencies.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index f954c5be..a551eddc 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -45,8 +45,7 @@ apt install -y \ libdrm-dev \ libbsd-dev \ gperf \ - python3-pip \ - libwebrtc-audio-processing-dev + python3-pip python3 -m pip install jsonref @@ -91,10 +90,6 @@ mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" -# Symlink to match expected include path for audio_processing.h -mkdir -p /usr/include/webrtc/modules/audio_processing/include/ -ln -sf /usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h /usr/include/webrtc/modules/audio_processing/include/audio_processing.h - # Use the Yocto safec_lib.h sysroot header for CI builds without libsafec. # Add include guards because the upstream header does not provide them. cp "$SAFEC_WRAPPER_DIR/safec_lib.h" "$HEADERS_DIR/safec_lib.h" @@ -123,6 +118,7 @@ cmake -G Ninja \ -DCMAKE_C_FLAGS="-I${HEADERS_DIR} -DSAFEC_DUMMY_API" \ -DSTAGING_BINDIR_NATIVE="/usr/bin" \ -DCMAKE_PROJECT_VERSION="${XRSDK_REF}" \ + -DVAD_ENABLED=OFF \ -DINSTALL_INTERNAL_HEADERS=ON cmake --build "$GITHUB_WORKSPACE/build/xr-voice-sdk" From 05b51cb5de1dd291345ead5e99abfa6aa5cc99de Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 2 Jun 2026 11:52:21 +0000 Subject: [PATCH 34/39] Fixing coverity warning due to the safec wrappers and workarounds in ci --- ci/build_dependencies.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index a551eddc..44514f40 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -97,6 +97,9 @@ sed -i '1s/^/#ifndef CTRLM_CI_SAFEC_LIB_H\n#define CTRLM_CI_SAFEC_LIB_H\n/' "$HE printf '\n#endif /* CTRLM_CI_SAFEC_LIB_H */\n' >> "$HEADERS_DIR/safec_lib.h" # patching parseFormat to avoid -Wmaybe-uninitialized warnings in ctrlm_database.cpp from the safec wrapper's dummy implementation sed -i 's/static inline int parseFormat(const char \*dst,/static inline int parseFormat(char *dst,/' "$HEADERS_DIR/safec_lib.h" +# patching strcpy_s to avoid Coverity's array-vs-NULL warning on string literals while +# preserving the dummy wrapper's null and bounds checks in CI builds. +perl -0pi -e 's{#define strcpy_s\(dst,max,src\) \(src != NULL\)\?\(\(max > strlen\(src\)\)\?EOK:ESLEMAX\):ESNULLP; \\\n if\(\(src != NULL\) && \(max > strlen\(src\)\)\) strcpy\(dst,src\);}{#define strcpy_s(dst,max,src) ({ const char *ctrlm_ci_src__ = (src); ctrlm_ci_src__ != NULL ? (((max) > strlen(ctrlm_ci_src__)) ? (strcpy((dst), ctrlm_ci_src__), EOK) : ESLEMAX) : ESNULLP; })}s or die "failed to patch strcpy_s in safec_lib.h\n"' "$HEADERS_DIR/safec_lib.h" # patching strncpy_s to avoid the wrapper's raw strncpy expansion, which triggers # -Wstringop-truncation in CI even though ctrlm manually terminates the destination buffer. perl -0pi -e 's{#define strncpy_s\(dst,max,src,len\) \(src != NULL\)\?\(\(len <= max\)\?EOK:ESLEMAX\):ESNULLP; \\\n if\(\(src != NULL\) && \(len <= max\)\) strncpy\(dst,src,len\);}{#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\\n if((src != NULL) && (len <= max)) { size_t copy_len = strnlen(src, len); memcpy(dst, src, copy_len); if(copy_len < (size_t)(max)) memset((char *)(dst) + copy_len, 0, (size_t)(max) - copy_len); }}s or die "failed to patch strncpy_s in safec_lib.h\n"' "$HEADERS_DIR/safec_lib.h" From 0e96807ef04470dd683f89ddc8e53a4349a8a3c8 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 2 Jun 2026 12:17:02 +0000 Subject: [PATCH 35/39] Test --- ci/build_dependencies.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 44514f40..73258e65 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -104,6 +104,16 @@ perl -0pi -e 's{#define strcpy_s\(dst,max,src\) \(src != NULL\)\?\(\(max > strle # -Wstringop-truncation in CI even though ctrlm manually terminates the destination buffer. perl -0pi -e 's{#define strncpy_s\(dst,max,src,len\) \(src != NULL\)\?\(\(len <= max\)\?EOK:ESLEMAX\):ESNULLP; \\\n if\(\(src != NULL\) && \(len <= max\)\) strncpy\(dst,src,len\);}{#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\\n if((src != NULL) && (len <= max)) { size_t copy_len = strnlen(src, len); memcpy(dst, src, copy_len); if(copy_len < (size_t)(max)) memset((char *)(dst) + copy_len, 0, (size_t)(max) - copy_len); }}s or die "failed to patch strncpy_s in safec_lib.h\n"' "$HEADERS_DIR/safec_lib.h" +# Testing to verify CI macro rewrites so Coverity runs do not silently use the original dummy macros, as coverity alerts are still present +if ! grep -q 'ctrlm_ci_src__' "$HEADERS_DIR/safec_lib.h"; then + echo "ERROR: strcpy_s rewrite missing in safec_lib.h" + exit 1 +fi +if grep -q '^#define strcpy_s(dst,max,src) (src != NULL)' "$HEADERS_DIR/safec_lib.h"; then + echo "ERROR: original strcpy_s dummy macro still present in safec_lib.h" + exit 1 +fi + # Stage rdkversion.h before building xr-voice-sdk. cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" From 1a4e1122c2871d61d372c6448e249fa105413be4 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 2 Jun 2026 12:20:37 +0000 Subject: [PATCH 36/39] Updates --- ci/build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 73258e65..92e64c2c 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -104,7 +104,7 @@ perl -0pi -e 's{#define strcpy_s\(dst,max,src\) \(src != NULL\)\?\(\(max > strle # -Wstringop-truncation in CI even though ctrlm manually terminates the destination buffer. perl -0pi -e 's{#define strncpy_s\(dst,max,src,len\) \(src != NULL\)\?\(\(len <= max\)\?EOK:ESLEMAX\):ESNULLP; \\\n if\(\(src != NULL\) && \(len <= max\)\) strncpy\(dst,src,len\);}{#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\\n if((src != NULL) && (len <= max)) { size_t copy_len = strnlen(src, len); memcpy(dst, src, copy_len); if(copy_len < (size_t)(max)) memset((char *)(dst) + copy_len, 0, (size_t)(max) - copy_len); }}s or die "failed to patch strncpy_s in safec_lib.h\n"' "$HEADERS_DIR/safec_lib.h" -# Testing to verify CI macro rewrites so Coverity runs do not silently use the original dummy macros, as coverity alerts are still present +# Testing to verify CI macro rewrites so Coverity runs do not silently use the original dummy macros (REMOVE BEFORE MERGE) if ! grep -q 'ctrlm_ci_src__' "$HEADERS_DIR/safec_lib.h"; then echo "ERROR: strcpy_s rewrite missing in safec_lib.h" exit 1 From 21fc86dc8946773808ddea5c7f8bff211eac5093 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 2 Jun 2026 14:41:45 +0000 Subject: [PATCH 37/39] Updates --- ci/build_dependencies.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 92e64c2c..44514f40 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -104,16 +104,6 @@ perl -0pi -e 's{#define strcpy_s\(dst,max,src\) \(src != NULL\)\?\(\(max > strle # -Wstringop-truncation in CI even though ctrlm manually terminates the destination buffer. perl -0pi -e 's{#define strncpy_s\(dst,max,src,len\) \(src != NULL\)\?\(\(len <= max\)\?EOK:ESLEMAX\):ESNULLP; \\\n if\(\(src != NULL\) && \(len <= max\)\) strncpy\(dst,src,len\);}{#define strncpy_s(dst,max,src,len) (src != NULL)?((len <= max)?EOK:ESLEMAX):ESNULLP; \\\n if((src != NULL) && (len <= max)) { size_t copy_len = strnlen(src, len); memcpy(dst, src, copy_len); if(copy_len < (size_t)(max)) memset((char *)(dst) + copy_len, 0, (size_t)(max) - copy_len); }}s or die "failed to patch strncpy_s in safec_lib.h\n"' "$HEADERS_DIR/safec_lib.h" -# Testing to verify CI macro rewrites so Coverity runs do not silently use the original dummy macros (REMOVE BEFORE MERGE) -if ! grep -q 'ctrlm_ci_src__' "$HEADERS_DIR/safec_lib.h"; then - echo "ERROR: strcpy_s rewrite missing in safec_lib.h" - exit 1 -fi -if grep -q '^#define strcpy_s(dst,max,src) (src != NULL)' "$HEADERS_DIR/safec_lib.h"; then - echo "ERROR: original strcpy_s dummy macro still present in safec_lib.h" - exit 1 -fi - # Stage rdkversion.h before building xr-voice-sdk. cp "$RDKVERSION_DIR/src/rdkversion.h" "$HEADERS_DIR/rdkversion.h" From 2ef9641a2f1c70f3f5dd99c7a37b30ec4fccecde Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 3 Jun 2026 11:43:05 +0000 Subject: [PATCH 38/39] Update --- ci/build_dependencies.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 44514f40..ad3aa0c7 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -46,7 +46,6 @@ apt install -y \ libbsd-dev \ gperf \ python3-pip - python3 -m pip install jsonref ########################################### From dc653eb3733e87db3078a219db36b92a132dc389 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 3 Jun 2026 11:45:51 +0000 Subject: [PATCH 39/39] Update to reduce diffs --- ci/build_dependencies.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index ad3aa0c7..408e91fb 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -135,7 +135,10 @@ touch rdk/iarmbus/libIBus.h touch rdk/iarmbus/libIBusDaemon.h # IARM manager headers -# sysMgr.h conflicts with the forced Iarm.h mock, so use a shim instead. +# sysMgr.h conflicts with the forced Iarm.h mock, which already provides the +# needed SYSMgr types. Use a shim here. To remove it later, either stop +# force-including those overlapping Iarm.h declarations or drop sysMgr.h from +# ctrlm source. cat > rdk/iarmmgrs-hal/sysMgr.h <<'EOF' #ifndef CTRLM_CI_SYSMGR_SHIM_H #define CTRLM_CI_SYSMGR_SHIM_H @@ -175,7 +178,7 @@ touch rfcapi.h find "$IARMMGRS_DIR" -name comcastIrKeyCodes.h -print -quit | xargs -r -I{} cp "{}" comcastIrKeyCodes.h [ -f comcastIrKeyCodes.h ] -# rdkversion.h (used by ctrlm_main.cpp and xr-voice-sdk) +# rdkversion.h (used by ctrlm_main.cpp) [ -f rdkversion.h ] # secure_wrapper (types provided via empty stub — no v_secure_* calls in core)