nlrb
Posts: 6
Joined: Mon Apr 13, 2015 7:50 pm

Re: Ubuntu 14.04 + LibCEC

Mon Apr 13, 2015 8:15 pm

The checks for libcec are wrong as far as I can see with the latest userland:

Code: Select all

checking for vchiq_initialise in -lbcm_host... no
checking for vchi_initialise in -lbcm_host... (cached) no
checking for vchi_create_connection in -lbcm_host... no
These functions now live in library 'vchiq_arm'.

I haven't built libCEC on Ubuntu, but on Raspbian I had to follow the next steps.

Code: Select all

1. Install required tools (e.g. gcc 4.8 for C++11 support)
   sudo apt-get install cmake g++-4.8
2. Get development headers
   sudo apt-get install liblockdev1-dev libudev-dev libxrandr-dev
3. Python & SWIG
   sudo apt-get install python-dev swig
4. Get all the latest code
   git clone --recursive [email protected]:Pulse-Eight/libcec.git
5. Modify ~/libcec/src/libcec/cmake/CheckPlatformSupport.cmake
   change
     check_library_exists(bcm_host vchi_initialise "" HAVE_RPI_API)
   to
     check_library_exists(bcm_host bcm_host_init "" HAVE_RPI_API)
   and below 'set(LIB_INFO "${LIB_INFO}, 'RPi'")' add
     include_directories(/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux)
6. Build platform
   cd ~/libcec/src/platform
   mkdir build
   cd build
   cmake -DCMAKE_CXX_COMPILER=g++-4.8 ..
   make
   sudo make install
7. Build libcec
   cd ~/libcec
   mkdir build
   cd build
   export LIBRARY_PATH=/opt/vc/lib
   cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=1 ..
   make
   sudo -E bash -c 'make install'

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Ubuntu 14.04 + LibCEC

Mon Apr 13, 2015 9:30 pm

Nice tips, especially step 5.

Seksan2
Posts: 1
Joined: Sun Feb 22, 2015 1:34 am
Location: Australia

Re: Ubuntu 14.04 + LibCEC

Sun Apr 19, 2015 8:44 am

Just tried doing this on the latest raspbian and it was all going fine until it came to step 7 when i tried to run the cmake command:

Code: Select all

-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test SUPPORTS_CXX11
-- Performing Test SUPPORTS_CXX11 - Failed
CMake Error at src/cec-client/CMakeLists.txt:21 (find_package):
  By not providing "Findplatform.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "platform",
  but CMake did not find one.

  Could not find a package configuration file provided by "platform" with any
  of the following names:

    platformConfig.cmake
    platform-config.cmake

  Add the installation prefix of "platform" to CMAKE_PREFIX_PATH or set
  "platform_DIR" to a directory containing one of the above files.  If
  "platform" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring incomplete, errors occurred!
Makefile:120: recipe for target 'cmake_check_build_system' failed 
Help would be appreciated please
Thanks
Intelligence is quite Sexy!

nlrb
Posts: 6
Joined: Mon Apr 13, 2015 7:50 pm

Re: Ubuntu 14.04 + LibCEC

Sun Apr 19, 2015 1:17 pm

Looks to be multiple errors in there. Did you follow each step to the letter?
  • C++ compiler is not found to be g++-4.8
  • platform cannot be found, which should be there after 'sudo make install' of step 6.

kartik93abc
Posts: 1
Joined: Sat May 02, 2015 8:18 pm

Re: Ubuntu 14.04 + LibCEC

Sat May 02, 2015 8:21 pm

Got this error on step 7
Can you help
g++-4.8: internal compiler error: Segmentation fault (program collect2)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
src/libcec/CMakeFiles/cec.dir/build.make:885: recipe for target 'src/libcec/libcec.so.3.0.0' failed
make[2]: *** [src/libcec/libcec.so.3.0.0] Error 4
CMakeFiles/Makefile2:227: recipe for target 'src/libcec/CMakeFiles/cec.dir/all' failed
make[1]: *** [src/libcec/CMakeFiles/cec.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

gkreidl
Posts: 6120
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Ubuntu 14.04 + LibCEC

Wed May 27, 2015 12:01 pm

I managed to get libCEC-3.0 compiled and installed on Raspbian following the OP, but had to install and make "platform" from a separate github repository ( https://github.com/Pulse-Eight/platform ). It's working with kodi now.

But when I try to configure the newest kodi sources, which require libCEC-3.0, it is not found and CEC-support is missing. Any idea?
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

coopak
Posts: 2
Joined: Thu Jun 04, 2015 5:53 am

Re: Ubuntu 14.04 + LibCEC

Sat Jun 06, 2015 8:03 am

gkreidl wrote:I managed to get libCEC-3.0 compiled and installed on Raspbian following the OP, but had to install and make "platform" from a separate github repository ( https://github.com/Pulse-Eight/platform ). It's working with kodi now.

But when I try to configure the newest kodi sources, which require libCEC-3.0, it is not found and CEC-support is missing. Any idea?
How did you use the separate platform? Did you just wget the platform repository and save it in ~/libcec/src/platform and then follow OP's original compile instructions?

gkreidl
Posts: 6120
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Ubuntu 14.04 + LibCEC

Sat Jun 06, 2015 9:38 am

coopak wrote:
gkreidl wrote:I managed to get libCEC-3.0 compiled and installed on Raspbian following the OP, but had to install and make "platform" from a separate github repository ( https://github.com/Pulse-Eight/platform ). It's working with kodi now.

But when I try to configure the newest kodi sources, which require libCEC-3.0, it is not found and CEC-support is missing. Any idea?
How did you use the separate platform? Did you just wget the platform repository and save it in ~/libcec/src/platform and then follow OP's original compile instructions?
No, I got it as a separate github project and compiled it separately. Meanwhile it's working with kodi-15-beta2 (see viewtopic.php?f=66&t=109088 ).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

sirjonnyboy
Posts: 1
Joined: Sun Jun 14, 2015 10:49 pm

Re: Ubuntu 14.04 + LibCEC

Sun Jun 14, 2015 11:01 pm

Hey everyone, could someone help me out by compiling the current way to get CEC working into a single post? I mixed myself up by starting with This Post and tried following the comments to get it all worked out. Needless to say, it didn't work. At this point I have no idea what I'm doing. I know you guys have gotten this to work and would love it if someone could show me how.
Thanks so much.

EMJB
Posts: 111
Joined: Wed Jun 12, 2013 8:29 am

Re: Ubuntu 14.04 + LibCEC

Sun Jul 12, 2015 5:19 pm

Have just tried nlrb's procedure for installation on a Pi1 with Raspbian, and all worked OK after an "apt-get update" until:

Code: Select all

~ $ git clone --recursive [email protected]:Pulse-Eight/libcec.git
Cloning into 'libcec'...
The authenticity of host 'github.com (192.30.252.131)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Can anyone help me proceed please?

EMJB

asavah
Posts: 364
Joined: Thu Aug 14, 2014 12:49 am

Re: Ubuntu 14.04 + LibCEC

Mon Jul 13, 2015 10:05 am

use https://

git clone --recursive https://github.com/Pulse-Eight/libcec.git

EMJB
Posts: 111
Joined: Wed Jun 12, 2013 8:29 am

Re: Ubuntu 14.04 + LibCEC

Mon Jul 13, 2015 1:52 pm

asavah wrote:use https://

git clone --recursive https://github.com/Pulse-Eight/libcec.git
Many thanks - it now seems to compile (after doing Raspbian update), but got one error message:

Code: Select all

-- Looking for __atomic_fetch_add_4 in atomic
-- Looking for __atomic_fetch_add_4 in atomic - not found
Just have to see if it works in spite of that!

EMJB

EMJB
Posts: 111
Joined: Wed Jun 12, 2013 8:29 am

Re: Ubuntu 14.04 + LibCEC

Mon Jul 13, 2015 4:49 pm

Oops - missed a group of error messages:

Code: Select all

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
RPI_BCM_HOST
    linked by target "cec" in directory /home/pi/libcec/src/libcec
RPI_VCHIQ_ARM
    linked by target "cec" in directory /home/pi/libcec/src/libcec
RPI_VCOS
    linked by target "cec" in directory /home/pi/libcec/src/libcec
so it did not compile OK after all. Can anyone help with these or the "__atomic_fetch_add_4" error in my previous post?

EMJB

sam nazarko
Posts: 150
Joined: Wed Apr 25, 2012 5:05 pm

Re: Ubuntu 14.04 + LibCEC

Mon Jul 20, 2015 9:54 pm

This is a new change in 3.0.1. You need to add:

-DRPI_BCM_HOST=1 -DRPI_VCHIQ_ARM=1 -DRPI_VCOS=1

Sam

EMJB
Posts: 111
Joined: Wed Jun 12, 2013 8:29 am

Re: Ubuntu 14.04 + LibCEC

Tue Jul 21, 2015 5:59 pm

sam nazarko wrote:This is a new change in 3.0.1. You need to add:

-DRPI_BCM_HOST=1 -DRPI_VCHIQ_ARM=1 -DRPI_VCOS=1

Sam
Thanks - do I add those to "libcec/src/libcec/cmake/CheckPlatformSupport.cmake", and if so does it matter where?

EMJB

gkreidl
Posts: 6120
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Ubuntu 14.04 + LibCEC

Tue Jul 21, 2015 6:55 pm

No, they are arguments for the cmake command, like this:

Code: Select all

cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=1 ..
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

EMJB
Posts: 111
Joined: Wed Jun 12, 2013 8:29 am

Re: Ubuntu 14.04 + LibCEC

Thu Jul 23, 2015 8:44 am

Thanks gkreidl, that has cleared that problem. Need to investigate the next one further before requesting help.

EMJB

JSavino
Posts: 1
Joined: Sat Aug 29, 2015 1:30 pm

Re: Ubuntu 14.04 + LibCEC

Sat Aug 29, 2015 1:33 pm

Hey all, I'm getting a cmake error of:

Code: Select all

CMake Error: cmake_symlink_library: System Error: Operation not permitted
I assume this is because I am attempting to make it on a vfat usb drive attached to my raspberry pi. Any thoughts on how to work around this?

pawnguyen
Posts: 2
Joined: Mon Mar 14, 2016 4:17 pm
Contact: Website

Re: Ubuntu 14.04 + LibCEC

Mon Mar 14, 2016 4:32 pm

gkreidl wrote:No, they are arguments for the cmake command, like this:

Code: Select all

cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=1 ..
I know this post is old but I wanted to post incase someone else ran into the same problems I did. I installed Ubuntu 14.04 on my Raspberry PI 2. Follow the libCEC install for raspberry pi according to libcec github page as of this post. I was able to compile and install however i did not have raspberry pi support.

I followed the steps provided above by by nlrb (thank you). most important was step 7 and symlinks to from opt/vc to /usr which was stated in this post:
https://wiki.ubuntu.com/ARM/RaspberryPi

I also installed the raspberry pi Libraries as instructed to do so form that wiki as well.

Again i was able to compile but no support for raspberry pi.

It was until i ran:

Code: Select all

cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=1 ..
I saw raspberry pi was supported. I continued with install then ran "cec-client" and got my tv information and power status.

thanks @gkreidl

Return to “Advanced users”