Skip to content

Kernel 5.10. Kodi CEC doesn't work anymore #4148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
micha53 opened this issue Feb 15, 2021 · 14 comments
Closed

Kernel 5.10. Kodi CEC doesn't work anymore #4148

micha53 opened this issue Feb 15, 2021 · 14 comments

Comments

@micha53
Copy link

micha53 commented Feb 15, 2021

Since I made an Raspberry OS buster update, which installed the 5.10 kernel version, my TV remote control does not work with kodi anymore.
The kodi CEC adapter, Verion libCEC 4.0.4 - firmware v1 settings are the default. Physical address is 0, the TV has 1.
Same behavior on rpi3b+ and rpi 4b, acting the remote control only the TV reacts.
After downgrading the kernel to 5.4.50 (actually done on rpi4) CEC works good again.

dmesg.txt
raspinfo.txt
kodi.log
kodi.old.log

pi@Raspi3:~ $ vcgencmd version
Jan 27 2021 22:26:53
Copyright (c) 2012 Broadcom
version 99d9a48302e4553cff3688692bb7e9ac760a03fa (clean) (release) (start)
pi@Raspi3:~ $ uname -a
Linux Raspi3 5.10.11-v7+ #1399 SMP Thu Jan 28 12:06:05 GMT 2021 armv7l GNU/Linux

@micha53
Copy link
Author

micha53 commented Feb 23, 2021

I made a new setup of my system, could reproduce the behavior, making the following steps:

installation of Raspbian buster

Installation of kodi
sudo apt-get update/upgrade
sudo apt-get install kodi

raspi-config:
"Performance Options" -> "GPU Memory" -> 320 MB.
„ Advanced Options“ → „ GL Driver“ → G2 GL (Fake KMS) OpenGL desktop driver with fake KMS
start into CLI

start kodi
settings/skin settings/main menue items-→ selected my interests (music, TV, pictures, videos, favourites)
settings/System/play GUI sounds → never

kodi autostart: /lib/systemd/system/kodi.service:

[Unit]
Description = Kodi Media Center
After = remote-fs.target network-online.target
Wants = network-online.target

[Service]
User = pi
Group = pi
Type = simple
ExecStart = /usr/bin/kodi-standalone
Restart = on-abort
RestartSec = 5

[Install]
WantedBy = multi-user.target

sudo systemctl enable kodi.service

Included Harddisk:
sudo apt-get -y install ntfs-3g hfsutils hfsprogs exfat-fuse
sudo mkdir /media/pi
sudo mount -t ntfs-3g -o utf8,uid=pi,gid=pi,noatime /dev/sda1 /media/pi

sudo nano -w /etc/fstab
appended
UUID=<my HD's uuid> /media/pi/ ntfs-3g utf8,uid=pi,gid=pi,noatime 0

Tested Kodi with the harddisk.

Until here CEC within kodi was working like expected.

Then TvHeadend installed:
sudo apt-get install tvheadend

Then I shut down my system and made a backup of my SD-card.

Since the next start of my system CEC does not work anymore with kodi. Behavior is like described above.

@popcornmix
Copy link
Collaborator

Are you saying it was installing tvheadend that caused the issue?
Or rebooting? Or backing up?

@micha53
Copy link
Author

micha53 commented Feb 23, 2021

None of them. In my old system I got the problem with an update to kernel 5.10, but I could not reproduce exactly what I've done before. That is why I documented now what I've done with a new setup till the error occured again. Rebooting or backup I can't believe that it is the reason. Tvheadend, the server... ??? I am going to ask somebody who has the same Issue if he has installed tvheadend.

@wagnerch
Copy link

wagnerch commented Feb 24, 2021

It's not related to tvheadend. It's fairly reproducible on 5.10.11 kernel by:

  1. turn off TV
  2. shutdown kodi (runs via service: sudo systemctl stop kodi)
  3. start up kodi (runs via service: sudo systemctl start kodi)
  4. TV will turn on, and CEC doesn't work.
  5. If you restart Kodi, with TV on, CEC works.

This is on a Pi4B, 5.10.11 kernel, Kodi 18.9.

NOTE: Never noticed this problem before on 5.4.x kernels, but I also rarely use CEC. It's usually when I accidentally pick up the TV remote.

@wagnerch
Copy link

wagnerch commented Feb 24, 2021

Another thing is if you start "cec-client -m" that totally hoses up CEC with Kodi. Not really sure if that is supposed to work or not and no idea if that was an issue under 5.4, never used cec-client before or tried, was just seeing if there was anything more useful I could include here.

@popcornmix
Copy link
Collaborator

popcornmix commented Feb 24, 2021

Another thing is if you start "cec-client -m" that totally hoses up CEC with Kodi. Not really sure if that is supposed to work or not

You can't run cec-client when kodi is running (which also uses libcec).
e.g. Pulse-Eight/libcec#123

@popcornmix
Copy link
Collaborator

It's not related to tvheadend. It's fairly reproducible on 5.10.11 kernel by:

It's pretty unlikely this is related to kernel. Without kms driver, cec is purely implemented by userspace library (libcec) and firmware code (which acts as a dumb serial interface for cec commands).

@micha53
Copy link
Author

micha53 commented Feb 24, 2021

It's pretty unlikely this is related to kernel.

I agree. Could reproduce the behavior outlined by wagnerch.
Does anybody know, where to direct this issue for an improvement?
I'll wait a day for an answer, but close this issue here tomorrow evening.

@wagnerch
Copy link

wagnerch commented Feb 24, 2021

Does anybody know, where to direct this issue for an improvement?
I'll wait a day for an answer, but close this issue here tomorrow evening.

Unless I missed something here, didn't you indicate above that there is no issue under 5.4, and upgrading to 5.10 that CEC no longer works? I am not sure how this isn't kernel related, I recall seeing a post that indicated CEC under RPI was implemented in vchiq. Isn't that in the kernel and a rewrite as a part of 5.10?

Edit: I re-read the response, it sounds like you re-tested on a fresh install for 5.10 and it is working fine. Bummer, anyways thought my experience could help but it looks like not.

@wagnerch
Copy link

Another thing is if you start "cec-client -m" that totally hoses up CEC with Kodi. Not really sure if that is supposed to work or not

You can't run cec-client when kodi is running (which also uses kodi).
e.g. Pulse-Eight/libcec#123

I figured it was something along those lines, thanks.

@wagnerch
Copy link

wagnerch commented Feb 24, 2021

It's pretty unlikely this is related to kernel. Without kms driver, cec is purely implemented by userspace library (libcec) and firmware code (which acts as a dumb serial interface for cec commands).

Unfortunately, I am not willing to go back to 5.4 to verify the issue. :) It doesn't bother me enough, so I can live with it. I use a HID device for Kodi anyways.

At least for me the issue is only if Kodi is restarted while the TV is off, but it sounds like the OP issue is it just doesn't work at all and not quite sure what was broken there.

@micha53
Copy link
Author

micha53 commented Feb 25, 2021

didn't you indicate above that there is no issue under 5.4, and upgrading to 5.10 that CEC no longer works? I am not sure how this isn't kernel related,

it seemed to be so and one post #2 from Nachteule here caused me to open this issue here.
But your post directed me to a subject I had not considered before and I could reproduce your description. CEC on kodi works fine if I give attention to your recommendation. So far your experience was helpful for me.

If I think about it also becomes clear. The TV must redirect the remote control to kodi. How shall it do that if it is still switched off - or not fully booted!
May be the libcec should poll the TV if it is ready to communicate before trying to send commands. I do not know how libcec communicates with the TV.

I close this issue now and turn to the Pulse-Eight/libcec Discussion.

Thanks to all for taking the time for this discussion. Nevertheless it was helful for me.

@micha53 micha53 closed this as completed Feb 25, 2021
@mriscoc
Copy link

mriscoc commented Nov 21, 2021

I think than maybe there is a problem with CEC and fake KMS, I got the same problem when trying to configurate a VNC service using the script: https://github.com/raw/MarkusLange/VNC-Server-install-script-for-OSMC/master/osmc_vnc_install_cli.bash

@popcornmix
Copy link
Collaborator

Probably best asked on osmc forum. It doesn't sound like your issue is related to this (closed) issue.

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

No branches or pull requests

4 participants