Cec-client and libcec on RaspberryPi OSMC/Raspbian

This article has not been updated for a long time and may be outdated

How to install libcec and cec-client on Raspberry Pi with Debian jessie? The following instruction is valid for the newest OSMC and Raspbian images based on Jessie distro. Building a cec-client package directly on Raspberry Pi is required, because of the problem with preinstalled cec-utils that doesn’t work with built-in cec driver.

First thing to do is to update software to the latest version and to install required depedencies:
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install cmake libudev-dev libxrandr-dev python-dev swig


For OSMC install rbp-userland-dev-osmc package:

sudo apt-get install rbp-userland-dev-osmc

For Raspbian install libraspberrypi-dev package:

sudo apt-get install libraspberrypi-dev

Clone Pulse-Eight platform repository and build it

cd ~/
mkdir platform/build && cd platform/build
cmake ..
sudo make install

Finally clone and build libcec

cd ~/
mkdir libcec/build && cd libcec/build
cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib ..
make -j4
sudo make install
sudo ldconfig

The newly installed version of cec-client is located in /usr/local/bin/ directory.

{{ message }}

{{ 'Comments are closed.' | trans }}