Skip to content
Merged
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,34 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [1.0.28](https://github.com/rdkcentral/devicesettings/compare/1.0.27...1.0.28)

- RDKEMW-9781: Video format issue on MTK [`#199`](https://github.com/rdkcentral/devicesettings/pull/199)
- RDKEMW-12054: Fix Coverity identified issues [`#190`](https://github.com/rdkcentral/devicesettings/pull/190)
- Merge tag '1.0.27' into develop [`56fabff`](https://github.com/rdkcentral/devicesettings/commit/56fabffd8576c37eedb03dac31c3238fa318977d)

#### [1.0.27](https://github.com/rdkcentral/devicesettings/compare/1.0.26...1.0.27)

> 12 January 2026

- RDKEMW-11232 getAudioFormatApi issue on Xione-UK [`#188`](https://github.com/rdkcentral/devicesettings/pull/188)
- 1.0.27 release change log updates [`6594764`](https://github.com/rdkcentral/devicesettings/commit/6594764c3fde44fdb313576482cd7c2589fe1493)
- Merge tag '1.0.26' into develop [`62858d9`](https://github.com/rdkcentral/devicesettings/commit/62858d954e5871070b4e0433c9e06abaf8ff97d1)

#### [1.0.26](https://github.com/rdkcentral/devicesettings/compare/1.0.25...1.0.26)

> 8 January 2026

- RDKEMW-11168, RDKEMW-4848: pass the proper handle to dsEnableHDCP [`#182`](https://github.com/rdkcentral/devicesettings/pull/182)
- 1.0.26 release change log updates [`898b0bb`](https://github.com/rdkcentral/devicesettings/commit/898b0bbcbc5e16bd1c5f4bcf2e881b8ef037c8af)
- Merge tag '1.0.25' into develop [`ce8af83`](https://github.com/rdkcentral/devicesettings/commit/ce8af8303729b6a01fe4d8240de74fe365cdafe4)

#### [1.0.25](https://github.com/rdkcentral/devicesettings/compare/1.0.24...1.0.25)

> 20 November 2025

- Feature/rdkemw 7496 [`#134`](https://github.com/rdkcentral/devicesettings/pull/134)
- 1.0.25 release change log updates [`75b7563`](https://github.com/rdkcentral/devicesettings/commit/75b7563fc461eeaa31bd68140f29ccf0900a6655)
- Merge tag '1.0.24' into develop [`4e94421`](https://github.com/rdkcentral/devicesettings/commit/4e94421d193d4d5e7dea28ccf49198c7dc2bf1d4)

#### [1.0.24](https://github.com/rdkcentral/devicesettings/compare/1.0.23...1.0.24)
Expand Down
8 changes: 4 additions & 4 deletions ds/audioOutputPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ AudioOutputPort::AudioOutputPort(const int type, const int index, const int id)
out << getType().getName() << _index;
_name = out.str();
}
printf ("\nAudioOutputPort init: _type:%d _index:%d _handle:%d\n", _type, _index, _handle);
printf ("\nAudioOutputPort init: _type:%d _index:%d _handle:%ld\n", _type, _index, (long)_handle);
if (dsERR_NONE == ret) {
//dsGetAudioCompression (_handle, (dsAudioCompression_t *)&_compression);
dsGetAudioEncoding (_handle, (dsAudioEncoding_t *)&_encoding);
Expand Down Expand Up @@ -184,7 +184,7 @@ dsError_t AudioOutputPort::reInitializeAudioOutputPort()
_name = out.str();
}

printf ("\nAudioOutputPort init: _type:%d _index:%d _handle:%d\n", _type, _index, _handle);
printf ("\nAudioOutputPort init: _type:%d _index:%d _handle:%ld\n", _type, _index,(long)_handle);
if (dsERR_NONE == ret) {
//dsGetAudioCompression>(_handle, (dsAudioCompression_t *)&_compression);
dsGetAudioEncoding(_handle, (dsAudioEncoding_t *)&_encoding);
Expand Down Expand Up @@ -1422,11 +1422,11 @@ void AudioOutputPort::setAudioDelay(const uint32_t audioDelayMs)
dsError_t ret = dsERR_NONE;
uint32_t ms = audioDelayMs;

INT_INFO("AudioOutputPort [%s], setting delay to [%lu] ms\n", _name.c_str(), audioDelayMs);
INT_INFO("AudioOutputPort [%s], setting delay to [%u] ms\n", _name.c_str(), audioDelayMs);

if (ms > audioDelayMsMax)
{
INT_ERROR("AudioOutputPort [%s], delay [%lu] ms, exceeds max [%lu]. Setting Max \n",
INT_ERROR("AudioOutputPort [%s], delay [%u] ms, exceeds max [%u]. Setting Max \n",
_name.c_str(),
audioDelayMs,
audioDelayMsMax);
Expand Down
3 changes: 0 additions & 3 deletions ds/edid-parser.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in ds/edid-parser.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'ds/edid-parser.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/1906, 700 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/rdk-dev-1906.tar.gz, file: ds/edid-parser.cpp)
*
* Copyright 2019 RDK Management
*
Expand Down Expand Up @@ -55,7 +55,6 @@
case 1: v = (h * 3) / 4; break;
case 2: v = (h * 4) / 5; break;
case 3: v = (h * 9) / 16; break;
default: return;
}
int r = (bytes[idx + 1] & 0x3F) + 60;
INT_DEBUG("STD %dx%d@%d\n", h, v, r);
Expand Down Expand Up @@ -381,8 +380,6 @@
case 6: break;
// 'Use Extended Tag'
case 7: parse_extended_db(&bytes[idx], data_ptr); break;
// default - unsupported
default: INT_DEBUG("Unsupported extension tag: 0x%X\n", tag);
}
idx += len + 1;
}
Expand Down
2 changes: 1 addition & 1 deletion ds/hdmiIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ void HdmiInput::getHDMISPDInfo (int iHdmiPort, std::vector<uint8_t> &data) {
data.clear();
if (ret == dsERR_NONE) {
if (sizeof(spdinfo) <= sizeof(struct dsSpd_infoframe_st)) {
printf("HdmiInput::getHDMISPDInfo has %d bytes\r\n", sizeof(spdinfo));
printf("HdmiInput::getHDMISPDInfo has %zu bytes\r\n", sizeof(spdinfo));
data.insert(data.begin(), spdinfo, spdinfo + sizeof(struct dsSpd_infoframe_st));
} else {
ret = dsERR_OPERATION_NOT_SUPPORTED;
Expand Down
51 changes: 49 additions & 2 deletions ds/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,53 @@ Host::~Host()
return std::string(socID);
}

intptr_t Host::getAudioPortHandle()
{
try
{
if (isHDMIOutPortPresent())
{
//STB profile with single audio output port
AudioOutputPort aPort = getAudioOutputPort("HDMI0");
return aPort.getOutputPortHandle();
}
else
{
//TV profile with multiple audio output ports
// First check the ports which are dynamically conected and finally fallback to SPEAKER0 which is always connected.
const std::string audio_ports[] = {"HDMI_ARC0", "HEADPHONE0", "SPDIF0", "SPEAKER0"};

// Try each port in priority order
for (const auto& portName : audio_ports)
{
try
{
AudioOutputPort aPort = getAudioOutputPort(portName);
cout << "Checking audio port: " << portName << " isEnabled: " << aPort.isEnabled() << " isConnected: " << aPort.isConnected() << "\n";
// Check if port is enabled and connected
if (aPort.isEnabled() && aPort.isConnected())
{
cout << "Using audio port: " << portName << "\n";
return aPort.getOutputPortHandle();
}
}
catch(const std::exception& e)
{
// Port not found or error accessing it, log and continue to next port
cout << "Exception while accessing audio port " << portName << ": " << e.what() << "\n";
continue;
}
}
}
}
catch(const std::exception& e)
{
cout << " Exception Thrown in getAudioPortHandle().. returning NULL...: " << e.what() << "\n";
}

return NULL;
}

/**
* Host::getCurrentAudioFormat(dsAudioFormat_t &audioFormat)
* @brief
Expand All @@ -397,8 +444,8 @@ Host::~Host()
{
dsError_t ret = dsERR_NONE;
dsAudioFormat_t aFormat;

ret = dsGetAudioFormat(NULL, &aFormat);
intptr_t audioPortHandle = getAudioPortHandle();
ret = dsGetAudioFormat(audioPortHandle, &aFormat);

if (ret == dsERR_NONE)
{
Expand Down
1 change: 1 addition & 0 deletions ds/include/audioOutputPort.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in ds/include/audioOutputPort.hpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'ds/include/audioOutputPort.hpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2102, 179 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/rdk-dev-2102.tar.gz, file: ds/include/audioOutputPort.hpp)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -93,6 +93,7 @@
const AudioOutputPortType & getType() const;
int getId() const {return _id;};
int getIndex() const {return _index; };
intptr_t getOutputPortHandle() const { return _handle;};


/**
Expand Down
2 changes: 1 addition & 1 deletion ds/include/exception.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in ds/include/exception.hpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'ds/include/exception.hpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 133 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: ds/include/exception.hpp)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -64,7 +64,7 @@
*
* @return None
*/
Exception(const char *msg = "No Message for this exception") throw() : _msg(msg) {
Exception(const char *msg = "No Message for this exception") throw() : _err(0), _msg(msg) {
}


Expand Down
1 change: 1 addition & 0 deletions ds/include/host.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ class Host {
void setSecondaryLanguage(const std::string sLang);
void getSecondaryLanguage(std::string& sLang);
bool isHDMIOutPortPresent();
intptr_t getAudioPortHandle();
std::string getDefaultVideoPortName();
std::string getDefaultAudioPortName();
void getCurrentAudioFormat(dsAudioFormat_t& audioFormat);
Expand Down
102 changes: 70 additions & 32 deletions ds/manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in ds/manager.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'ds/manager.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 237 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: ds/manager.cpp)

Check failure on line 3 in ds/manager.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'ds/manager.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/b34ed54, 237 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/b34ed545b533a0cf4d29d221cc23daad47f32644.tar.gz, file: ds/manager.cpp)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -43,6 +43,7 @@
#include "exception.hpp"
#include <pthread.h>
#include <unistd.h>
#include <functional>

/**
* @file manager.cpp
Expand All @@ -62,6 +63,7 @@

int Manager::IsInitialized = 0; //!< Indicates the application has initialized with devicettings modules.
static std::mutex gManagerInitMutex;
static dsError_t initializeFunctionWithRetry(const char* functionName, std::function<dsError_t()> initFunc);

Manager::Manager() {
// TODO Auto-generated constructor stub
Expand All @@ -79,6 +81,41 @@
}\
}

/**
* @brief Retry initialization function with configurable retry logic.
*
* This helper function attempts to initialize a device settings component by calling
* the provided initialization function. It retries the operation with a delay between
* attempts until either the operation succeeds, the maximum retry count is reached,
* or (optionally) a specific error state is encountered.
*
* @param[in] functionName Name of the initialization function being called. Used for logging
* purposes to identify which component is being initialized.
* @param[in] initFunc Lambda or function object that performs the actual initialization.
* Should return dsError_t indicating success (dsERR_NONE) or an error code.
*
* @return dsERR_NONE on successful initialization, or the last error code encountered after
* all retry attempts are exhausted. When checkInvalidState is true, also returns
* immediately with the error code if a non-dsERR_INVALID_STATE error occurs.
*/
dsError_t initializeFunctionWithRetry(const char* functionName,
std::function<dsError_t()> initFunc)
{
dsError_t err = dsERR_GENERAL;
unsigned int retryCount = 0;
unsigned int maxRetries = 25;

do {
err = initFunc();
printf("Manager::Initialize:%s result :%d retryCount :%d\n",
functionName, err, retryCount);
if (dsERR_NONE == err) break;
usleep(100000);
} while (retryCount++ < maxRetries);

return err;
}

/**
* @addtogroup dssettingsmanagerapi
* @{
Expand All @@ -105,44 +142,45 @@
*/
void Manager::Initialize()
{
{std::lock_guard<std::mutex> lock(gManagerInitMutex);
printf("Entering %s count %d with thread id %lu\n",__FUNCTION__,IsInitialized,pthread_self());
bool needInit = false;

{std::lock_guard<std::mutex> lock(gManagerInitMutex);
printf("Entering %s count %d with thread id %lu\n",__FUNCTION__,IsInitialized,pthread_self());
if (IsInitialized == 0) {
needInit = true;
}
IsInitialized++;
}

try {
if (0 == IsInitialized) {

dsError_t err = dsERR_GENERAL;
unsigned int retryCount = 0;
// This retry logic will wait for the device manager initialization from the client side
// until the device manager service initialization is completed. The retry mechanism checks
// only for dsERR_INVALID_STATE, which is reported if the underlying service is not ready.
// Once the service is ready, other port initializations can be called directly without any delay.
// That's why the retry logic is applied only for dsDisplayInit.
do {
err = dsDisplayInit();
printf ("Manager::Initialize: result :%d retryCount :%d\n", err, retryCount);
if (dsERR_NONE == err) break;
usleep(100000);
} while(( dsERR_INVALID_STATE == err) && (retryCount++ < 25));
try {
if (needInit) {
dsError_t err = dsERR_GENERAL;

err = initializeFunctionWithRetry("dsDisplayInit", dsDisplayInit);
CHECK_RET_VAL(err);
err = dsAudioPortInit();

err = initializeFunctionWithRetry("dsAudioPortInit", dsAudioPortInit);
CHECK_RET_VAL(err);
err = dsVideoPortInit();

err = initializeFunctionWithRetry("dsVideoPortInit", dsVideoPortInit);
CHECK_RET_VAL(err);
err = dsVideoDeviceInit();
CHECK_RET_VAL(err);
AudioOutputPortConfig::getInstance().load();
VideoOutputPortConfig::getInstance().load();
VideoDeviceConfig::getInstance().load();
}
IsInitialized++;

err = initializeFunctionWithRetry("dsVideoDeviceInit", dsVideoDeviceInit);
CHECK_RET_VAL(err);

AudioOutputPortConfig::getInstance().load();
VideoOutputPortConfig::getInstance().load();
VideoDeviceConfig::getInstance().load();
}
}
catch(const Exception &e) {
cout << "Caught exception during Initialization" << e.what() << endl;
throw e;
}
}
printf("Exiting %s with thread %lu\n",__FUNCTION__,pthread_self());
cout << "Caught exception during Initialization" << e.what() << endl;
std::lock_guard<std::mutex> lock(gManagerInitMutex);
IsInitialized--;
throw e;
}

printf("Exiting %s with thread %lu\n",__FUNCTION__,pthread_self());
}

void Manager::load()
Expand Down
2 changes: 1 addition & 1 deletion ds/videoDevice.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in ds/videoDevice.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'ds/videoDevice.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/b34ed54, 293 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/b34ed545b533a0cf4d29d221cc23daad47f32644.tar.gz, file: ds/videoDevice.cpp)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -101,7 +101,7 @@
* @param[in] id Port id.
* @return None.
*/
VideoDevice::VideoDevice(int id)
VideoDevice::VideoDevice(int id): _dfc(0)
{
dsError_t ret = dsGetVideoDevice(id, &_handle);

Expand Down
4 changes: 2 additions & 2 deletions rpc/cli/dsVideoPort.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 2 in rpc/cli/dsVideoPort.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'rpc/cli/dsVideoPort.c' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2008, 968 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/rdk-dev-2008.tar.gz, file: rpc/cli/dsVideoPort.c)

Check failure on line 2 in rpc/cli/dsVideoPort.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'rpc/cli/dsVideoPort.c' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/1906, 968 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/rdk-dev-1906.tar.gz, file: rpc/cli/dsVideoPort.c)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -82,7 +82,7 @@
&param,
sizeof(param));

printf("%s..%d-%d\n",__func__,param.type,param.handle);
printf("%s..%d-%ld\n",__func__,param.type,(long)param.handle);

if (IARM_RESULT_SUCCESS == rpcRet)
{
Expand Down Expand Up @@ -530,7 +530,7 @@
}
}

printf("IARM:CLI:dsEnableHDCP %d, %p, %d\r\n", contentProtect, hdcpKey, keySize);
printf("IARM:CLI:dsEnableHDCP %d, %p, %zu\r\n", contentProtect, hdcpKey, keySize);

IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
rpcRet = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
Expand Down
Loading
Loading