Skip to content

fixed: AOCEC - report physical address changes after a hotplug - #759

Open
Portisch wants to merge 1 commit into
Pulse-Eight:masterfrom
Portisch:fix/aocec-phys-addr-master
Open

Portisch wants to merge 1 commit into
Pulse-Eight:masterfrom
Portisch:fix/aocec-phys-addr-master

Conversation

@Portisch

@Portisch Portisch commented Nov 5, 2026

Copy link
Copy Markdown

The AOCEC adapter reads the physical address only when the connection is opened. When the box boots with the TV off or unplugged, the driver returns F.F.F.F. libCEC falls back to 1.0.0.0 and keeps it after the TV comes up, so the TV does not route its remote keys to the box.

The Amlogic driver does not signal a hotplug on the file descriptor, poll() only reports received messages. This change reads the address with CEC_IOC_GET_PHYSICAL_ADDR each time the existing one second select() returns and calls HandlePhysicalAddressChanged when a different valid address shows up, like the Linux, IMX, RPi and TDA995x adapters do. F.F.F.F is ignored, so a TV toggling hotplug causes no new announcement. As with the Linux adapter, a manually set address is replaced.

Doing this in libCEC fixes it for every client of the adapter, and libCEC already has the callback for it. Reopening the connection from the application instead, for example from Kodi on a display reset or a hotplug, would repeat the full CEC setup each time, with polls, logical address allocation and possibly an active source message.

Tested on a Ugoos AM9 (S905X5, Linux 6.12) connected directly to a TV: boot with the TV off, then switch it on. Before, libCEC stayed at 1.0.0.0 and the TV remote did nothing. With the change it logs "changing physical address to 2000", reports 2.0.0.0 and the remote controls Kodi.

The AOCEC adapter reads the physical address only when it is opened.
When the box starts without a TV, the address is still invalid then,
and libCEC keeps the default address after the TV is connected. The TV
then does not route its remote control keys to the box.
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have accepted the Pulse-Eight contributor agreement. ✅
Posted by the CLA Assistant Lite bot.

@malard

malard commented Nov 5, 2026

Copy link
Copy Markdown
Member

Hi @Portisch, we've just made this simpler: no more signing and emailing a scan. Read the agreement at https://pulse-eight.github.io/libcec/contributor-agreement/ and either press Accept on GitHub there, or reply here with exactly:

I have read the Pulse-Eight Individual Contributor License Agreement, version 2, and I accept it

You only need to do it once, and the check on this pull request will then pass.

@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
2 tasks done
malard added a commit that referenced this pull request Nov 5, 2026
A re-run keeps the workflow settings of the run it repeats, so the check on
a pull request opened before v2 still reads the v1 list. Mirroring the v2
acceptance there lets #759's check pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants