Skip to content

Sony Bravia: User Control "Power" (0x40) on source select suspends an already-on device #744

Description

@DesertRec

Claude has helped me find a solution/workaround.

libCEC 8.1.6 (client version 4.0.0, firmware 5)
Adapter: Amlogic AOCEC
CoreELEC nightly 20260810 (clean install), Kodi 22
Ugoos AM9 Pro (S905X5) → miniDSP Tide16 (HDMI switch/processor) → Sony A90J
Device type: playback device. Physical address auto-detected correctly as 3.1.0.0

Description

Selecting the Kodi box's input on the TV causes the box to suspend instead of activate.

The Sony sends User Control Pressed: Power (0x40) — a toggle — followed ~275 ms later by User Control Pressed: Power On (0x6D). The toggle reaches Kodi as key 196, which the default keymap binds to ShutDown(), and the box begins suspending before the explicit power-on arrives.

Log — default keymap (box suspends)

16:32:33.104  >> 04:44:40
16:32:33.104  >> TV (0) -> Playback 1 (4): user control pressed (44)
16:32:33.105  SetCurrentButton power (40) D:0ms
16:32:33.105  key pressed: power (40) current(ff) duration(0)
16:32:33.105  PushCecKeypress - received key c4 duration 0
16:32:33.105  << Playback 1 (4) -> broadcast (F): inactive source
16:32:33.112  HandleKey: 196 (0xc4, obc59) pressed, window 10004, action is ShutDown()
16:32:33.138  LogindUPowerSyscall: Received PrepareForSleep with arg 1
16:32:33.138  OnSleep: Running sleep jobs
16:32:33.282  >> TV (0) -> Playback 1 (4): user control release (45)
16:32:33.379  >> 04:44:6d
16:32:33.379  >> TV (0) -> Playback 1 (4): user control pressed (44)
16:32:33.379  SetCurrentButton power on (6d) D:0ms
16:32:33.379  making Playback 1 (4) the active source
16:32:33.443  << Playback 1 (4) -> broadcast (F): active source (3100)
16:32:33.455  failed to make 'Playback 1' the active source. will retry later

Workaround — suppressing key 196 resolves it completely

/storage/.kodi/userdata/keymaps/cec-power.xml:

<keymap>
  <global>
    <universalremote>
      <obc59>Noop</obc59>
    </universalremote>
    <remote>
      <power>Noop</power>
    </remote>
  </global>
</keymap>

Log — with keymap (box activates correctly)

16:54:36.637  Changed key power (40) D:0ms cur:ff
16:54:36.637  PushCecKeypress - received key c4 duration 0
16:54:36.637  << Playback 1 (4) -> broadcast (F): inactive source
16:54:36.647  HandleKey: 196 (0xc4, obc59) pressed, window 10000, action is Noop
16:54:36.815  >> TV (0) -> Playback 1 (4): user control release (45)
16:54:36.912  >> 04:44:6d
16:54:36.912  >> TV (0) -> Playback 1 (4): user control pressed (44)
16:54:36.912  SetCurrentButton power on (6d) D:0ms
16:54:36.912  making Playback 1 (4) the active source
16:54:36.912  marking TV (0) as inactive source
16:54:36.912  >> source activated: Playback 1 (4)
16:54:36.976  << Playback 1 (4) -> broadcast (F): active source (3100)

Zero OnSleep events across repeated switching after the change.

Note

In both logs, libCEC broadcasts inactive source the moment 0x40 arrives — before Kodi has dispatched anything. So the toggle is being given power-off semantics internally regardless of current power state. The keymap only suppresses the consequence, not the interpretation. A power toggle arriving at a device that is already on arguably shouldn't be treated as off — the user has just asked to watch that device.

This behaviour started after 8.1.1 (the button-press timing change). Offered as correlation only — I haven't tested a pre-8.1.1 build to confirm.

Unrelated question, same version window: the peripheral settings filename changed from cec_CEC_Adapter.xml to cec__dev_aocec.xml. Is this the name going forward?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions