XU4 HDMI CEC issue

Greetings,

Just installed the latest distribution on my XU4. Everything working except CEC:

root@DietPi:~# uname -a
Linux DietPi 4.14.180+ #1 SMP PREEMPT Tue Oct 13 13:28:54 UTC 2020 armv7l GNU/Linux
root@DietPi:~# dmesg | grep cec
root@DietPi:~# dmesg | grep CEC
root@DietPi:~# ls -al /dev/cec0
crw-rw---- 1 root video 249, 0 Feb 11 16:38 /dev/cec0
root@DietPi:~# cec-client -l
libCEC version: 4.0.4, compiled on Linux-4.9.0-8-armmp-lpae … , features: P8_USB, DRM, P8_detect, randr, Exynos, AOCEC
Found devices: NONE
root@DietPi:~# cat /etc/debian_version
10.8
root@DietPi:~# grep cec /boot/boot.ini
setenv cecenable “true” #this one enabled explicitly by me
if test “${cecenable}” = “false”; then fdt rm /cec@101B0000; fi
root@DietPi:~#

Needless to say that a RPi on the same cable works…
Please help me troubleshoot this, I can do any test required, just tell me.

Thanks!

Hi,

I guess this is coming from the kernel if I’m not mistaken. As DietPi is not creating kernel, it might be out of our hand. I found this old forum post on Odroid board https://forum.odroid.com/viewtopic.php?t=19926 . Looks like it should work

MichaIng
any ideas

It should work with libcec4 package and Linux 4.14 as well: https://forum.odroid.com/viewtopic.php?p=255259#p255259
The udev rule is to allow world access, however as you’re using root, permissions are not the issue, also 660 root:video actually are reasonable defaults to me.

Which versions of cec packages are installed, actually?

apt policy libcec4 cec-utils
root@DietPi:~# dpkg -l | grep cec
ii  cec-utils                         4.0.4+dfsg1-2                       armhf        USB CEC Adaptor communication Library (utility programs)
ii  libcec4:armhf                     4.0.4+dfsg1-2                       armhf        USB CEC Adaptor communication Library (shared library)



root@DietPi:~# apt policy libcec4 cec-utils
libcec4:
  Installed: 4.0.4+dfsg1-2
  Candidate: 4.0.4+dfsg1-2
  Version table:
 *** 4.0.4+dfsg1-2 500
        500 https://deb.debian.org/debian buster/main armhf Packages
        100 /var/lib/dpkg/status
cec-utils:
  Installed: 4.0.4+dfsg1-2
  Candidate: 4.0.4+dfsg1-2
  Version table:
 *** 4.0.4+dfsg1-2 500
        500 https://deb.debian.org/debian buster/main armhf Packages
        100 /var/lib/dpkg/status

Also, libcec doesn’t seem to have been compiled with Linux CEC support:

root@DietPi:~# cec-client -l
libCEC version: 4.0.4, compiled on Linux-4.9.0-8-armmp-lpae ... , features: P8_USB, DRM, P8_detect, randr, Exynos, AOCEC
Found devices: NONE

Ah it’s the package from the Debian repository that is installed on Buster. Meveric compiled that exact version for the Stretch images, not sure if there is any difference, but let’s simply try it out:

cd /tmp
wget https://dietpi.com/meveric/pool/backports/libc/libcec/cec-utils_4.0.4+dfsg1-2~bpo9_armhf.deb
wget https://dietpi.com/meveric/pool/backports/libc/libcec/libcec4_4.0.4+dfsg1-2~bpo9_armhf.deb
dpkg -i libcec4_4.0.4+dfsg1-2~bpo9_armhf.deb cec-utils_4.0.4+dfsg1-2~bpo9_armhf.deb

Nope, unfortunately:

root@DietPi:/tmp# dpkg -i libcec4_4.0.4+dfsg1-2~bpo9_armhf.deb cec-utils_4.0.4+dfsg1-2~bpo9_armhf.deb
(Reading database … 22559 files and directories currently installed.)
Preparing to unpack libcec4_4.0.4+dfsg1-2~bpo9_armhf.deb …
Unpacking libcec4:armhf (4.0.4+dfsg1-2~bpo9) over (4.0.4+dfsg1-2~bpo9) …
Preparing to unpack cec-utils_4.0.4+dfsg1-2~bpo9_armhf.deb …
Unpacking cec-utils (4.0.4+dfsg1-2~bpo9) over (4.0.4+dfsg1-2~bpo9) …
Setting up libcec4:armhf (4.0.4+dfsg1-2~bpo9) …
dpkg: dependency problems prevent configuration of cec-utils:
cec-utils depends on libncurses5 (>= 6); however:
Package libncurses5 is not installed.
cec-utils depends on libtinfo5 (>= 6); however:
Package libtinfo5 is not installed.

dpkg: error processing package cec-utils (–install):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.28-10) …
Errors were encountered while processing:
cec-utils

Only downgrading libcec4 and keeping the distro cec-utils results in:
root@DietPi:~# cec-client -l
libCEC version: 4.0.4, compiled on Linux-4.14.107+ … , features: P8_USB, DRM, P8_detect, randr, Exynos, Linux, AOCEC
Found devices: 1

device: 1
com port: Linux
vendor id: 0000
product id: 0000
firmware version: 0
type: Linux

But it still doesn’t work:

scan
requesting CEC bus information …
CEC bus information

device #1: Recorder 1
address: 1.0.0.0
active source: no
vendor: Pulse Eight
osd string: CECTester
CEC version: 1.4
power status: on
language: eng


currently active source: unknown (-1)
DEBUG: [ 23262] << Recorder 1 (1) → TV (0): POLL
TRAFFIC: [ 23262] << 10
ERROR: [ 23262] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
TRAFFIC: [ 23262] << 10
ERROR: [ 23262] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
DEBUG: [ 23262] >> POLL not sent
DEBUG: [ 23262] << requesting active source
TRAFFIC: [ 23262] << 1f:85
ERROR: [ 23262] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
TRAFFIC: [ 23262] << 1f:85
ERROR: [ 23262] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
DEBUG: [ 23262] << requesting active source
TRAFFIC: [ 23262] << 1f:85
ERROR: [ 23262] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
TRAFFIC: [ 23262] << 1f:85
ERROR: [ 23262] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64


I have two other HDMI devices on that bus (including, obviously, the TV itself) but they don’t show up.
I guess it’s caused by that CEC_TRANSMIT failed error…

apt install ./path/to/package.deb can be used to have dependencies automatically installed.
It’s not a downgrade, both are version 4.0.4+dfsg1-2, but it’s a different build, probably with other build options or even patches, not sure. I’ll ask Meveric if we get it running.

Not sure whether libcec4 A works with cec-utils B. Could you retry after installing it as well:

cd /tmp
wget https://dietpi.com/meveric/pool/backports/libc/libcec/cec-utils_4.0.4+dfsg1-2~bpo9_armhf.deb
apt install ./cec-utils_4.0.4+dfsg1-2~bpo9_armhf.deb

I did install both libcec4 and cec-utils from the links you specified, using apt install.
I am still not getting anything in dmesg regarding CEC and cec-client behaves exactly the same, i.e. not transmitting anything.

CEC bus information

device #1: Recorder 1
address: 1.0.0.0
active source: no
vendor: Pulse Eight
osd string: CECTester
CEC version: 1.4
power status: on
language: eng


currently active source: unknown (-1)
DEBUG: [ 14682] << requesting active source
TRAFFIC: [ 14682] << 1f:85
ERROR: [ 14682] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
TRAFFIC: [ 14682] << 1f:85
ERROR: [ 14682] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64


I have tested this on 3 (yes, three, don’t ask me why I got so many XU4s :wink: ) different Odroids, and the result is the same.
I’m now calculating the probability of 3 broken CEC Odroids ending up in my possession…

I’ve now broken down and started trying random images to test CEC and get to the bottom of this.
I’ve collected and tested these:

Debian-Jessie-1.1.4-20171121-XU3+XU4.img.xz
Debian-Stretch-1.0_RC2-20180403-XU3-XU4.img.xz
ubuntu-18.04.3-4.14-minimal-odroid-xu4-20190910.img.xz
ubuntu-20.04-5.4-minimal-odroid-xu4-20210112.img.xz
and, obviously, the latest DietPi.

The only one that has a working CEC (on all 3 XU4s, no less) is Debian Jessie.
The problem with that one is it’s old and doesn’t offer an easy way to run a new(ish) Kodi.
Which is why I was putting so much hope in DietPi, with its very nice software and configuration programs.
Basically, all I want is to have an (easily kept) updated Kodi with a few extras (transmission, samba) on a fast USB3+gigabit XU4, as I grew tired of the Raspberries’ shared USB limitations…

Best to my knowledge, on a RPi4 the ethernet interface is not shared anymore and a real gigabit one.

Since the two packages were compiled on/for Stretch, probably some other libraries not not match, causing the issue. I asked Meveric if those were patched or compiled with options different from the regular Debian repo packages, to work with Odroids. If so, we’d need to compile own Odroid-ready packages for Debian Buster.

I’ve compiled the latest libcec6 (which is already patched for kernel CEC framework) directly on the latest DietPi.
It also throws the same transmit errors as in my previous logs.
Also, dmesg does not show anything CEC-related, even though the kernel has the support (I checked in /proc/config.gz) and boot.ini has CEC enabled explicitly. It’s almost like the CEC hardware is not there when the system boots. Something is really messing with 4.x kernels on the XU4…

I’m having the same issue. Switched from Ubuntu 20.04 LTS to DietPI, because I could not get cec working.
I have never seen or used cec, so I don’t exactly know what to look for in dmesg. The following returns nothing:

root@DietPi:~# dmesg | grep -i cec

Kernel config:

root@DietPi:~# zgrep -i cec /proc/config.gz 
CONFIG_TABLET_USB_ACECAD=m
CONFIG_CEC_CORE=y
CONFIG_CEC_NOTIFIER=y
CONFIG_MEDIA_CEC_SUPPORT=y
# CONFIG_MEDIA_CEC_RC is not set
# USB HDMI CEC adapters
# CONFIG_USB_PULSE8_CEC is not set
# CONFIG_USB_RAINSHADOW_CEC is not set
# CONFIG_VIDEO_VIVID_CEC is not set
CONFIG_CEC_PLATFORM_DRIVERS=y
CONFIG_VIDEO_SAMSUNG_S5P_CEC=y

Since we’re debugging, it does not hurt to list what does kernel parameters do. Will include only CEC related parameters:
CONFIG_CEC_CORE=y - https://cateee.net/lkddb/web-lkddb/CEC_CORE.html
CONFIG_CEC_NOTIFIER=y - https://cateee.net/lkddb/web-lkddb/CEC_NOTIFIER.html
CONFIG_MEDIA_CEC_SUPPORT=y - https://cateee.net/lkddb/web-lkddb/MEDIA_CEC_SUPPORT.html

CONFIG_MEDIA_CEC_RC is not set - https://cateee.net/lkddb/web-lkddb/MEDIA_CEC_RC.html <<-this looks like a potential problem

CONFIG_USB_PULSE8_CEC is not set - https://cateee.net/lkddb/web-lkddb/USB_PULSE8_CEC.html

CONFIG_USB_RAINSHADOW_CEC is not set - https://cateee.net/lkddb/web-lkddb/USB_RAINSHADOW_CEC.html

CONFIG_VIDEO_VIVID_CEC is not set - https://cateee.net/lkddb/web-lkddb/VIDEO_VIVID_CEC.html

CONFIG_CEC_PLATFORM_DRIVERS=y - https://cateee.net/lkddb/web-lkddb/CEC_PLATFORM_DRIVERS.html
CONFIG_VIDEO_SAMSUNG_S5P_CEC=y - https://cateee.net/lkddb/web-lkddb/VIDEO_SAMSUNG_S5P_CEC.html

From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868511 we learn that CEC was included in the mainline kernel starting from 4.10.

So, DietPI kernel is not “far” from when CEC support was included in the kernel:

root@DietPi:~# uname -a
Linux DietPi 4.14.180+ #1 SMP PREEMPT Tue Oct 13 13:28:54 UTC 2020 armv7l GNU/Linux

Found this debian bug report, seems to be still open: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=872650

So, DietPI kernel is not “far” from when CEC support was included in the kernel:

just to avoid a misunderstanding. DietPi is not creating any kernel. The kernel is provided by the base image used. DietPi is not an own OS, it is a set of scripts on top of a Debian based destro/image. The image used depends on the SBC you are using. It could be a Raspberry OS, Armbian, plain Debian or Meveric image.

How do I check / know which base image was used? It’s not specified on the download page https://dietpi.com/#download

usually it’s part of the header once you login

 ─────────────────────────────────────────────────────
 DietPi v6.34.3 : 26 APT updates available
 ─────────────────────────────────────────────────────
 - Device model : RPi 4 Model B (armv7l)
 - Uptime : up 3 days, 15 hours, 8 minutes
 - CPU temp : 41'C : 105'F (Optimal temperature)
 - LAN IP : 192.168.0.11 (eth0)
 - Info Text : !!! PRODUCTION SYSTEM !!!
 ─────────────────────────────────────────────────────

 DietPi Team     : MichaIng (lead), Daniel Knight (founder), Joulinar (support)
 Image           : DietPi Core Team (pre-image: Raspbian Lite)
 Web             : https://dietpi.com | https://twitter.com/DietPi_
 Donate          : https://dietpi.com/#donate
 DietPi Hosting  : Powered by https://myvirtualserver.com

 apt upgrade     : Run now to apply 26 available APT package upgrades.

root@DietPiProd:~#

In my case it’s RPi OS
Image : DietPi Core Team (pre-image: Raspbian Lite)

Yeah, “Meveric” is probably a bit short. For Odroids we use Meveric’s images/kernel repository:

I already forwarded the CEC topic to him and he’s testing it on Debian Buster. The libcec packages from the Debian Buster repositories have Exynos CEC support enabled by default, so likely it’s related to the kernel indeed.

Debian bug reports are likely not helpful here, since it’s not the Debian kernel but Hardkernel’s (Odroid SBC manufacturer) kernel sources, built and packaged by Meveric. But interesting to learn about the options, many thanks for sharing :slight_smile:.

MichaIng
Maybe we should create an overview of SBC and show the used base image? Just thinking :thinking: