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
564 changes: 564 additions & 0 deletions .github/workflows/L1-tests.yml

Large diffs are not rendered by default.

581 changes: 581 additions & 0 deletions .github/workflows/L2-tests.yml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ 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.7](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.6...1.0.7)

- RDKEMW-3359:HdmiCecSink RDK-V to RDK-E sync changes [`#48`](https://github.com/rdkcentral/entservices-inputoutput/pull/48)
- Update run_peru.sh by removing secrets [`#47`](https://github.com/rdkcentral/entservices-inputoutput/pull/47)
- RDK-55408: RDKE Services L2 Test Suite Development [`#30`](https://github.com/rdkcentral/entservices-inputoutput/pull/30)
- RDKEMW-2208 and RDKEMW-2209 Enabling L1 and L2 tests for entservices-inputoutput repo [`#25`](https://github.com/rdkcentral/entservices-inputoutput/pull/25)
- Enabling workflow for L1 and L2 [`4049a2e`](https://github.com/rdkcentral/entservices-inputoutput/commit/4049a2eb188efede1c1547be50847d29ddcb9e03)
- Merge tag '1.0.6' into develop [`f46b084`](https://github.com/rdkcentral/entservices-inputoutput/commit/f46b084ed21e61d89e20868eacdea4ba8198266d)
- Added L2-test.yml [`a199266`](https://github.com/rdkcentral/entservices-inputoutput/commit/a1992664c3dfc807fbb7bceb32b30e8dbe78f305)

#### [1.0.6](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.5...1.0.6)

> 27 March 2025

- Removed Cec host header [`#35`](https://github.com/rdkcentral/entservices-inputoutput/pull/35)
- 1.0.9 release change log updates [`8abd094`](https://github.com/rdkcentral/entservices-inputoutput/commit/8abd09439355af4041436e562c4590769b55bc0c)
- Merge tag '1.0.5' into develop [`3b26eeb`](https://github.com/rdkcentral/entservices-inputoutput/commit/3b26eebfdf0e992e369e5cd3cdc981748c9cdb69)

#### [1.0.5](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.4...1.0.5)
Expand Down
1 change: 0 additions & 1 deletion HdmiCecSink/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ All notable changes to this RDK Service will be documented in this file.
* **Security** in case of vulnerabilities.

* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.

176 changes: 131 additions & 45 deletions HdmiCecSink/HdmiCecSink.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in HdmiCecSink/HdmiCecSink.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 'HdmiCecSink/HdmiCecSink.cpp' (Match: rdkcentral/rdkservices/1, 3557 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiCecSink/HdmiCecSink.cpp)

Check failure on line 1 in HdmiCecSink/HdmiCecSink.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 'HdmiCecSink/HdmiCecSink.cpp' (Match: rdkcentral/rdkservices/866, 3532 lines, url: https://github.com/rdkcentral/rdkservices/archive/AML_BSP_VERSION_866.tar.gz, file: HdmiCecSink/HdmiCecSink.cpp)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand Down Expand Up @@ -75,6 +75,7 @@
#define HDMICECSINK_NUMBER_TV_ADDR 2
#define HDMICECSINK_UPDATE_POWER_STATUS_INTERVA_MS (60 * 1000)
#define HDMISINK_ARC_START_STOP_MAX_WAIT_MS 4000
#define HDMICECSINK_UPDATE_AUDIO_STATUS_INTERVAL_MS 500


#define SAD_FMT_CODE_AC3 2
Expand Down Expand Up @@ -174,9 +175,7 @@

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 3
#define API_VERSION_NUMBER_PATCH 7

using PowerState = WPEFramework::Exchange::IPowerManager::PowerState;
#define API_VERSION_NUMBER_PATCH 10

namespace WPEFramework
{
Expand Down Expand Up @@ -710,7 +709,10 @@
m_currentActiveSource = -1;
m_isHdmiInConnected = false;
hdmiCecAudioDeviceConnected = false;
m_audioDevicePowerStatusRequested = false;
m_isAudioStatusInfoUpdated = false;
m_audioStatusReceived = false;
m_audioStatusTimerStarted = false;
m_audioDevicePowerStatusRequested = false;
m_pollNextState = POLL_THREAD_STATE_NONE;
m_pollThreadState = POLL_THREAD_STATE_NONE;
m_video_latency = DEFAULT_VIDEO_LATENCY;
Expand Down Expand Up @@ -745,22 +747,23 @@
Register(HDMICECSINK_METHOD_SET_LATENCY_INFO, &HdmiCecSink::setLatencyInfoWrapper, this);
logicalAddressDeviceType = "None";
logicalAddress = 0xFF;
// load persistence setting
loadSettings();

int err;
dsHdmiInGetNumberOfInputsParam_t hdmiInput;
InitializeIARM();
m_sendKeyEventThreadExit = false;
m_sendKeyEventThread = std::thread(threadSendKeyEvent);

m_currentArcRoutingState = ARC_STATE_ARC_TERMINATED;
m_semSignaltoArcRoutingThread.acquire();
m_arcRoutingThread = std::thread(threadArcRouting);


m_audioStatusDetectionTimer.connect( std::bind( &HdmiCecSink::audioStatusTimerFunction, this ) );
m_audioStatusDetectionTimer.setSingleShot(true);
m_arcStartStopTimer.connect( std::bind( &HdmiCecSink::arcStartStopTimerFunction, this ) );
m_arcStartStopTimer.setSingleShot(true);
// load persistence setting
loadSettings();

int err;
dsHdmiInGetNumberOfInputsParam_t hdmiInput;
InitializeIARM();
// get power state:
uint32_t res = Core::ERROR_GENERAL;
PowerState pwrStateCur = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN;
Expand Down Expand Up @@ -812,7 +815,7 @@
}
}
getCecVersion();
getHdmiArcPortID();
LOGINFO(" HdmiCecSink plugin Initialize completed \n");
return (std::string());

}
Expand Down Expand Up @@ -1147,6 +1150,18 @@
JsonObject params;
if(!HdmiCecSink::_instance)
return;
if (m_audioStatusTimerStarted)
{
m_audioStatusReceived = true;
m_isAudioStatusInfoUpdated = true;
m_audioStatusTimerStarted = false;
if (m_audioStatusDetectionTimer.isActive())
{
LOGINFO("AudioStatus received from the Audio Device and the timer is still active. So stopping the timer!\n");
m_audioStatusDetectionTimer.stop();
}
LOGINFO("AudioStatus received from the Audio Device. Updating the AudioStatus info! m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted);
}
LOGINFO("Command: ReportAudioStatus %s audio Mute status %d means %s and current Volume level is %d \n",GetOpName(msg.opCode()),msg.status.getAudioMuteStatus(),msg.status.toString().c_str(),msg.status.getAudioVolume());
params["muteStatus"] = msg.status.getAudioMuteStatus();
params["volumeLevel"] = msg.status.getAudioVolume();
Expand Down Expand Up @@ -2477,7 +2492,14 @@
params["status"] = string("success");
params["audioDeviceConnected"] = string("false");
hdmiCecAudioDeviceConnected = false;
sendNotify(eventString[HDMICECSINK_EVENT_AUDIO_DEVICE_CONNECTED_STATUS], params);
if (m_audioStatusDetectionTimer.isActive()){
m_audioStatusDetectionTimer.stop();
}
m_isAudioStatusInfoUpdated = false;
m_audioStatusReceived = false;
m_audioStatusTimerStarted = false;
LOGINFO("Audio device removed, reset the audio status info. m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted);
sendNotify(eventString[HDMICECSINK_EVENT_AUDIO_DEVICE_CONNECTED_STATUS], params)
}

_instance->deviceList[logicalAddress].m_isRequestRetry = 0;
Expand Down Expand Up @@ -2720,29 +2742,44 @@
_instance->allocateLogicalAddress(DeviceType::TV);
if ( _instance->m_logicalAddressAllocated != LogicalAddress::UNREGISTERED)
{
logicalAddress = LogicalAddress(_instance->m_logicalAddressAllocated);
LibCCEC::getInstance().addLogicalAddress(logicalAddress);
_instance->smConnection->setSource(logicalAddress);
_instance->m_numberOfDevices = 0;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_deviceType = DeviceType::TV;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_isDevicePresent = true;
_instance->deviceList[_instance->m_logicalAddressAllocated].update(physical_addr);
_instance->deviceList[_instance->m_logicalAddressAllocated].m_cecVersion = Version::V_1_4;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_vendorID = appVendorId;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_powerStatus = PowerStatus(powerState);
_instance->deviceList[_instance->m_logicalAddressAllocated].m_currentLanguage = defaultLanguage;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_osdName = osdName.toString().c_str();
if(cecVersion == 2.0) {
_instance->deviceList[_instance->m_logicalAddressAllocated].m_cecVersion = Version::V_2_0;
_instance->smConnection->sendTo(LogicalAddress(LogicalAddress::BROADCAST),
MessageEncoder().encode(ReportFeatures(Version::V_2_0,allDevicetype,rcProfile,deviceFeatures)), 500);
}
_instance->smConnection->addFrameListener(_instance->msgFrameListener);
_instance->smConnection->sendTo(LogicalAddress(LogicalAddress::BROADCAST),
MessageEncoder().encode(ReportPhysicalAddress(physical_addr, _instance->deviceList[_instance->m_logicalAddressAllocated].m_deviceType)), 100);

_instance->m_sleepTime = 0;
_instance->m_pollThreadState = POLL_THREAD_STATE_PING;
try{

logicalAddress = LogicalAddress(_instance->m_logicalAddressAllocated);
LibCCEC::getInstance().addLogicalAddress(logicalAddress);
_instance->smConnection->setSource(logicalAddress);
_instance->m_numberOfDevices = 0;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_deviceType = DeviceType::TV;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_isDevicePresent = true;
_instance->deviceList[_instance->m_logicalAddressAllocated].update(physical_addr);
_instance->deviceList[_instance->m_logicalAddressAllocated].m_cecVersion = Version::V_1_4;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_vendorID = appVendorId;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_powerStatus = PowerStatus(powerState);
_instance->deviceList[_instance->m_logicalAddressAllocated].m_currentLanguage = defaultLanguage;
_instance->deviceList[_instance->m_logicalAddressAllocated].m_osdName = osdName.toString().c_str();
if(cecVersion == 2.0) {
_instance->deviceList[_instance->m_logicalAddressAllocated].m_cecVersion = Version::V_2_0;
_instance->smConnection->sendTo(LogicalAddress(LogicalAddress::BROADCAST),
MessageEncoder().encode(ReportFeatures(Version::V_2_0,allDevicetype,rcProfile,deviceFeatures)), 500);
}
_instance->smConnection->addFrameListener(_instance->msgFrameListener);
_instance->smConnection->sendTo(LogicalAddress(LogicalAddress::BROADCAST),
MessageEncoder().encode(ReportPhysicalAddress(physical_addr, _instance->deviceList[_instance->m_logicalAddressAllocated].m_deviceType)), 100);

_instance->m_sleepTime = 0;
_instance->m_pollThreadState = POLL_THREAD_STATE_PING;
}
catch(InvalidStateException &e){
LOGWARN("InvalidStateException caught while allocated logical address. %s", e.what());
_instance->m_pollThreadState = POLL_THREAD_STATE_EXIT;
}
catch(IOException &e){
LOGWARN("IOException caught while allocated logical address. %s", e.what());
_instance->m_pollThreadState = POLL_THREAD_STATE_EXIT;
}
catch(...){
LOGWARN("Exception caught while allocated logical address.");
_instance->m_pollThreadState = POLL_THREAD_STATE_EXIT;
}
}
else
{
Expand Down Expand Up @@ -2978,9 +3015,14 @@
{
LibCCEC::getInstance().init("HdmiCecSink");
}
catch (const std::exception& e)
{
LOGWARN("CEC exception caught from LibCCEC::getInstance().init()");
catch(InvalidStateException &e){
LOGWARN("InvalidStateException caught in LibCCEC::init %s", e.what());
}
catch(IOException &e){
LOGWARN("IOException caught in LibCCEC::init %s", e.what());
}
catch(...){
LOGWARN("Exception caught in LibCCEC::init");
}
}
libcecInitStatus++;
Expand Down Expand Up @@ -3074,6 +3116,14 @@

m_logicalAddressAllocated = LogicalAddress::UNREGISTERED;
m_currentArcRoutingState = ARC_STATE_ARC_TERMINATED;
if (m_audioStatusDetectionTimer.isActive()){
m_audioStatusDetectionTimer.stop();
}
m_isAudioStatusInfoUpdated = false;
m_audioStatusReceived = false;
m_audioStatusTimerStarted = false;
LOGINFO("CEC Disabled, reset the audio status info. m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted);


for(int i=0; i< 16; i++)
{
Expand All @@ -3089,9 +3139,14 @@
{
LibCCEC::getInstance().term();
}
catch (const std::exception& e)
{
LOGWARN("CEC exception caught from LibCCEC::getInstance().term() ");
catch(InvalidStateException &e){
LOGWARN("InvalidStateException caught in LibCCEC::term %s", e.what());
}
catch(IOException &e){
LOGWARN("IOException caught in LibCCEC::term %s", e.what());
}
catch(...){
LOGWARN("Exception caught in LibCCEC::term");
}
}

Expand Down Expand Up @@ -3324,12 +3379,43 @@

if((_instance->m_SendKeyQueue.size()<=1 || (_instance->m_SendKeyQueue.size() % 2 == 0)) && ((keyInfo.keyCode == VOLUME_UP) || (keyInfo.keyCode == VOLUME_DOWN) || (keyInfo.keyCode == MUTE)) )
{
_instance->sendGiveAudioStatusMsg();
}
if(keyInfo.keyCode == MUTE)
{
_instance->sendGiveAudioStatusMsg();
}
else
{
LOGINFO("m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ",_instance->m_isAudioStatusInfoUpdated,_instance->m_audioStatusReceived,_instance->m_audioStatusTimerStarted);
if (!_instance->m_isAudioStatusInfoUpdated)
{
if ( !(_instance->m_audioStatusDetectionTimer.isActive()))
{
LOGINFO("Audio status info not updated. Starting the Timer!");
_instance->m_audioStatusTimerStarted = true;
_instance->m_audioStatusDetectionTimer.start((HDMICECSINK_UPDATE_AUDIO_STATUS_INTERVAL_MS));
}
LOGINFO("m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", _instance->m_isAudioStatusInfoUpdated,_instance->m_audioStatusReceived,_instance->m_audioStatusTimerStarted);
}
else
{
if (!_instance->m_audioStatusReceived){
_instance->sendGiveAudioStatusMsg();
}
}
}
}

}//while(!_instance->m_sendKeyEventThreadExit)
}//threadSendKeyEvent

void HdmiCecSink::audioStatusTimerFunction()
{
m_audioStatusTimerStarted = false;
m_isAudioStatusInfoUpdated = true;
LOGINFO("Timer Expired. Requesting the AudioStatus since not received.\n");
sendGiveAudioStatusMsg();
LOGINFO("m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted);
}

void HdmiCecSink::threadArcRouting()
{
Expand All @@ -3340,7 +3426,7 @@
return;

LOGINFO("Running threadArcRouting");

_instance->getHdmiArcPortID();

while(1)
{
Expand Down
9 changes: 7 additions & 2 deletions HdmiCecSink/HdmiCecSink.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in HdmiCecSink/HdmiCecSink.h

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 'HdmiCecSink/HdmiCecSink.h' (Match: rdkcentral/rdkservices/1, 744 lines, url: https://github.com/rdkcentral/rdkservices/archive/GRT_v1.tar.gz, file: HdmiCecSink/HdmiCecSink.h)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand Down Expand Up @@ -573,9 +573,10 @@
void sendKeyReleaseEvent(const int logicalAddress);
void sendUserControlPressed(const int logicalAddress, int keyCode);
void sendUserControlReleased(const int logicalAddress);
void sendGiveAudioStatusMsg();
void onPowerModeChanged(const PowerState &currentState, const PowerState &newState);
void registerEventHandlers();
void sendGiveAudioStatusMsg();
void getHdmiArcPortID();
int m_numberOfDevices; /* Number of connected devices othethan own device */
bool m_audioDevicePowerStatusRequested;

Expand Down Expand Up @@ -669,6 +670,9 @@
/* Send Key event related */
bool m_sendKeyEventThreadExit;
bool m_sendKeyEventThreadRun;
bool m_isAudioStatusInfoUpdated;
bool m_audioStatusReceived;
bool m_audioStatusTimerStarted;
std::thread m_sendKeyEventThread;
std::mutex m_sendKeyEventMutex;
std::queue<SendKeyInfo> m_SendKeyQueue;
Expand All @@ -687,6 +691,7 @@
binary_semaphore m_semSignaltoArcRoutingThread;
bool m_arcstarting;
TpTimer m_arcStartStopTimer;
TpTimer m_audioStatusDetectionTimer;

Connection *smConnection;
std::vector<uint8_t> m_connectedDevices;
Expand Down Expand Up @@ -733,7 +738,7 @@
void Send_Request_Arc_Termination_Message();
void Send_Report_Arc_Terminated_Message();
void arcStartStopTimerFunction();
void getHdmiArcPortID();
void audioStatusTimerFunction();
void getCecVersion();
};
} // namespace Plugin
Expand Down
Loading
Loading