RPi-Distro / repo

Issue tracking for the archive.raspberrypi.org repo
37 stars 1 forks source link

[Bullseye] libcec for RPi CEC support #268

Closed MichaIng closed 2 years ago

MichaIng commented 2 years ago

Please feel free to close the issue if there is a schedule for building missing packages for the Bullseye suite at a later time. Since we use it in our stable RPi images already, we just get the reports when something is missing.

When using the Bullseye suite of archive.raspberrypi.org, the libcec packages are not yet available, hence the ones from Raspbian/Debian are installed, which are not compatible with Raspberry Pi. It would be hence great if RPi builds for these could be added.

If any other user lands here, the Buster packages still install and work fine when creating symlinks for the changed libraspberrypi0 shared object names, hence the workaround:

# Installing/downgrading the latest `libcec`/`cec-utils` from Buster
cd /tmp
curl -sSfLO 'https://archive.raspberrypi.org/debian/pool/main/libc/libcec/libcec4_4.0.7+dfsg1-1+rpt2_armhf.deb'
curl -sSfLO 'https://archive.raspberrypi.org/debian/pool/main/libc/libcec/cec-utils_4.0.7+dfsg1-1+rpt2_armhf.deb'
apt install --reinstall --allow-downgrades ./libcec4_4.0.7+dfsg1-1+rpt2_armhf.deb ./cec-utils_4.0.7+dfsg1-1+rpt2_armhf.deb
rm libcec4_4.0.7+dfsg1-1+rpt2_armhf.deb cec-utils_4.0.7+dfsg1-1+rpt2_armhf.deb
# Creating libraspberrypi0 symlinks
cd /usr/lib/arm-linux-gnueabihf
dpkg -L libraspberrypi0 | grep '/usr/lib/arm-linux-gnueabihf/.*\.so.0' | while read -r line
do
line=${line#/usr/lib/arm-linux-gnueabihf/}
ln -s "$line" "${line%.0}"
done
xb00tt commented 2 years ago

I have no idea what I am doing but I can't get the above code to work. Keep in mind that my unix skills are novice at best. Any ideas would be appreciated.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'cec-utils' instead of './cec-utils_4.0.7+dfsg1-1+rpt2_armhf.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 cec-utils : Depends: libcec4 (= 4.0.7+dfsg1-1+rpt2) but it is not installable
E: Unable to correct problems, you have held broken packages.
ln: failed to create symbolic link 'libbcm_host.so': File exists
ln: failed to create symbolic link 'libcontainers.so': File exists
ln: failed to create symbolic link 'libdebug_sym.so': File exists
ln: failed to create symbolic link 'libdtovl.so': File exists
ln: failed to create symbolic link 'libmmal.so': File exists
ln: failed to create symbolic link 'libmmal_components.so': File exists
ln: failed to create symbolic link 'libmmal_core.so': File exists
ln: failed to create symbolic link 'libmmal_util.so': File exists
ln: failed to create symbolic link 'libmmal_vc_client.so': File exists
ln: failed to create symbolic link 'libvchiq_arm.so': File exists
ln: failed to create symbolic link 'libvcos.so': File exists
ln: failed to create symbolic link 'libvcsm.so': File exists
MichaIng commented 2 years ago

Ah sorry I forgot to add libcec4. The user who reported this on our repo did a distro upgrade from Buster to Bullseye and libcec4 was still installed. I edited the additional steps/package into the post above.

Since the libraspberrypi0 library files without .0 ending exist already, I assume you ran this loop before once, so you don't need to repeat it.

xb00tt commented 2 years ago

Well, it installed like magic now but it's not working for me. I reboot but Kodi is still not reacting to my remote. It all worked fine on Buster with Kodi 18 before. Am I missing some add-on on Kodi 19?

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libcec4' instead of './libcec4_4.0.7+dfsg1-1+rpt2_armhf.deb'
Note, selecting 'cec-utils' instead of './cec-utils_4.0.7+dfsg1-1+rpt2_armhf.deb'
The following NEW packages will be installed:
  libcec4
The following packages will be DOWNGRADED:
  cec-utils
0 upgraded, 1 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 0 B/211 kB of archives.
After this operation, 648 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 /tmp/libcec4_4.0.7+dfsg1-1+rpt2_armhf.deb libcec4 armhf 4.0.7+dfsg1-1+rpt2 [182 kB]
Get:2 /tmp/cec-utils_4.0.7+dfsg1-1+rpt2_armhf.deb cec-utils armhf 4.0.7+dfsg1-1+rpt2 [29.0 kB]
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libcec4:armhf.
(Reading database ... 33262 files and directories currently installed.)
Preparing to unpack .../libcec4_4.0.7+dfsg1-1+rpt2_armhf.deb ...
Unpacking libcec4:armhf (4.0.7+dfsg1-1+rpt2) ...
dpkg: warning: downgrading cec-utils from 6.0.2-2 to 4.0.7+dfsg1-1+rpt2
Preparing to unpack .../cec-utils_4.0.7+dfsg1-1+rpt2_armhf.deb ...
Unpacking cec-utils (4.0.7+dfsg1-1+rpt2) over (6.0.2-2) ...
Setting up libcec4:armhf (4.0.7+dfsg1-1+rpt2) ...
Setting up cec-utils (4.0.7+dfsg1-1+rpt2) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1) ...
ln: failed to create symbolic link 'libbcm_host.so': File exists
ln: failed to create symbolic link 'libcontainers.so': File exists
ln: failed to create symbolic link 'libdebug_sym.so': File exists
ln: failed to create symbolic link 'libdtovl.so': File exists
ln: failed to create symbolic link 'libmmal.so': File exists
ln: failed to create symbolic link 'libmmal_components.so': File exists
ln: failed to create symbolic link 'libmmal_core.so': File exists
ln: failed to create symbolic link 'libmmal_util.so': File exists
ln: failed to create symbolic link 'libmmal_vc_client.so': File exists
ln: failed to create symbolic link 'libvchiq_arm.so': File exists
ln: failed to create symbolic link 'libvcos.so': File exists
ln: failed to create symbolic link 'libvcsm.so': File exists

P.S. Ran the loop anyway. 😁

xb00tt commented 2 years ago

I reboot the system with the TV off and it turned it on by itself but still cant navite Kodi. Strage enough I cant navigate the TV also because it recognizes the CEC device. TV is Sony and the service Bravia Sync is enabled while connected to the Pi.

MichaIng commented 2 years ago

Does it work from command line?

echo 'scan' | cec-client -s -d 1
cec-client -l

As Raspbian Bullseye does not ship any kodi-bin package, where did you install it from? Or do you use Debian?

It worked for one of our users, but I'm now wondering why, since Kodi 19 from Debian as well as an own build from us for Raspbian were built against libcec6 🤔.

xb00tt commented 2 years ago

I installed from the dietpi-software option.

root@DietPi:~# echo 'scan' | cec-client -s -d 1
cec-client -l
opening a connection to the CEC adapter...
requesting CEC bus information ...
CEC bus information
===================
device #0: TV
address:       0.0.0.0
active source: no
vendor:        Sony
osd string:    TV
CEC version:   1.4
power status:  on
language:      eng

device #1: Recorder 1
address:       3.0.0.0
active source: yes
vendor:        Pulse Eight
osd string:    CECTester
CEC version:   1.4
power status:  on
language:      eng

device #5: Audio
address:       1.0.0.0
active source: no
vendor:        Sony
osd string:    Audio System
CEC version:   1.4
power status:  on
language:      ???

currently active source: Recorder 1 (1)
libCEC version: 4.0.7, compiled on Linux-5.10.17-v8+ ... , features: P8_USB, DRM, P8_detect, randr, RPi, Exynos, Linux, AOCEC
Found devices: 1

device:              1
com port:            RPI
vendor id:           2708
product id:          1001
firmware version:    1
type:                Raspberry Pi
MichaIng commented 2 years ago

Ah okay when it's about DietPi, please continue discussion on our repo: https://github.com/MichaIng/DietPi/issues/4881

MichaIng commented 2 years ago

libcec6 packages are now available via RPi repo, many thanks 👍. Marking this as closed.

akamming commented 1 year ago

I see this one is closed, since the packages are available. However: after my upgrade to bullseye i still have the same issue. I checked, libcec was installed from this repo.

when i use the workaround mentioned above it works again...

XECDesign commented 1 year ago

What's the output of apt policy libcec6?

akamming commented 1 year ago

tx for the hint! should have thought of this myself !

I thought this was a 100% rpi only install, but apt policy showed another repo (deb-multimedia.org) where it retreived this package. Can't remember i ever added this one to sources.list but it was there anyway .

Removed that repo and reinstalled all packages which it got from that repo (but now from original rpi repo). Issue solved, cause now it works.

Problem solved.

Sorry for bothering and keep up the good work!