# Issues with Kodi/CEC



## halfagascan (Dec 19, 2021)

Clean install of FreeBSD 13.0-RELEASE-p4 amd64.
Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz NUC
Pulse eight usb adaptor.
Base installed, desktop-installer installed, kodi installed, some errors see bug PR 260490,
Kodi starts and runs, plays iptv channels, no issues. Just need to use a usb mouse to control.
As part of kodi install, libcec-6.0.2, gets installed.
As user:

```
echo 'scan' | cec-client -s -d 1
ERROR:   [            3553]     error opening serial port '/dev/ttyU0': Permission denied
```


```
ls -all /dev/ttyU0 
crw-------  1 root  wheel  0x182 Dec 19 09:09 /dev/ttyU0
```


```
id 
uid=1001(jerry) gid=1001(jerry) groups=1001(jerry),0(wheel)
```
as root:

```
echo 'scan' | cec-client -s -d 1
opening a connection to the CEC adapter...
ERROR:   [           19932]     failed to ping the adapter 3 times in a row. closing the connection.
Connection lost - trying to reconnect

requesting CEC bus information ...
ERROR:   [           40898]     failed to ping the adapter 3 times in a row. closing the connection.
Connection lost - trying to reconnect

CEC bus information
===================
device #0: TV
address:       0.0.0.0
active source: no
vendor:        Unknown
osd string:    TV
CEC version:   unknown
power status:  on
language:      ???


device #1: Recorder 1
address:       1.0.0.0
active source: no
vendor:        Unknown
osd string:    Recorder 1
CEC version:   unknown
power status:  unknown
language:      eng
```

Part of cec debug, much to long to post here:


```
CEC bus information
===================
device #0: TV
address:       0.0.0.0
active source: no
vendor:        Unknown
osd string:    TV
CEC version:   unknown
power status:  unknown
language:      ???


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



currently active source: unknown (-1)
Illegal instruction (core dumped)
```


```
ls -all 
-rw-------   1 root  wheel  38088704 Dec 19 09:45 cec-client-6.0.2.core
```

And cec never connects to or sends to the tv
Some internet searching seems to suggest a bad hdmi cable, this same set works fine on linux.
Can anyone provide more troubleshooting advice or a fix?
Thanks


----------



## grahamperrin@ (Dec 22, 2021)

<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260490#c8>



halfagascan said:


> hdmi



I occasionally see reports of problems with HDMI (<https://github.com/helloSystem/ISO/issues/7> for example), however I'm totally uneducated about things such as Kodi and CEC so I should back off here.

If you come back to FreeBSD, someone might follow up on this.


----------



## Alain De Vos (Dec 23, 2021)

There is an O.S. for Kodi alone,





						LibreELEC
					

Just enough OS for KODI




					libreelec.tv
				



[PS: Maybe kodi has alot of linuxism which make's difficult to port.]


----------



## Andriy (Dec 23, 2021)

The crash (illegal instruction) certainly has nothing to do with the cable.
You may want to use gdb to find out what instruction that was and there it is.
Please report this to libcec's port maintainer.

"failed to ping" looks like it may be related to the cable.
But I don't know much about libcec and how to debug it.

Finally, you can permissions of /dev/ttyU0 using chmod just like for any other file, so that you can access it as a regular user.
But such a change won't be persistent, it would go away after each disconnect/reconnect or reboot.
You'd need a devfs rule to make it applied automatically.


----------



## grahamperrin@ (Dec 23, 2021)

halfagascan (new-ish to FreeBSD), you might wonder about the _provides_ at <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260490#c9>. 

FYI <https://www.freshports.org/ports-mgmt/pkg-provides/>

FreshPorts is our friend. Amongst the partially hidden features are in-page anchors, so, for example, <https://www.freshports.org/ports-mgmt/pkg-provides/#message> `#message` scrolls to a representation of the message that's sometimes within a source file such as pkg-message or pkg-message.in.

Without pkg-provides

As far as I know, pkg-based commands can get the message only _after_ a package has been installed. 

Back on topic, using Kodi as an example:


```
root@mowa219-gjp4-8570p-freebsd:~ # pkg install --yes --quiet sysutils/dvdvideo kodi
pkg: kodi has a missing dependency: libdvdcss
Building cache database of MIME types
Generating GTK icon cache for /usr/local/share/icons/hicolor
=====
Message from tinyxml-2.6.2_4:

--
===>   NOTICE:

The tinyxml port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
root@mowa219-gjp4-8570p-freebsd:~ # exit
logout
% pkg query %M tinyxml
Always:
===>   NOTICE:

The tinyxml port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing

% pkg rquery %M tinyxml

%
```

FreeBSD bug 200025 – [feature request] ports-mgmt/pkg: searching package contents via pkg-rquery(8)


----------



## grahamperrin@ (Dec 23, 2021)

Hmm. 


```
% kodi
ld-elf.so.1: Shared object "libcrossguid.so.0" not found, required by "kodi.bin"
% pkg info -x libcrossguid
pkg: No package(s) matching libcrossguid
% pkg info -x avcodec dav1d ffmpeg fstrcmp lcms2 libass libavcodec libbluray libcec libcrossguid libfmt libfstrcmp libGLU libglvnd liblzo libvdpau lzo2 spdlog sqlite3 taglib waylandpp
pkg: No package(s) matching avcodec
dav1d-0.9.2
ffmpeg-4.4.1_3,1
kdemultimedia-ffmpegthumbs-21.12.0
lcms2-2.12
libass-0.15.2
libassuan-2.5.5
libbluray-1.3.0,1
libcec-6.0.2
libfmt-8.0.1
libGLU-9.0.2_1
libglvnd-1.3.4
linux-c7-libglvnd-1.0.1
libvdpau-1.4
libvdpau-va-gl-0.4.2_5
lzo2-2.10_1
spdlog-1.9.2
py38-sqlite3-3.8.12_7
py39-sqlite3-3.9.9_7
qt5-sqldrivers-sqlite3-5.15.2
sqlite3-3.35.5_4,1
gstreamer1-plugins-taglib-1.16.2
taglib-1.12
% pkg provides libcrossguid
Name    : libcrossguid-20150803_6
Desc    : Minimal and cross platform C++ GUID library
Repo    : FreeBSD
Filename: usr/local/libdata/pkgconfig/libcrossguid.pc
          usr/local/lib/libcrossguid.so.0
          usr/local/lib/libcrossguid.so
% pkg info -x libcrossguid
pkg: No package(s) matching libcrossguid
% sudo pkg install --automatic libcrossguid
grahamperrin's password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
pkg: kodi has a missing dependency: libdvdcss
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        libcrossguid: 20150803_6 [FreeBSD]

Installed packages to be REINSTALLED:
        libmatemixer-1.26.0 [FreeBSD]

Number of packages to be installed: 1
Number of packages to be reinstalled: 1

174 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching libcrossguid-20150803_6.pkg: 100%    7 KiB   7.5kB/s    00:01   
[2/2] Fetching libmatemixer-1.26.0.pkg: 100%  166 KiB 170.3kB/s    00:01   
Checking integrity... done (0 conflicting)
[1/2] Installing libcrossguid-20150803_6...
[1/2] Extracting libcrossguid-20150803_6: 100%
[2/2] Reinstalling libmatemixer-1.26.0...
[2/2] Extracting libmatemixer-1.26.0: 100%
% kodi
ld-elf.so.1: Shared object "libfstrcmp.so.0" not found, required by "kodi.bin"
% pkg provides libfstrcmp.so.0
Name    : fstrcmp-0.7.D001
Desc    : Library for fuzzy string comparisons
Repo    : FreeBSD
Filename: usr/local/lib/libfstrcmp.so.0.6.0
          usr/local/lib/libfstrcmp.so.0
% sudo pkg install --automatic fstrcmp
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        fstrcmp: 0.7.D001 [FreeBSD]

Number of packages to be installed: 1

40 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching fstrcmp-0.7.D001.pkg: 100%   40 KiB  41.2kB/s    00:01   
Checking integrity... done (0 conflicting)
[1/1] Installing fstrcmp-0.7.D001...
[1/1] Extracting fstrcmp-0.7.D001: 100%
=====
Message from fstrcmp-0.7.D001:

--
===>   NOTICE:

The fstrcmp port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
% kodi
ld-elf.so.1: Shared object "libwayland-client++.so.0" not found, required by "kodi.bin"
% pkg provides libwayland-client++.so.0
Name    : wayland-1.20.0
Desc    : Wayland composite "server"
Repo    : FreeBSD
Filename: usr/local/lib/libwayland-client.so.0.20.0
          usr/local/lib/libwayland-client.so.0

Name    : linux-c7-wayland-1.15.0
Desc    : Wayland compositor libraries (Linux CentOS 7.9.2009)
Repo    : FreeBSD
Filename: compat/linux/usr/lib64/libwayland-client.so.0.3.0
          compat/linux/usr/lib64/libwayland-client.so.0
          compat/linux/usr/lib/libwayland-client.so.0.3.0
          compat/linux/usr/lib/libwayland-client.so.0
Name    : wayland-1.19.0_1
Desc    : Wayland composite "server"
Repo    : poudriere
Filename: usr/local/lib/libwayland-client.so.0.20.0
          usr/local/lib/libwayland-client.so.0

% sudo pkg install --automatic linux-c7-wayland
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
% sudo pkg install --automatic wayland
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
% uname -KU
1400043 1400043
% pkg -vv | grep -e url -e enabled
    url             : "pkg+http://pkg0.bme.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    url             : "https://alpha.pkgbase.live/current/FreeBSD:14:amd64/latest",
    enabled         : no,
    url             : "file:///usr/local/poudriere/data/packages/main-default",
    enabled         : yes,
%
```

There, I'm stuck: 

`ld-elf.so.1: Shared object "libwayland-client++.so.0" not found, required by "kodi.bin"`

– the two packages that provide the object are already installed. 


Not that I _want_ to run Kodi (at this time). I'm just curious. Housekeeping, complete with me being forgetful and careless: 



Spoiler: Oops





```
% sudo pkg autoremove
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages:

Installed packages to be REMOVED:
        dvdvideo-py38: 20130117_2

Number of packages to be removed: 1

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling dvdvideo-py38-20130117_2...
[1/1] Deleting files for dvdvideo-py38-20130117_2: 100%
% sudo pkg autoremove
Checking integrity... done (0 conflicting)
Nothing to do.
% sudo pkg clean -a
The following package files will be deleted:
        /var/cache/pkg/openobex-1.7.2.pkg
        /var/cache/pkg/kodi-19.3.pkg
        /var/cache/pkg/obexapp-1.4.15_4.pkg
        /var/cache/pkg/libcec-6.0.2.pkg
        /var/cache/pkg/terminus-font-4.48.pkg
        /var/cache/pkg/openobex-1.7.2~605dc19c50.pkg
        /var/cache/pkg/libmicrohttpd-0.9.73~0234d0c07d.pkg
        /var/cache/pkg/libcec-6.0.2~e2f2568702.pkg
        /var/cache/pkg/p8-platform-2.1.0.1_2.pkg
        /var/cache/pkg/libcrossguid-20150803_6~7f910b5c80.pkg
        /var/cache/pkg/libcrossguid-20150803_6.pkg
        /var/cache/pkg/libpeas-1.26.0~e407e33455.pkg
        /var/cache/pkg/libmatemixer-1.26.0~9ce7db0bd5.pkg
        /var/cache/pkg/terminus-font-4.48~9b721065d8.pkg
        /var/cache/pkg/dvdvideo-py38-20130117_2~6ee268d833.pkg
        /var/cache/pkg/tinyxml-2.6.2_4~90a7e7ba5f.pkg
        /var/cache/pkg/kodi-19.3~f6347de452.pkg
        /var/cache/pkg/cowsay-3.04_2.pkg
        /var/cache/pkg/libmicrohttpd-0.9.73.pkg
        /var/cache/pkg/libmatemixer-1.26.0.pkg
        /var/cache/pkg/dvdvideo-py38-20130117_2.pkg
        /var/cache/pkg/fstrcmp-0.7.D001~c0ff5e1b66.pkg
        /var/cache/pkg/libpeas-1.26.0.pkg
        /var/cache/pkg/fstrcmp-0.7.D001.pkg
        /var/cache/pkg/cowsay-3.04_2~ca540efe31.pkg
        /var/cache/pkg/obexapp-1.4.15_4~640898093c.pkg
        /var/cache/pkg/p8-platform-2.1.0.1_2~6268295877.pkg
        /var/cache/pkg/tinyxml-2.6.2_4.pkg
The cleanup will free 29 MiB

Proceed with cleaning the cache? [y/N]: y
Deleting files: 100%
All done
% pkg delete kodi -y && pkg autoremove -y
pkg: Insufficient privileges to delete packages
% sudo pkg delete kodi -y && sudo pkg autoremove -y
No packages matched for pattern '-y'

Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        kodi: 19.3

Number of packages to be removed: 1

The operation will free 62 MiB.

Proceed with deinstalling packages? [y/N]: n
Checking integrity... done (0 conflicting)
Nothing to do.
% sudo pkg delete -y kodi && sudo pkg -y autoremove
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        kodi: 19.3

Number of packages to be removed: 1

The operation will free 62 MiB.
[1/1] Deinstalling kodi-19.3...
[1/1] Deleting files for kodi-19.3: 100%
Building cache database of MIME types
Generating GTK icon cache for /usr/local/share/icons/hicolor
pkg: illegal option -- y
pkg: Invalid argument provided
% sudo pkg autoremove -y
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 4 packages:

Installed packages to be REMOVED:
        fstrcmp: 0.7.D001
        libcrossguid: 20150803_6
        libmicrohttpd: 0.9.73
        tinyxml: 2.6.2_4

Number of packages to be removed: 4

The operation will free 2 MiB.
[1/4] Deinstalling libcrossguid-20150803_6...
[1/4] Deleting files for libcrossguid-20150803_6: 100%
[2/4] Deinstalling fstrcmp-0.7.D001...
[2/4] Deleting files for fstrcmp-0.7.D001: 100%
[3/4] Deinstalling libmicrohttpd-0.9.73...
[3/4] Deleting files for libmicrohttpd-0.9.73: 100%
[4/4] Deinstalling tinyxml-2.6.2_4...
[4/4] Deleting files for tinyxml-2.6.2_4: 100%
%
```


----------



## halfagascan (Dec 23, 2021)

Thanks for the pointers, I'll keep them in mind.
Going to step back from this for a bit, maybe after the new year I'll revisit the issues.
Thanks for the help, pointers and hand holding.


----------



## halfagascan (Dec 23, 2021)

core dump added to *Bug 260579*" href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=*Bug 260579*">PR *Bug 260579*https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260579
*hope its useful*


----------



## zsolt (Jan 29, 2022)

Where did you bought the adapter? Do you know a store from the EU?


----------



## halfagascan (Jan 30, 2022)

Control your TV from Kodi, or vice versa! USB - CEC Adapter
					

Control your TV, Amplifier and/or Blu-ray Player from Kodi!




					www.pulse-eight.com


----------

