Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 39 additions & 34 deletions ci/build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,18 @@ 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"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will update once xr-voice-sdk changes are merged

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

perhaps we can point this to "main" so it always uses the latest release version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes will update this once we merge change for xr-voice-sdk

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

Comment thread
msmith113 marked this conversation as resolved.
Comment thread
msmith113 marked this conversation as resolved.
Outdated
git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git
git -C iarmmgrs sparse-checkout set hal
Expand All @@ -83,30 +80,39 @@ 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"

# 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"

# 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.
# 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" \
-DCMAKE_C_FLAGS="-I${HEADERS_DIR}" \
-DSTAGING_BINDIR_NATIVE="/usr/bin" \
-DCMAKE_PROJECT_VERSION="1.0.13"
Comment thread
msmith113 marked this conversation as resolved.
Outdated

# 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

cd "${HEADERS_DIR}"

Expand Down Expand Up @@ -159,17 +165,12 @@ 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)
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}"
Expand All @@ -193,10 +194,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}"
Expand Down
4 changes: 0 additions & 4 deletions ci/cov_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ 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"
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)"
Expand Down Expand Up @@ -77,9 +75,7 @@ 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_OVERRIDES} \
-include ${MOCK_DIR}/devicesettings.h \
-include ${MOCK_DIR}/Rfc.h \
-Wall -Wno-error \
Expand Down
40 changes: 0 additions & 40 deletions ci/mocks/devicesettings_ctrlm.patch

This file was deleted.

48 changes: 0 additions & 48 deletions ci/mocks/testframework_overrides.h

This file was deleted.

42 changes: 0 additions & 42 deletions ci/mocks/xlog_ci_compat.h

This file was deleted.

6 changes: 6 additions & 0 deletions src/ctrlm_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <archive.h>
#include <algorithm>
#include <cctype>
#include <tuple>
#include "ctrlm.h"
#include "ctrlm_utils.h"
#include <xr_mq.h>
Expand All @@ -47,6 +48,11 @@
#include <regex>
// end dsMgr includes

using std::get;
using std::map;
using std::string;
using std::tuple;
Comment thread
msmith113 marked this conversation as resolved.

#define BLOCK_SIZE (1024 * 4 * 10) /* bytes */
#define MAX_RECURSE_DEPTH 20

Expand Down
4 changes: 2 additions & 2 deletions src/voice/ctrlm_voice_obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
msmith113 marked this conversation as resolved.
Outdated
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
Expand Down
Loading