RDKDEV-1424 Add HDMICEC Documentation - #60
Merged
Conversation
Add detailed documentation for HDMI CEC library including features, design, and configuration.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a comprehensive top-level README documenting the HDMI CEC middleware library in the RDK stack, covering architecture, threading model, initialization/state flows, HAL integration, and runtime configuration.
Changes:
- Introduces new
README.mdwith detailed component overview, design notes, and module breakdown. - Adds multiple Mermaid diagrams for system positioning, internal architecture, and call flows.
- Documents build/runtime dependencies and configuration (e.g., log level via
/tmp/cec_log_enabled).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (8)
README.md:61
- The Design section says the reader thread "continuously polls" the driver, but in the implementation
DriverImpl::read()blocks onrQueue.poll()(condition variable wait) until a frame is available. Rewording avoids implying a CPU-intensive polling loop.
The HDMI CEC component implements a layered architecture that separates bus management, protocol handling, and hardware abstraction. At the core is the Bus singleton which manages the CEC communication channel through dedicated reader and writer threads. The reader thread continuously polls the driver for incoming frames and dispatches them to registered listeners, while the writer thread processes an event queue of outgoing frames. This design ensures non-blocking operations and meets CEC protocol timing requirements.
README.md:199
- In this state-flow sequence diagram,
init()is shown as setting the initialized flag before the driver/bus start. In code (ccec/src/LibCCEC.cpp),initialized = trueis set only afterDriver::open()andBus::start()succeed. Adjust the diagram text to match the actual ordering.
LibCEC->>LibCEC: Set initialized flag / set log prefix / read /tmp/cec_log_enabled
README.md:224
- This runtime loop note says the reader "polls" the driver, but the receive path blocks (EventQueue::poll waits on a condition variable). Wording it as "waits" avoids implying busy polling.
Note over Reader: Poll driver for frames
README.md:382
- The message-reception sequence describes the reader as "polling" and the driver as "Poll rQueue", but
EventQueue::poll()blocks; it’s not a busy poll. Reword these steps to reflect the blocking wait semantics.
Note over Reader: Reader thread polling
Reader->>Driver: read(frame)
Driver->>Driver: Poll rQueue
README.md:407
- This note says the reader will "Continue polling" for frames, but the implementation waits (blocks) for the next frame. Reword to avoid implying CPU polling.
Note over Reader: Continue polling for next frame
README.md:499
- In the event-notification flow, "Reader thread polls" is misleading because the reader blocks waiting for frames (via
Driver::read()andEventQueue::poll()). Reword to match the blocking behavior.
Lib->>Lib: Queue frame, Reader thread polls
README.md:534
- This implementation detail says the reader thread "polls"
Driver::read(), butDriver::read()blocks on the receive queue. Updating the wording will make it consistent with the actual blocking implementation and earlier explanations.
- **Event Processing**: Reader thread polls Driver::read() in a continuous loop. Driver::read() blocks on rQueue.poll() until a frame is available. When a frame arrives via DriverReceiveCallback, it's offered to the queue. Reader locks rMutex and iterates through all FrameListener instances calling notify() synchronously. No explicit event queue for received messages - dispatch happens immediately in reader thread context. Writer thread blocks on wQueue.poll() waiting for frames to transmit.
README.md:282
- In this initialization call-flow diagram, the
initialized = trueassignment is shown inside the early "Not yet initialized" block, but in code (LibCCEC.cpp)initializedis set only at the end ofinit()after the driver is opened and the bus is started. Update the diagram step to avoid implying the flag is set before startup completes.
alt Not yet initialized
LibCEC->>LibCEC: Set initialized = true
LibCEC->>LibCEC: Set log prefix
end
apatel859
approved these changes
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDKDEV-1424
Added documentation for HDMI CEC library including features, design, and configuration.
I have read the CLA Document and I hereby sign the CLA