I ran Raspberry Pi 2 model B for a log time with a python script that reads events from CEC (a modified LibCEC Python example) and reacts on them, Kodi worked fine, no issues with that. I switched to Vero4k, but when I run the same script, it now eats most of the key clicks from the remote (over HDMI/CEC) - the Kodi does not get the events and does not want to react on most of them.
The script stops Kodi playing the TV (from tvheadend) when the TV shuts-down and pauses the non-TV playback when the TV switches to a different source.
Unfortunately that did not work, the TV sends more TV remote keys when on profile Recorder. Using profile Player did not fix anything.
I updated the python script to log debug messages from libCEC and tested it on RPi and Vero4k. Result from running ./cec-watcher.py -c | tee cec-watcher.txt 2>&1 on Raspberry Pi (HDMI2 port) and Vero4k (HDMI1 port).
The Vero4k version contains some write failures, so this might influence the CEC handling - Vero4k does not recognise there is another Recorder 1 and re-assigns logical address Recorder 1 instead of using Recorder 2. Also I checked the 4.9 kernel source code and AMLogic CEC looks more in shape (i.e. looks like having some communication fixes) there when compared to the current 3.14.xx version.
Here is dmesg and dpkg -l output (just to be sure I have correct packages). With stopped Kodi, the result is identical and stand-alone cec-client (no arguments) test shows exactly the same write errors in the console output - path is /dev/aocec, which is kernel. There is nothing regarding write error in dmesg.
The output of cec-client looks reasonable – I think a POLL will sometimes fail until the LA is established. If you stop Kodi, and put cec-client in monitoring mode, can you pick up the events you’d like to monitor (TV standby)?
Do you plan to use CEC with Kodi? I ask because currently only one handle is possible on /dev/aocec at a time. I will see if we can adjust this as we did for Vero 1 (2015).
I’ve merged some fixes from AMLogic (SoC vendor) and have prepared a test build.
I’d appreciate it if you could test this and provide feedback before we potentially release this as an update to other users. To test this update:
I have no action set on this and according to xbmc/peripherals/devices/PeripheralCecAdapter.cpp, there is no event sent in case nothing is being configured. Additionally I need to react on source switch, so the possibility is to change the method CPeripheralCecAdapter::CecCommand somehow to allow interactions from plugins.