CEC in Debian does not work what did we miss?

We have installed Rock Pi 4 with Debian Desktop from the download page https://wiki.radxa.com/Rockpi4/downloads . The image was played with Rufus 3.4 on a 32GB SD card.

  • Version on installation: Debian Stretch 9.9

  • Kernel on installation: 4.4.154-90-rockchip-ga14f6502e045

  • Basic updates have been carried out

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

  • Kernel is dist-upgraded to version 4.4.154-91-rockchip-g70838c09a6b6 after dist-upgrade

  • According to kernel list there is no more current kernel

Kernel List: sudo apt-cache search linux-image

  • CEC client and dependencies were installed with sudo apt-get install cec-utils

libCEC Version: 4.0.2

  • CEC was tested on the same CEC-enabled monitor as libreELEC with the commands:

(The Rock Pi 4 was first tested with libreELEC for CEC functionality. Under libreELEC (Leia) 9.0.0 the TV is detected and can be switched off for example).

  • sudo cec-client -l

Output:

libCEC version: 4.0.2, compiled on Linux-4.4.0-142-generic ā€¦ features: P8_USB, DRM, P8_detect, randr

Found devices: NONE

  • echo ā€˜scanā€™ | cec-client -s -d 1

Output:

Autodetect: Failed

  • The troubleshooting brings us to the following forum post: Send HDMI CEC messages using cec-client The problem should be solved since April with kernel integration.

  • Apparently the most recent kernel is 4.4.154-91-rockchip-g70838c09a6b6 and the CEC is still not working.

Here are the LibreELEC CEC changes

Maybe it can help if added to the 4.4 Radxa Linux kernel too?

1 Like

This is related to my problem: Mainline-Kernel not booting

@mo123 could help! can I somehow bring a kernel to my debian with these changes already integrated? Or can somebody make a ready debian image to install on my Rock Pi 4B?

The hardware support in Debian is great, with graphics card recognition in chromium, etc, however, I badly need to get the CEC working too!

Thanks for any pointers or ideas how to bring this forward!

Do you use mainline kernel not the 4.4 kernel?
If so then these are the LibreELEC CEC mainline kernel changes.

You can basically fork it to your Github account and in the Debian build files change the kernel source to use yours instead. Or you can save all the individual kernel commits as patches and then include it in your Debian build. Or you can make all the kernel changes on your PC and then upload everything to a kernel folder on your Github.

I have only built LibreELEC and Armbian before so not sure how to build Debian or if it works the same way. Maybe if I have more time, Iā€™ll try to check how it works.

Have you tried another Linux OS with a mainline kernel like Manjaro and checked if CEC works there?
Maybe it will be a good idea to check other OSā€™s first and find one where it works then you can look at itā€™s kernel source for any HDMI CEC changes that might help.

The Libreelec cec works.

Yes, I was trying to build a mainline kernel, after reading that cec should be supported there from 5.1. I dont exactly care if in the end it will be 4.4 or 5.1 or whatever, as long as cec works. Is it written somewhere how to build your own debian image, so i can do the above fork and change kernel that you write?

For Debian with 4.4 kernel, you can refer:

https://wiki.radxa.com/Rockpi4/dev/Debian

We will cherry-pick the two CEC patches to our 4.4 kernel. Thanks @mo123 .

For mainline kernel, I suggest you use the debos or build Armbian for ROCK Pi 4.

debos: https://www.collabora.com/news-and-blog/blog/2019/08/06/rockpi-panfrost-wayland/

Hey @jack
when could we expect an updated build with the two cherry-picks already inside? :slight_smile:
Thanks!
Lucas

It might be all last 5 commits here

The forum formats it to show a single commit in blue text too.
You must click on the link next to the Github icon at the top, not the middle blue text to see the whole repo with all commits.
So you need to use this repo and replace the spaces with /
github.com kwiboo linux-rockchip commits rockchip-4.4-2019-cec

Hello, I happen to have almost the same problem!
My current kernel is 4.4.154-92-rockchip-g58d4b8d2fd3b on Debian 9.11 stretch.
Everything is working great so far but i canā€™t seem to get the HDMI-CEC to work.

According to this post a fix was already implemented into the kernel back in April.
Which kernel version actually supports HDMI-CEC?
I canā€™t seem to find any more recent ones than 4.4.154-92. Is it the most recent one or do i have to upgrade in a specific way other than normal dist-upgrades?
Iā€™m also interested in Ubuntu, is there perhaps a Ubuntu version where HDMI-CEC is available?

Best regards!
Otte

Hi,

To support CEC better, we have a newer version of kernel (4.4.179),
whose related packages are located at https://dl.radxa.com/users/dev/.

This version of kernel is testing, and we will add more features in the future.

Thanks!

1 Like

Hi Stephen,
thank you for the quick response. Iā€™ve installed the new kernel using the packages provided but to no avail regarding CEC. As mentioned I have almost the same problem so my cec-client also doesnā€™t find any devices whatsoever.
Output for the scan being ā€œautodetect FAILEDā€ instead of actually trying to find devices.

My current Kernel is now 4.4.179-6-rockchip-g246d1b34 and Iā€™ve re-installed the cec-client just to be sure.

Any further help with this would be appreciated! :slightly_smiling_face:

Hello, when will there be a solution to the CEC problem? Does anyone have a solution that works? It should have been solved since the April Kernel. Is there a Debian version with CEC to download?

Thank you for your support.

Hello Stephen, are there any news regarding a possible solution in sight? Itā€™s been a few days now and Iā€™m still struggling with the same problem. An estimate when we could expect a solution would be nice.

Best regards!

Seems HDMI CEC is also not working on some tvā€™s with AndroidTV 9 firmware I built.
HDMI CEC is working correctly with Android 9 with another RK3399 device, so it must be some small firmware problem. Maybe the Android, Linux HDMI CEC issue is related and to do with the kernel or dts?

The TV isnā€™t the issue in my case. Iā€™ve also tested CEC using libreELEC just like NBA said:

libreELEC on the same device with the same TV works just fine. So the device and TV can certainly do it.
What still confuses me most is that according to jack from this post the issue should have been resolved long ago.
In my case CEC is a necessary feature so I really need it to work.

According to this thread:

Send HDMI CEC messages using cec-client

We have merged the CEC pin dts and kernel config into the kernel tree, so HDMI cec should work. For Android, the cec pin patch might not be merged.

All Kernels Iā€™ve tried donā€™t work, including the most recent ones like
-4.4.154-91-rockchip-g70838c09a6b6
-4.4.154-92-rockchip-g58d4b8d2fd3b
-4.4.179-6-rockchip-g246d1b34
It says since April 2019 but wich Kernel Version is that exactly supposed to be? And why wouldnā€™t any recent ones not work?

To solve this issue, we have bought a Samsung TV with Anynet+ support. We will test how it works. We will update later.

Hi

Here is also a patch to fix LG Simplink proprietary CEC on Android.

For Android Pie
Seems code is a little different, I couldnā€™t get it to compile on RockPi 4 Pie.
Maybe Radxa can get it compiled?
https://pastebin.com/raw/HyrdZ179

For Android Nougat, can compile correctly.
https://pastebin.com/raw/60G9BsDH

For Linux 4.4 kernel, these are the LibreELEC CEC changes
'https://github.com/Kwiboo/linux-rockchip/commit/396108223ba5d22452eecc60576ba00d474bd1ca
'https://github.com/Kwiboo/linux-rockchip/commit/a59650f3b6c328659b63bec0c5cdb58a176e08b0
'https://github.com/Kwiboo/linux-rockchip/commit/cc8e225647bba088c4e5d7ea592919f70470d55a
'https://github.com/Kwiboo/linux-rockchip/commit/324b894c905e837deb590bb3532a3622df6e406d
'https://github.com/Kwiboo/linux-rockchip/commit/02555dfb76e1070fe81047c857a643a7cab0c072

You really donā€™t need a TV to try it out. Using cec-client -l should display information about the installed cec-client on the Rock Pi 4. The following is an example from a Raspberry Pi. Itā€™s the same output wheter it is connected to a TV with HDMI-CEC or a plain monitor without CEC.

The Rock Pi however stops at: Found devices: 0
The other command used to get information would be: echo 'scan' | cec-client -s -d 1. This one lists all devices available. So again with the Raspberry Pi it looks like this when connected to a TV with CEC:

With a plain monitor without CEC just the TV is missing from the list: