RP4, manjaro Mate and CEC

Hi Forum,
I have a problem in getting CEC to work on my RP4 with Manjaro 21.04 (MATE).

It does not seem to find any device.

]$ cec-client
No device type given. Using ‘recording device’
CEC Parser created - libCEC version 6.0.2
no serial port given. trying autodetect: FAILED

Everything works perfectly on Raspbian 32 bit.

cec-client
No device type given. Using ‘recording device’
CEC Parser created - libCEC version 4.0.4
no serial port given. trying autodetect:
path: Raspberry Pi
com port: RPI

Is there any known problem with the newer libcec versions and RP4? Or problem can be somewhere else? And is there a way to downgrade to 4.04 and test it out?

Thanks.

I’m not sure, @Darksky can correct me, but I don’t think our Raspberry Pi kernel has CEC enabled.

Yes it is enabled. The problem is some kernel version a while back changed things and upstream libcec has not been upgraded in ages so it is broke on aarch64 for the pi’s.

arch-arm created and changed libcec-rpi from armv7 at that time so it would be compatible with kodi-rpi version 18 when they started providing the kodi-rpi package for fkms. Then when kodi-rpi version 19 hit the kodi people recommended using kms instead of fkms; although kodi will run using fkms the last time I tested. So they changed the libcec-rpi and kodi-rpi packages for kms use only.

This can be a double edge sword though as some tv’s/monitors like my VIZIO will not provide the correct edid info and it will not boot using kms but my Gateway monitor will boot using kms so I have to use fkms on my Vizio tv.

If you look at libcec-rpi it will specify kms in the description.

[ray@pi4 ~]$ pacman -Ss libcec-rpi
community/libcec-rpi 6.0.2-3
    Pulse-Eight's libcec for the Pulse-Eight USB-CEC adapter (Raspberry Pi using kms)

So bottom line if you are using fkms to boot then you need to downgrade to libcec-rpi 6.0.2-2. (Download link below)

uname and cec-client outputs using fkms and libcec-rpi 6.0.2-2

[ray@pi4 ~]$ uname -a
Linux pi4 5.10.43-1-MANJARO-ARM #1 SMP PREEMPT Mon Jun 14 14:31:41 UTC 2021 aarch64 GNU/Linux
[ray@pi4 ~]$
[ray@pi4 ~]$ cec-client
No device type given. Using ‘recording device’
CEC Parser created - libCEC version 6.0.2
no serial port given. trying autodetect:
path: Raspberry Pi
com port: RPI

opening a connection to the CEC adapter…
DEBUG: [ 35] Broadcast (F): osd name set to ‘Broadcast’
DEBUG: [ 35] Open - vc_cec initialised
DEBUG: [ 35] logical address changed to Free use (e)
NOTICE: [ 35] connection opened
DEBUG: [ 35] << Broadcast (F) → TV (0): POLL
DEBUG: [ 35] initiator ‘Broadcast’ is not supported by the CEC adapter. using ‘Free use’ instead
TRAFFIC: [ 35] << e0
DEBUG: [ 35] processor thread started
DEBUG: [ 66] >> POLL sent
DEBUG: [ 66] TV (0): device status changed into ‘present’
DEBUG: [ 66] << requesting vendor ID of ‘TV’ (0)
TRAFFIC: [ 66] << e0:8c
DEBUG: [ 1159] expected response not received (87: device vendor id)
TRAFFIC: [ 1159] << e0:8c
DEBUG: [ 2223] expected response not received (87: device vendor id)
DEBUG: [ 2223] registering new CEC client - v6.0.2
DEBUG: [ 2223] SetClientVersion - using client version ‘6.0.2’
NOTICE: [ 2223] setting HDMI port to 1 on device TV (0)
DEBUG: [ 2223] SetConfiguration: double tap timeout = 200ms, repeat rate = 0ms, release delay = 500ms
DEBUG: [ 2223] detecting logical address for type ‘recording device’
DEBUG: [ 2223] trying logical address ‘Recorder 1’
DEBUG: [ 2223] << Recorder 1 (1) → Recorder 1 (1): POLL
TRAFFIC: [ 2223] << 11
TRAFFIC: [ 2495] << 11
DEBUG: [ 2765] >> POLL not sent
DEBUG: [ 2765] using logical address ‘Recorder 1’
DEBUG: [ 2765] Recorder 1 (1): device status changed into ‘handled by libCEC’
DEBUG: [ 2765] Recorder 1 (1): power status changed from ‘unknown’ to ‘on’
DEBUG: [ 2765] Recorder 1 (1): vendor = Pulse Eight (001582)
DEBUG: [ 2765] Recorder 1 (1): CEC version 1.4
DEBUG: [ 2765] AllocateLogicalAddresses - device ‘0’, type ‘recording device’, LA ‘1’
DEBUG: [ 2766] logical address changed to Recorder 1 (1)
DEBUG: [ 2766] Recorder 1 (1): osd name set to ‘CECTester’
DEBUG: [ 2766] Recorder 1 (1): menu language set to ‘eng’
DEBUG: [ 2766] GetPhysicalAddress - physical address = 1000
DEBUG: [ 2766] using auto-detected physical address 1000
DEBUG: [ 2766] Recorder 1 (1): physical address changed from ffff to 1000
DEBUG: [ 2766] << Recorder 1 (1) → broadcast (F): physical address 1000
TRAFFIC: [ 2766] << 1f:84:10:00:01
NOTICE: [ 2916] CEC client registered: libCEC version = 6.0.2, client version = 6.0.2, firmware version = 1, logical address(es) = Recorder 1 (1) , physical address: 1.0.0.0, compiled on 2021-01-26 12:41:11 by builduser on Linux 5.1.16-1-ARCH (aarch64), features: P8_USB, DRM, P8_detect, randr, RPi
DEBUG: [ 2916] << Recorder 1 (1) → TV (0): OSD name ‘CECTester’
TRAFFIC: [ 2916] << 10:47:43:45:43:54:65:73:74:65:72
DEBUG: [ 3219] << requesting power status of ‘TV’ (0)
TRAFFIC: [ 3219] << 10:8f
DEBUG: [ 4279] expected response not received (90: report power status)
TRAFFIC: [ 4279] << 10:8f
waiting for input
DEBUG: [ 5342] expected response not received (90: report power status)

https://drive.google.com/file/d/1o9eByrQbdUTVhAXaUboLzHcz I5qsxU6q/view?usp=sharing

1 Like

Thank you for the analysis, as ignorant as I am I just tried to boot with kms and CEC is now working in kodi 19 on my samsung tv without downgrading libcec.

I’m trying to get some info on the various drivers as it seems you’ve 3 options (kms, fkms and kms-rp4) but google wasn’t really helping much.

Anyone knows is there any reason to prefer fake kms over kms or kms-rp4 (I understand this is made specifically for rasbperry pi4) ?