Skip to content

Feature/p3i cec overhaul#70

Open
swmarks wants to merge 1 commit into
pannal:coreelec-21from
swmarks:feature/p3i-cec-overhaul
Open

Feature/p3i cec overhaul#70
swmarks wants to merge 1 commit into
pannal:coreelec-21from
swmarks:feature/p3i-cec-overhaul

Conversation

@swmarks

@swmarks swmarks commented Jul 2, 2026

Copy link
Copy Markdown

This adds a patch for Kodi that fixes several CEC routing bugs and reorganizes the CEC settings UI.

CEC Logic Fixes:

  • Modified the CecCommand parser logic in CPeripheralCecAdapter. Previously, Kodi only went into standby if the command explicitly originated from CECDEVICE_TV. We expanded this logic to also trigger OnTvStandby if the standby command was destined for CECDEVICE_TV or CECDEVICE_BROADCAST.
  • Modified the logic to track the active source state by utilizing a flag file in /run/kodi_cec_startup_done. The reasoning behind this implementation is to maintain a persistent active source variable that survives through Kodi crashes or restarts. Kodi now reliably knows if it is actually the active source on the TV before it blindly issues CEC wakeup or shutdown commands.
  • Decoupled active source routing on OnPlay from the startup broadcast setting, and tied it to a newly renamed "Switch source to this device on activity" setting.
    • New setting also reacts to remote button presses from, e.g. Bluetooth, IR, and network remotes.
  • Added a guard to ignore OnActionPre CEC remote events while the screensaver is active, ensuring stray remote keypresses don't artificially trigger the CEC spam throttle and block the screensaver from properly waking the TV upon dismissal.

UI Overhaul:

  • Logically grouped settings together by function (e.g. grouping power-down triggers together in the CEC settings menu).
  • Rewrote some UI labels to be clearer.
  • Fixed a tinyxml2 parsing bug in Peripherals.cpp that was preventing settings from displaying in the correct order. This bug likely would have affected any peripheral service that happened to be available, not just CEC.

Note: This PR also removes kodi-999.15-disable-using-tv-menu-language-by-default.patch, as the massive UI overhaul of system/peripherals.xml natively incorporates the use_tv_menu_language default value change and completely reorganizes the file layout, rendering 999.15 obsolete and a source of hard conflicts.

@swmarks swmarks force-pushed the feature/p3i-cec-overhaul branch 4 times, most recently from 56749ca to 1306471 Compare July 3, 2026 14:39
@samtheruby

Copy link
Copy Markdown
Contributor

is this compatible with my PR or does one of ours need re-working?

@swmarks swmarks force-pushed the feature/p3i-cec-overhaul branch from 1306471 to 707bf0f Compare July 4, 2026 00:01
@swmarks

swmarks commented Jul 4, 2026

Copy link
Copy Markdown
Author

is this compatible with my PR or does one of ours need re-working?

Yep, this PR exists in parallel with yours. I think it could possibly be merged without yours, but I don't see any reason to do that. I tested with your commits applied.

@swmarks swmarks force-pushed the feature/p3i-cec-overhaul branch from 707bf0f to 8bb4d11 Compare July 5, 2026 00:13
@samtheruby

Copy link
Copy Markdown
Contributor

Maybe it's just me, but at this point I feel like this should be an actual code change rather than a patch. Correct me if I'm wrong, but aren't patches generally intended for small fixes, rather than adding this many lines all of code at once?

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