Libcec update to 3.0.0

Hi,

Would it be possible to update libcec from 2.2.0 to the most recent version 3.0.0

libcec (3.0.0

  • changed / added:
    • initial version of an EventGhost plugin

    • Python API added through Swig, based on the C++ API

    • switched from autotools to cmake

    • added curses support. credits @joao29a

    • added cecc-client (testclient for the C api)

    • added runtime libCEC loading for C

    • updated the C interface to include new features and no longer use a
      global library instance

    • some AVRs fail to be powered up by the TV when it powers up. power up the
      AVR explicitly

    • added support for CEC_DEVICE_TYPE_TV (useful for testing)

    • compile with c++11

    • removed CStdString

    • drop ‘using namespace std’

    • autogenerated version numbers, drop some backwards compat code

    • LibCecSharp: added PhysicalAddressToString()

    • CecSharpClient: better formatting of the scan command

    • fixed:

      • Debian packaging cleaned up. Credits @PimentNoir
      • fixed Raspberry Pi compilation. Credits @NHellFire
      • ignore vendor command with id from pioneer AVRs. bugzid: 3853
      • update the vendor id of a device when receiving a vendor command with id
        before receiving a vendor id
      • XBMC->Kodi rebranding
      • don’t delete m_client when m_cec hasn’t been deleted yet in
        CLibCEC::~CLibCEC(). issue #63
      • change device types in CCECProcessor::Process(), not directly. issue #63
      • use shared_ptr instead of passing raw pointers around that
        can be unregistered from another thread and crash
      • check if the port or device actually changed in CCECClient::SetHDMIPort()
      • potential buffer overflow
      • fixed setting the physical address at startup when using default settings
      • don’t call callbacks directly in libCEC, but queue them and process from
        a worker thread
      • libCEC Tray: crash when retrying to find adapters
      • libCEC Tray: don’t show the “no device found” warning when resuming
        from standby
      • libCEC Tray: reconnect to the adapter after resuming from standby
      • libCEC Tray: send key presses to the active window when none of the
        predefined (wmc/kodi) ones are active
      • libCEC Tray: fixed key combinations with the windows key

– Pulse-Eight Packaging packaging@pulse-eight.com Fri, 03 Apr 2015 21:13:00 +020

I spoke to Lars, and I don’t believe this is backward compatible with Kodi Helix. This means it will arrive when we move to Isengard (Kodi 15.x)

S

Excellent. Thanks for the quick answer

With Kodi 15 at beta 1, then 3.0.0 will be available before long :smile:

This looks backportable to 14.x

Sam

1 Like

Before I stumbled upon this post I decided to upgrade cec-client to 3.0 through

Now if i run cec-client i get the following error:
libcec.so.3.0: cannot open shared object file: No such file or directory

How can i revert back to 2.2?

The reason why I was trying to upgrade?
I have an old Samsung TV connected to a rpi2, which I was trying to turn on and off through the console.
I found that I could turn it on using
echo “on 0” | cec-client -s

But it wouldn’t turn off using
echo “standby 0” | cec-client -s or echo “tx 10 36” | cec-client -s

I reverted to this post
https://www.raspberrypi.org/forums/viewtopic.php?t=15749
Within which they end up using the following command to turn off (successfully):
echo “standby 0” | /opt/xbmc-bcm/xbmc-bin/bin/cec-client -s

However, that path does not exist on my osmc (RC3).

Any suggestions on both problems?
Cheers!

You can’t mix and match versions of libcec and Kodi - Kodi is built to use a specific version of libcec and will not work with other (major) versions.

We built Helix to work with libcec 2.2, libcec 3.0 will require Isengard, so when we release an Isengard build it will come with libcec 3.0.

You don’t say exactly how you updated to libcec, if you did a manual install it might be difficult to undo the damage as there is no clean way to uninstall it, however you can try to reinstall the osmc package containing libcec. You don’t say what device you are running on, is it a Pi 1, Pi 2 or Vero ? The package name differs between them.

For example for Pi 2:

sudo apt-get install rbp2-libcec-osmc --reinstall

For Pi 1 or Vero substitute rbp1-libcec-osmc or vero-libcec-osmc respectively. This will do a forced reinstall of an already installed package, thus rewriting any files that might have been replaced during your manual installation of libcec 3. (This may or may not be enough to fix it though depending on what other changes were made)

cec-client exists in RC3 but probably not at the same path as Raspbian. I don’t know what the path is off hand but try typing cec-client without a path and it should work. To find it’s location use ‘whereis cec-client’.

Thanks for the quick reply.

A few more details about my system:
Raspberry Pi 2
3.18.13-1-osmc

Process of installing libcec through GitHub - Pulse-Eight/libcec: USB CEC Adapter communication Library http://libcec.pulse-eight.com/
Manual install:

make
sudo make install

I tried your suggestion

sudo apt-get install rbp2-libcec-osmc --reinstall

but i still get the same error while running cec-client:
libcec.so.3.0: cannot open shared object file: No such file or directory

To get an idea of which items were installed through the manual install, i did a make clean and sudo make install again on libcec 3.0 and here is the output:

Should i try manually deleting all the files that were installed using sudo make install and then re-installing rbp2-libcec-osmc?

Regarding my second problem (more so my initial problem), I was able to run the following command and get the tv to turn on:

echo "on 0" | cec-client -s

i.e. the osmc cec-client was already in /usr/bin/… . However, I could’t turn the tv off using

echo "standby 0" | cec-client -s

For now this is a separate problem all together… first need to try get cec-client working.

You probably have the newer version of cec-client in a different location of your path. The standard version is here:

osmc@rpi2:~$ whereis cec-client
cec-client: /usr/bin/cec-client

See if you have another copy of cec-client somewhere else in the path, if so delete or rename it.

I just tried this and it worked OK on my Samsung TV but I’ve just realised I’m running a test build of Isengard that includes libcec 3.0 - so I’m not sure whether it would have worked with libcec 2.2.

It worked :). Had a faulty version stuck in /usr/local/bin/

Unfortunately my second problem still stands: I cannot turn off my samsung tv. Perhaps I need to try this out on a different tv to make sure its not the tv at fault. I’ll also post a reply later today containing the output from cec-client which executing on and off.

Thought of another possibility for you.

The problem with using cec-client is that it presents itself as a different device to the TV than Kodi, this can cause the TV to get confused and CEC to stop working with Kodi.

Instead, try using one of the Kodi builtins using xbmc-send:

xbmc-send -a "CECActivateSource"

and

xbmc-send -a "CECStandby"

Give that a try and see if it works. I haven’t tried it myself, but if it does work the advantage is you are sending the command via Kodi instead of the independent cec-client, which will not confuse the TV with two different device names.

BTW you can run any other Kodi built in commands from xbmc-send:

http://kodi.wiki/view/List_of_built-in_functions