v19 RPi4: libCEC config updates destroy working cec config and polls for invisible TV dev - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228) +---- Thread: v19 RPi4: libCEC config updates destroy working cec config and polls for invisible TV dev (/showthread.php?tid=369039) |
RPi4: libCEC config updates destroy working cec config and polls for invisible TV dev - grv0815 - 2022-07-24 Hi Experts, I'm fiddling around with a a very simple Kodi configuration: There is one old beamer - which does not have any CEC functionality -, a soundbar, and the RPi4 with Kodi. All three devices are turned on together with one switch. Beamer and RPi4 starts and the sound bar goes into standby - so I try to wake the device with CEC. The Problem is, that Kodi's CECAdapter always change the baseDevice from "Amplifier/Receiver" back to "TV" and the remains into standby on the next boot. The log file - with CEC debug messages - showes, that the CECAdapter poll around every second for the hidden/nonCEC TV device: CecLogMessage - << Recorder 1 (1) -> TV (0): POLL CecLogMessage - << 10 CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=24 len=1 addr=10 opcode=ffffffff CecLogMessage - << 10 CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=24 len=1 addr=10 opcode=ffffffff CecLogMessage - >> POLL not sent PhyAddr LogAddr 0.0.0.0 0 (TV) <---- this old device does't responce to any CEC message. 1.0.0.0 5 (Audio) 1.1.0.0 1 (Recorder/KodiRPi4) Does anyone know a solution for this problem? Otherwise I have to turn off CEC at all and turn on the soundbar with the cec-client in autostart.sh - loosing the common remote control. It seems to be a kind of mixing up the terms configuration and state. The first should be persistent, the second can change. Thanks for all kind of respond! RE: RPi4: libCEC config updates destroy working cec config and polls for invisible TV dev - grv0815 - 2022-08-04 My first guess, the missing CEC functionality of the old beamer, seems to be not the real problem. Remember: Each small problem contain a big one, that will break out. The sound bar has an option to loop through HDMI signals even in standby mode. If I deactivate this function, all components work as designed - but ... ... but the beamer has no signals until libreelec and kodi ist startet and the CEC-adapter turn on the AVR. No nice splash screen, only a "blue screen" with a "No Signal" warn message. That's no option, at least for me. I have found a workaround by writing this small script stored as /storage/.config/persist_cec_cfg.sh and start it by the libreelec autostart.sh script in blocking mode (no & at the end): add to autostart.sh: ( /usr/bin/sh /storage/.config/persist_cec_cfg.sh ) persist_cec_cfg.sh: !/bin/sh CFGDIR=/storage/.kodi/userdata/peripheral_data CFGFILE=cec_CEC_Adapter.xml PERSIST=persist_ if [ -e "${CFGDIR}/${PERSIST}${CFGFILE}" ]; then # if there is a persistent cfg file, copy this over the normal cfg file cp "${CFGDIR}/${PERSIST}${CFGFILE}" "${CFGDIR}/${CFGFILE}" else # a missing persistent cfg file signals a change in the cfg, so create a new one from the cfg file cp "${CFGDIR}/${CFGFILE}" "${CFGDIR}/${PERSIST}${CFGFILE}" fi The script simply create a persist copy of the initial configuration and write this configuration back befor kodi starts. If I want to make changes, I only delete the persist copy, configure the CEC-adapter in the GUI and reboot before the libcec/adapter can change it. On startup, script find no persist configuration and create a new persistent copy of the desired adaper settings. This workaround works with the sound bar loop through, the splash screen and the kodi splash screen are displayed, and when the CEC-adapter something later turn on the sound bar, the screen gets dark until the new routing is established. My RPi4 box is already packed and I will not start over again, but ... ... the user thedogg has found - with the help of user HiassofT - an even more elegant way to solve the same problem in the libreelec forum. See this thread: HDMI Passthrough RPi4 - AVR detection The tricky thedogg has simply plugged the sound bar on the second HDMI port, and HiassofT help th create an EDID file for the AVR. Well done! Update: By now, you can use the getedid command on the actual RPi libreelec 10.x and need not the manual steps shown in #7. Well done, too! |