Hi HiassofT
Some background on why I'm interested in following this through probably in order.
Note: I did laugh at the comment "CEC is pretty much voodoo to me...!" - so true.
I have the following AV equipment:
- Panasonic Viera TH-50PX600A
- Sony STR-DN1040
- Intel® NUC Kit NUC6i5SYH with "Intel NUC HDMI-CEC Adapter" (LibreElec Matrix)
- Apple TV 4K
- Cisco Webex Room Kit (experimenting / WfH)
- BrightSign CV-UHD2 / CV-HD2 (experimenting)
- Elgato 4K60 S+ / HD60 S (experimenting)
- Xbox 360 S (no CEC support)
I have the following home automation: Apple HomeKit, Apple HomePods, Hue Lighting, Homebridge (experimenting with openHAB).
The lighting works well - the rest ..., leave that unsaid.
I have had a love hate affair with the CEC in Kodi and AppleTV.
I was excited to purchase the HDMI-CEC adapter in 2018 (but that was short lived... - as below)
- The AppleTV sends a power on (but the Panasonic ignores it - CEC bug / non standard) - so the TV is always on. The Sony AMP changes itself to the AppleTV HDMI input.
- The Kodi generally misbehaves.
a) (Given my "Panasonic BUG" - that I would like to teach Kodi to send the following codes 80:44:40,80:45) as it already is successful in "power off" the Panasonic - thus I need to find the Panasonic Remote Control .
b) Kodi loves to own the CEC network and when the Sony AMP decides to power off - due to no Audio. Kodi will decide to Turn the AMP back on.
c) On swapping to AppleTV - Kodi does not honour the CEC commands always and switches back to Kodi. We then go and power Kodi off
d) When the remote control menu item <play> is pressed on the iPhone remote - the AMP does not switch on/nor does the input on the AMP change. The Apple TV using the Remote contol does power on the AMP and change the input (think Kodi should too.)
I had a look at: GitHub - joshjowen/script.json-cec: cec control for xbmc/kodi (to put some scripted workarounds in), but it does not allow arbitary CEC codes to be pushed. As Kodi owns the the CEC device entirely, I can't write a script to fix/workaround my issues. If I tell kodi to not enable CEC, then I can use cec-client to fix some of my issues.
The Sony AMP doesn't really automate very well either, though the codebase - GitHub - balert/Sony-STR-DN840-Remote-Python: Control your STR-DN840 receiver via the network interface. does work.
I have worked on a state machine diagram of what I want to happen so that this can be configured in to the home automation. But without the ability to issue CEC commands - I have reached the "unhappy - it does not work state."
Options as I see it:
1 - Use the kernel framework (same as #1 - but with no required code change)
2 - Have passthru access through Kodi to CEC (Changes to Kodi/script.json-cec/libcec)
3 - Disable Kodi CEC and hack with cec-client
4 - Develop functionality (addon) in Kodi - haven't really investigated - relies on #1 in some way
5 - Buy a dedicated CEC device
6 - Buy a new TV (and hope it works right - hi risk - what is works right)
7 - Give up --> - as I actually like my "pet project"
The actual Panasonic BUG - Power On does not work:
Panasonic Viera TH-50PX600A - Power On does not work · Issue #511 · Pulse-Eight/libcec · GitHub (not fixed in libcec - I don't see it being fixed by pulse8 anytime in the near future)
Need to send the following to make it work:
In my case: (Playback 2 —> TV)
80:44:40
80:45
In my enterprise office work environment we toy / flirt with "AV Control Systems" - and most of the time they are broken in their own special way. We have been successful with end-user devices like Cisco Webex hardware mostly with wireless screen sharing. But continue with the usual issues using HDMI extenders and the like. Recently been looking at Wyrestorm, rticorp.com, Cisco Video to simplify AV in the office and standards based AV/IP. I guess - what does this have to do with the /dev/cec0 discussion - I'm looking to have a working Home Automation system and the Kodi CEC configuration as-is doesn't allow for that. Overtime and if I can get my state-machine automation fully correct and working well - it might be that #4 could be done on either the built in CEC or as a addon.
Hope the above helps my case.
I do understand the support issue that you have mentioned though and would not at all propose to move from the userspace integration - it is good to have pulse8 looking after that codebase. My question to this - is that we are already supporting the Kernel interface for the other hardware (note: I don't disagree that linux-console is an additional product though.)
Regardless of the core teams decision to change the way for everyone, I would like to continue down the route of using cec-ctl for the moment, even if I have to maintain a separate branch/autstrat.sh commands. I would appreciate you pointing me in the right direction to add the build of linux-console into my branch though (so that it was buil;t properly.)
**Note: Without implementing my proposed systemd/udev changes - Kodi Generic would continue to use the /dev/ttyACM0 mechanism. The Kernel Framework is only ever activate if the modprobe and inputattach are run.
Thanks for your consideration.