Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ 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)
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
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
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
15 changes: 12 additions & 3 deletions rpc/srv/dsAudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ void AudioConfigInit()
m_volumeLeveller.level = atoi(_volLevellerLevel.c_str());
//SPEAKER init
handle = 0;
INT_DEBUG("bDolbyVolumeOverrideCheck value: %d\n", bDolbyVolumeOverrideCheck);
INT_DEBUG("bDolbyVolumeOverrideCheck value: %d\n", (int)bDolbyVolumeOverrideCheck);
if(bDolbyVolumeOverrideCheck && dsGetAudioPort(dsAUDIOPORT_TYPE_SPEAKER,0,&handle) == dsERR_NONE) {
if (dsSetVolumeLevellerFunc(handle, m_volumeLeveller) == dsERR_NONE) {
INT_INFO("Port %s: Initialized Volume Leveller : Mode: %d, Level: %d\n","SPEAKER0", m_volumeLeveller.mode, m_volumeLeveller.level);
Expand Down Expand Up @@ -2357,10 +2357,18 @@ IARM_Result_t dsAudioMgr_init()
IARM_Result_t dsAudioMgr_term()
{
#ifdef DS_AUDIO_SETTINGS_PERSISTENCE
if(persist_audioLevel_timer_threadIsAlive){
bool shouldJoin = false;
pthread_t threadId;
IARM_BUS_Lock(lock);
shouldJoin = persist_audioLevel_timer_threadIsAlive;
if(shouldJoin){
persist_audioLevel_timer_threadIsAlive=false;
threadId = persist_audioLevel_timer_threadId;
pthread_cond_signal(&audioLevelTimerCV);
pthread_join(persist_audioLevel_timer_threadId,NULL);
}
IARM_BUS_Unlock(lock);
if(shouldJoin){
pthread_join(threadId,NULL);
}
#endif
return IARM_RESULT_SUCCESS;
Expand Down Expand Up @@ -7227,6 +7235,7 @@ static void* persist_audioLevel_timer_threadFunc(void* arg) {
break;
}
// wait for 3 sec, then update the latest audio level from cache variable
/* coverity[sleep : FALSE] */
if(audioLevel_timer_set){
sleep(3);

Expand Down
7 changes: 6 additions & 1 deletion sample/testFrontPanel.cpp
100755 → 100644
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 sample/testFrontPanel.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 'sample/testFrontPanel.cpp' (Match: rdk/components/generic/devicesettings/rdk/components/generic/devicesettings/2.1-20161031, 134 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/devicesettings/+archive/2.1-20161031.tar.gz, file: sample/testFrontPanel.cpp)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -118,7 +118,12 @@
printf("Exception Caught during [%s]\r\n", argv[0]);
}

device::Manager::DeInitialize();
try {
device::Manager::DeInitialize();
}
catch (...) {
printf("Unknown exception during DeInitialize\n");
}


IARM_Bus_Disconnect();
Expand Down
Loading