XU4 HDMI CEC issue

Having issues with your DietPi installation or found a bug? Post it here.
doomdog
Posts: 7
Joined: Thu Feb 11, 2021 3:40 pm

XU4 HDMI CEC issue

Post by doomdog »

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!
User avatar
Joulinar
Posts: 5109
Joined: Sat Nov 16, 2019 12:49 am

Re: XU4 HDMI CEC issue

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3097
Joined: Sat Nov 18, 2017 6:21 pm

Re: XU4 HDMI CEC issue

Post by MichaIng »

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?

Code: Select all

apt policy libcec4 cec-utils
doomdog
Posts: 7
Joined: Thu Feb 11, 2021 3:40 pm

Re: XU4 HDMI CEC issue

Post by doomdog »

Code: Select all

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)

Code: Select all

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:

Code: Select all

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
User avatar
MichaIng
Site Admin
Posts: 3097
Joined: Sat Nov 18, 2017 6:21 pm

Re: XU4 HDMI CEC issue

Post by MichaIng »

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:

Code: Select all

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
doomdog
Posts: 7
Joined: Thu Feb 11, 2021 3:40 pm

Re: XU4 HDMI CEC issue

Post by doomdog »

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
doomdog
Posts: 7
Joined: Thu Feb 11, 2021 3:40 pm

Re: XU4 HDMI CEC issue

Post by doomdog »

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...
User avatar
MichaIng
Site Admin
Posts: 3097
Joined: Sat Nov 18, 2017 6:21 pm

Re: XU4 HDMI CEC issue

Post by MichaIng »

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:

Code: Select all

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
doomdog
Posts: 7
Joined: Thu Feb 11, 2021 3:40 pm

Re: XU4 HDMI CEC issue

Post by doomdog »

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 ;) ) different Odroids, and the result is the same.
I'm now calculating the probability of 3 broken CEC Odroids ending up in my possession...
doomdog
Posts: 7
Joined: Thu Feb 11, 2021 3:40 pm

Re: XU4 HDMI CEC issue

Post by doomdog »

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...
Post Reply