LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   How do I enable CEC on RPi4b? (https://www.linuxquestions.org/questions/slackware-arm-108/how-do-i-enable-cec-on-rpi4b-4175735353/)

Lockywolf 03-26-2024 08:57 PM

How do I enable CEC on RPi4b?
 
This may be not entirely Slackware on Aarch64 related, but people here might know.

I want to play with controlling the computer with a TV remote, and it is supposed to be done with the CEC protocol.

It is known that RPi supports CEC, but how do I enable it?

https://www.linuxuprising.com/2019/0...connected.html

Code:

echo 'scan' | cec-client -s -d 1
autodetect FAILED

Code:

cec-ctl -l
Failed to open /dev/cec0: No such file or directory

but,

Code:

raspinfo | grep cec
hdmi_force_cec_address:0=65535
hdmi_force_cec_address:1=65535

So it does know that such a thing as cec exists.

pan64 03-27-2024 01:28 AM

no, rpi itself does not support it, you need to install some software. For example if you use kodi it will automatically detect it and use it, so you will be able to use kodi with your tv remote (without any additional configuration). What do you want to control with your remote?

Lockywolf 03-28-2024 12:01 AM

I figured it out.

CEC does not work with dtoverlay dtoverlay=vc4-fkms-v3d-pi4,cma=512, but it does work with dtoverlay=vc4-kms-v3d-pi4,cma=512.

I need to try and see how other features work on it.

Johpin 04-08-2024 06:40 AM

Quote:

Originally Posted by pan64 (Post 6492199)
For example if you use kodi it will automatically detect it and use it, so you will be able to use kodi with your tv remote (without any additional configuration).

How did you do this? I compiled Kodi, but it does not show CEC adapter
despite of it has been compiled in, see my post https://www.linuxquestions.org/quest...er-4175735804/
.

Quote:

Originally Posted by Lockywolf (Post 6492437)
I figured it out.

CEC does not work with dtoverlay dtoverlay=vc4-fkms-v3d-pi4,cma=512, but it does work with dtoverlay=vc4-kms-v3d-pi4,cma=512.

I need to try and see how other features work on it.

One year ago I posted https://www.linuxquestions.org/quest...6/#post6419247
In this post I described turning your television on and off using cec-ctl. For me cec-ctl -m still doesn't give output when pressing buttons on my remote control of my television.

pan64 04-08-2024 08:43 AM

Quote:

Originally Posted by Johpin (Post 6494819)
How did you do this?

Code:

pan@pi4:~ $ cec-ctl -l
Driver Info:
        Driver Name                : vc4_hdmi
        Adapter Name              : vc4-hdmi-0
        Capabilities              : 0x0000011e
                Logical Addresses
                Transmit
                Passthrough
                Remote Control Support
                Connector Info
        Driver version            : 6.6.20
        Available Logical Addresses: 1
        DRM Connector Info        : card 1, connector 32
        Physical Address          : 3.0.0.0
        Logical Address Mask      : 0x0000
        CEC Version                : 2.0
        OSD Name                  : ''
        Logical Addresses          : 0

but you need to see the device without kodi too
Code:

pan@pi4:~ $ ls -l /dev/cec*
crw-rw---- 1 root video 240, 0 Apr  5 17:59 /dev/cec0
crw-rw---- 1 root video 240, 1 Apr  5 17:59 /dev/cec1

it is detected automatically, I do not do anything. When I start kodi the smart tv will automatically connect to it.
and also you can use it with other software, like cec-client too (that was mentioned in your post too).

Or try libreelec (if that works at all) https://forums.raspberrypi.com/viewtopic.php?t=364971

Johpin 04-08-2024 10:58 AM

Quote:

Originally Posted by pan64 (Post 6494851)
[code]pan@pi4:~ $ cec-ctl -l
but you need to see the device without kodi too

cec-client too (that was mentioned in your post too).

Or try libreelec

In my post https://www.linuxquestions.org/quest...6/#post6419247

1. I mentioned seeing the devices, so that's fine.

2. you cannot find the word "cec-client" in this thread, only cec-ctl: cec-client has been deprecated. In this post I have given an example to switch the television on and off.

Libreelec works out of the box and Kodi with CEC on Raspberry Pi OS Bullseye and Bookworm too. My problem is on the Slackware arm platform.

Quote:

Originally Posted by pan64 (Post 6492199)
For example if you use kodi it will automatically detect it and use it

Settings -> system -> input -> peripherals does not show a CEC adapter in my case. How did you build Kodi with CEC support on Slackware arm?


All times are GMT -5. The time now is 11:50 AM.