CEC not working

No one holds you back to improve the amlogic CEC implementation in 4.9 kernel. :slight_smile:

i would if i could, but i guess until i am in all that material and understood how to change and what to change, we have linux 8 and the devices are outdated :wink:
when i understood you correctly, this is some kernel code which is from amlogic. so the best candidate to contact (to get a bug ticket and/or help fixing that) would be amlogic?

My 2 cents. N2 HDMI to Media Player input on Denon X220W. Denon ARC out to Vizio P75 ARC input. Harmony Hub and remote programmed. When I hit TV button on harmony, TV only, N2 is off. When I hit Movie button on harmony remote, N2 wakes up. When I shut off, N2 says nitey-nite.
However I do have a problem (had with Libre board LePotato also. Screen goes black for 5-10 seconds whether watching something or just looking at Aeon Nox menu. Somehow I think it’s a handshake issue. Ordered new HDMI cable to check.

Logitech Harmony is an infrared remote and has nothing to do with CEC / HDMI, isn’t it?

Yes, if you have a Logitech Harmony IRC and you have programmed some activities then they need to turn off CEC.

I had a look to the Linux kernel CEC driver and found maybe a issue.
So here is a test build. It can be used for all Amlogic-ng devices, not only N2!
Maybe it resolve some CEC & Kodi issues!

  1. CoreELEC-Amlogic-ng.arm-9.2-devel-1569483170.tar

Changes:

"hardcode" default bootloader CEC setting to 0x3f
Do not touch received messages if address is not enabled.
  1. CoreELEC-Amlogic-ng.arm-9.2-devel-1569495571.tar

Changes:

"hardcode" default bootloader CEC setting to 0x3f
Do not touch received messages if address is not enabled.
Enable rx buffer on all CPUs

Please have a try first with nr 1, then nr 2 if still problem are existing!
This changes will have no affect to any wake-up issues!

EDIT:
About the Couldn't initialize the CEC adapter issue:
On kernel boot the CEC hardware driver aocec get loaded.
On Kodi start libCEC get loaded what is trying to open the driver aocec.
If it got opened it will send F0 by the CEC bus to ping if a TV is connected.
If now no reply is received the known Pule-Eight error pop up will be shown.
So the main reason of this can be, that the initialization is just too fast. Especially if a AVR is connected between the box & TV. When the AVR isn’t ready to forward the message between box & TV the system will not work.
So I guess this high amount of CEC issues seen by the users are related to this change:
Since G12(A/B) CECB is used. The big difference to the “old” CEC system in the SoC is the interrupt handling. So the handling between software & hardware got faster now and maybe Kodi and/or libCEC need to be adapt for this.

EDIT2:
I was digging really deap now in the Kodi & libCEC source about this issue and it is almost impossible to find a solution for me as the source is quit complicated.
The best way to solve your Couldn't initialize the CEC adapter issue:
Enable debug in Kodi and enable debug logging for the libCEC component.
Ask at http://libcec.pulse-eight.com/ for support.

Another “workaround” would be to delay the libCEC init on Kodi startup about ~5-10s until the hardware is ready for communication.

Thanks so much for your efforts on this. In my case (using S905x2 X96 max 4g/32g box), the “couldn’t initialize CEC adapter” message happened nearly 100% of the time. Then I upgraded the Android firmware from Oreo to Pie and also turned on, off and then on again the HDMI-CEC setting in Android first. Since then, I’m getting about 80-90% success rate with initializing CEC.

I’ll give your images a try and let you know. Thanks again!!

Also please enable debug logging in Kodi and add the libCEC component, please!

A very quick test (I’ll run with debug later this evening if I can).

The nr-1 image failed to initialize the CEC adapter. I then tried nr-2 and so far it has been 4 out of 4 successful reboots - some with TV already on and TV off.

I’ll stick with nr-2 for now - it looks good so far. Do you still want debug logs??

Again - many thanks for your time and effort!

Really? Didn’t expect that :wink:

First 2 test images:

Here another test version n3!
It have added a hardcoded sleep of 30 seconds before the CEC adapter get initialized!
So please if nr 2 isn’t working try this test version!

  1. CoreELEC-Amlogic-ng.arm-9.2-devel-1569509352.tar

Changes:

"hardcode" default bootloader CEC setting to 0x3f
Do not touch received messages if address is not enabled.
Added hardcoded sleep of 30s before adapter initialize

nr 2 still working 100% for the S905x2 x96 max 4g/32g box here. One good change I also noticed is that when I power off the S905x2 box now, the HDMI source switches automatically to the TV source (before your change it did not do that).

One question - and AFAIK it has always been this way with this kernel - If I power off the TV with the TV remote, the CE box also powers off (good - controlled by CEC settings in CE). If I then power on the TV with the TV remote, the CE box also powers on - with older versions of CE and LE, powering on the TV had no effect on the CE box. If I wanted to turn on the CE box and TV, I would use the power on the CE remote.

I could not find a setting in CEC in CoreELEC to control this - am I missing something here? I would not expect the CE box to power on if I use the TV remote power button - I would expect just the TV to power on.

Thank you very much for your efforts @all. Unfortunately, on an Odroid N2 --> Marantz AVR --> Philips TV even with 30 seconds delay: Could not initialise…

http://ix.io/1X4v

And nr 1 or nr 2?

N2 as well as N3 not working. N1 not tested so far. Is it worth it?

Please enable debug log in Kodi & enable the libCEC component too for logging!
Restart your N2 and after the pop up appeared open a SSH connection and enter:
cat /storage/.kodi/temp/kodi.log | paste
You will get a link to the uploaded debug log.

I have done another extra debug version:

If you get problem with the pop up (Couldn't initialize the CEC adapter) shown in Kodi please use this debug image. This update image is only to get a CEC debug log.

After update wait until you have seen the pop up in Kodi. Open a SSH connection and enter:

dmesg | grep cectx | paste

and post the resulting http link and a small description about the hardware setup.
Like box (N2) & AVR yes/no & TV brand.

Sorry for the delay. I fell asleep :slight_smile:

With the version you provided yesterday, “cat /storage/.kodi/temp/kodi.log | paste” brings

http://ix.io/1X93

“dmesg | grep cectx | paste” brings

http://ix.io/1X95

EDIT: Odroid N2 --> Marantz AVR --> Philips TV

Thx, I see the issue now!

It’s a CEC hardware issue of the SoC. As there is no register description available I don’t know how to fix it. I will take a look next week.

[   14.517904@5] cectx ff80023c.aocec: hdmitx_cec_write: size: 1
[   14.549776@4] cectx ff80023c.aocec: CEC tx msg len 1: f0
[   14.553647@1] cectx ff80023c.aocec: warning:ARB_LOST
[   14.554641@1] cectx ff80023c.aocec: warning:FOLLOWER
[   14.765304@1] cectx ff80023c.aocec: CEC tx msg len 1: f0
[   14.769439@1] cectx ff80023c.aocec: warning:ARB_LOST
[   14.770198@1] cectx ff80023c.aocec: warning:FOLLOWER
[   14.937027@4] cectx ff80023c.aocec: CEC tx msg len 1: f0
[   14.940917@1] cectx ff80023c.aocec: warning:ARB_LOST
[   14.940940@4] cectx ff80023c.aocec: hdmitx_cec_write: size: 1, ret 2

This log show a transfer (ping) of the box to the TV. But it fails after 3 unsuccessful attempt.
It fails by ARB_LOST. If no client (TV) is connected with node id 0x0 it should show a not acknowledge or an acknowledge if the TV is connected. But ARB_LOST shows a CEC bus problem.

1 Like

@Portisch can your work on CEC be added to the Vim 3 builds? On my Panasonic tv I don’t get the CEC initialisation error but CEC doesn’t work as it should. When I change source to vim3 initially CEC doesn’t work but then normally after start playback it starts to work. If you would like me to test any build I would be happy to
Thanks