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).
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â.
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.
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.
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: