Skip to content

fix: recover CEC and guard inactive source for DP > HDMI Adaptors#2

Draft
xXJSONDeruloXx wants to merge 1 commit into
mainfrom
active-source-guard
Draft

fix: recover CEC and guard inactive source for DP > HDMI Adaptors#2
xXJSONDeruloXx wants to merge 1 commit into
mainfrom
active-source-guard

Conversation

@xXJSONDeruloXx

@xXJSONDeruloXx xXJSONDeruloXx commented Jul 20, 2026

Copy link
Copy Markdown
Member

this fixes two related CEC issues on systems using a dGPU DisplayPort path with an active DP to HDMI adaptor (possibly also with pulse8 adaptor under input-attach as well), tested on an HTPC a 9070 XT and a green active DP > HDMI adaptor.

with upstream, after system resume the CEC device / connector state can still be settling when cecd starts normal wake traffic. that showed up as intermittent early CEC NACKs and unreliable source assertion. upstream also sends Inactive Source before deciding whether to send Standby. with my TV that can briefly put the TV to sleep and then immediately route it back to its previous HDMI input instead of leaving it asleep.

this PR makes a few minor changes to mitigate the inherent timing issues active DP dongles introduce to the stack:

  • on a real system resume, reconfigure the CEC device and poll the TV before normal resume traffic; retry up to five times, one second apart, when either step is not ready yet (open to changes or feedback in retry count or spacing)
  • wait 100 ms between Image View On and Active Source, avoiding the early post-resume source assertion race seen on the active adaptor path
  • if the PC is the active source and suspend_tv = true, send Standby only (fixes re-wake and switch to previous source on my tested TVs, do let me know if this is too opinionated or a config value here is justified)
  • if the PC is not the active source, do not send either Inactive Source or Standby, so suspending the PC does not disturb whatever the TV is currently showing (mirrors upstream, now explicit given the new case above)
  • if the PC is active but TV standby is disabled, still send Inactive Source to release the source
  • forced standby still sends Standby

Testing:

  • pc awake and tv showing hdmi 3: suspend actually powers the tv off; on pc wake the tv comes back directly to hdmi 3 with the pc picture (the upstream unconditional Inactive Source behavior briefly put the TV to sleep and then snapped it back to HDMI 1. this standby policy change fixes that)
  • TV manually switched to HDMI 1 while the PC remains awake on HDMI 3: PC suspend leaves the TV awake on hdmi 1; PC wake intentionally switches it to HDMI 3 with wake_tv = true

BONUS: testing w pulse8 hdmi adaptor:

this one is a bit of a different case, instead of exposing /dev/cec0 directly, this device plugs into the usb port of the motherboard, and appears as ttyACM1.

testing only the changes here for cecd, I do see the positive fix for suspend behavior. upstream on pc suspend will sleep TV briefly and then wake it back to previous source, but with patched policy tv sleeps as expected.

on pc wake while tv is suspended, its currently not waking tv and switching to correct input, because the inputattach unit restarts but kernel prob seems to time out, so no /dev/cec0 gets bound and cecd deregisters

fix will be needed separately for the wake and bind path in https://gitlab.steamos.cloud/holo/inputattach-cec-units/-/tree/main?ref_type=heads or a mirror for OGC

@xXJSONDeruloXx xXJSONDeruloXx changed the title cecd: recover CEC and guard inactive source fix: recover CEC and guard inactive source for DP > HDMI Adaptors Jul 20, 2026
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.

1 participant