Skip to content

Debugging CEC

Guo-Rong edited this page Feb 25, 2025 · 1 revision

Trace Output Format (v0.2.3+)

With debug on, a trace of CEC messages can be obtained resembling the following:

[     43509] 00 <- 04: [Image View On]
[     43611] 00 -> 04: [Give Device Power Status]
[     43702] 00 <- 04: [Report Power Status][00]
[     43799] 00 ~> 05: [Give Device Power Status]
[     43892] 05 ~> 00: [Report Power Status][00]
[     43987] 00 ~> 05: [Give System Audio Mode]
[     44080] 05 ~> 00: [System Audio Mode Status]
[     44175] 00 ~> 05: [c3]
  (undecoded)
[     44438] 00 ~> 0f: [Device Vendor ID]
[     44577] 0f <~ 04: [Device Vendor ID]
[     45163] 05 ~> 00: [Give Device Vendor ID]
[     45251] 05 ~> 00: [Get CEC Version]
[     45599] 00 ~> 05: [CEC Version]

As CEC is a shared bus, pico-cec is able to monitor all CEC message traffic. This is akin to 'promiscuous mode' for network interfaces.

Format Explanation

CEC trace messages contain the following fields:

  • timestamp (milliseconds since boot)
  • CEC device logical address
  • Direction and acknowledgement information
    • >: pico-cec received/observed the message
    • <: pico-cec sent the message
  • CEC device logical address
  • CEC message name
  • Per-CEC message details

Trace Dissection

Let's analyse some of the various traces presented above.

Received and Acknowledged Message

[     43611] 00 -> 04: [Give Device Power Status]
  • timestamp = 43611 ms since boot
  • initiator = 00 logical address (the television)
  • ->
    • -: acknowledgement sent
    • >: pico-cec received this message
  • target = 04 logical address (playback 1)
  • CEC message = "Give Device Power Status"
  • Summary
    • pico-cec (on logical address 4) was asked to provide its power status
    • pico-cec acknowledged this request

Sent Message and Received Acknowledge

[     43702] 00 <- 04: [Report Power Status][00]
  • timestamp = 43702 ms since boot
  • target = 00
  • <-
    • < pico-cec sent this message
    • -: acknowledgement received
  • initiator = 04
  • CEC message = "Report Power Status"
    • [00] = power status is 00
  • Summary
    • pico-cec sent its power status of 00
    • the TV (logical address 00) acknowledged receipt

Observed Message

[     43987] 00 ~> 05: [Give System Audio Mode]
  • timestamp = 43978 ms since boot
  • initiator = 00
  • ~>
    • ~: acknowledgement not sent
    • >: pico-cec received this message
  • target = 05
  • CEC message = "Give System Audio Mode"
  • Summary
    • audio system (logical address 5) asked to provide its audio mode
    • pico-cec saw this message, but did not acknowledge it, as it is not the target

Sent Message, No Acknowledge

[     42591] 0f <~ 04: [Device Vendor ID]
  • timestamp = 42591 ms since boot
  • target = 0f (broadcast address)
  • <~
    • <: pico-cec sent this message
    • ~: no acknowledgment was received
  • CEC message = "Device Vendor ID"
  • Summary
    • pico-cec broadcast its vendor ID, no one cared to reply 🙁

Observed Unknown Message

[     44175] 00 ~> 05: [c3]
  (undecoded)
  • timestamp = 44175 ms since boot
  • initiator = 00
  • ~>
    • ~: not the target, did not ack
    • >: received/observed this message
  • CEC message: [c3] not mapped to a human-readable string
    • (undecoded) not yet handled in pico-cec
  • Summary
    • pico-cec observed a message it did not understand