RDKECOREMW-1166 : handle not supported hal implementation causing high cpu utilization#41
Conversation
…https://github.com/rdkcentral/hdmicec into feature/RDKECOREMW-1166-handle-not-supported-halimpl
There was a problem hiding this comment.
Pull request overview
This PR addresses high CPU utilization (100%+) on devices where the HAL (Hardware Abstraction Layer) does not support CEC. The fix moves polling thread initialization from the Bus constructor to the init section and adds comprehensive exception handling when HAL calls fail.
Key Changes:
- Added try-catch blocks in
LibCCEC::init()to handle exceptions from driver initialization, particularlyOperationNotSupportedException - Enhanced error handling across all HAL API calls in
DriverImpl.cppto throw specific exceptions based on error codes rather than generic IOExceptions - Deferred Bus thread startup from constructor to
Bus::start()method to prevent polling on unsupported hardware - Fixed typo and removed trailing whitespace
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ccec/src/Util.cpp | Fixed typo in error message ("filee" → "file") and cleaned up trailing whitespace |
| ccec/src/LibCCEC.cpp | Added exception handling in init() to catch and propagate HAL errors, preventing thread startup on unsupported hardware |
| ccec/src/DriverImpl.cpp | Enhanced all HAL API calls with comprehensive error handling that maps specific error codes to appropriate exceptions |
| ccec/src/Bus.cpp | Removed thread startup from constructor; added comments explaining deferred initialization strategy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 27 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reason for Change: on a CEC not supported HAL; middleware component is causing high CPU utilization (100%+) due to frequent poll process. This change addresses that by moving polling threads into an init section from contructor and reporting exception when hal call fails. In the upper layer these exceptions gets handled gracefully
Related: rdkcentral/entservices-inputoutput#308