Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TVHeadend HTSP Client Addon fails to load #17493

Open
1 of 7 tasks
DaVukovic opened this issue Mar 13, 2020 · 21 comments
Open
1 of 7 tasks

TVHeadend HTSP Client Addon fails to load #17493

DaVukovic opened this issue Mar 13, 2020 · 21 comments
Labels

Comments

@DaVukovic
Copy link
Member

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

After building pvr.hts it's available at Addons -> my addons -> pvr clients but it fails to load

Expected Behavior

Here is a clear and concise description of what was expected to happen:

TVHeadend should be loaded

Actual Behavior

TVHeadend doesn't load

Possible Fix

To Reproduce

Steps to reproduce the behavior:

  1. build Kodi master
  2. build pvr.hts
  3. try to launch TVHeadend

Debuglog

The debuglog can be found here:
Kodi log: https://termbin.com/msyy
pvr.hts build log: https://termbin.com/unfu

That might be of interest

2020-03-13 15:48:31.691 T:19303   ERROR: ADDON: Could not locate pvr.hts.so.5.4.1
2020-03-13 15:48:31.691 T:19303   ERROR: UpdateAddons: Failed to create add-on Tvheadend HTSP Client, status = 5

pvr.hts.so.5.4.1 is located at:

davu@fedora-desk pvr.hts ]$ pwd
/usr/local/lib/kodi/addons/pvr.hts
[davu@fedora-desk pvr.hts ]$ ls pvr.hts.so.5.4.1 
pvr.hts.so.5.4.1
[davu@fedora-desk pvr.hts ]$ 

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

  • Android

  • iOS

  • Linux

  • OSX

  • Raspberry-Pi

  • Windows

  • Windows UWP

  • Operating system version/name: Fedora 31

  • Kodi version: Kodi master

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@xbmc-gh-bot xbmc-gh-bot bot added the Triage: Needed (managed by bot!) issue that was just created and needs someone looking at it label Mar 13, 2020
@DaVukovic DaVukovic added Component: PVR Platform: Linux v19 Matrix Triage: Confirmed issue has been reproduced by a team member and removed Triage: Needed (managed by bot!) issue that was just created and needs someone looking at it labels Mar 13, 2020
@DaVukovic DaVukovic assigned DaVukovic and ksooo and unassigned DaVukovic Mar 13, 2020
@howie-f
Copy link
Contributor

howie-f commented Mar 13, 2020

@DaVukovic from actually building master with tvheadend (as always at my end) i can tell that it seems to work atm. sometimes download of tvh fails during build due to connection problems. btw. are you happy with the solution from #17474 ? i certainly not intended to screw up the gui, but the right direction wasn't quite obvious and really hard to track down for me

@DaVukovic
Copy link
Member Author

DaVukovic commented Mar 13, 2020

I don't have a clue why it does not work on my end. By reading the Kodi log it seems that Kodi can't finde the pvr.hts.so.5.4.1 file which is present on my system. So either that location is wrong or Kodi doesn't look at the correct location.

Maybe there's also something wrong with the way I build Kodi/TVH. We'll see when a dev answers. Probably I'll purge everything tomorrow (including my GH clone) and start from scratch.

The PR you mentioned is already merged. I haven't followed the discussion anymore. So I can't say how it looks in the end (will check that as well tomorrow). But because it's already merged, it wouldn't count much anymore if I would not be happy with it, no? ;)

@ksooo ksooo changed the title TVHeadend fails to load TVHeadend HTSP Client Addon fails to load Mar 13, 2020
@ksooo
Copy link
Member

ksooo commented Mar 13, 2020

This is not about tvheadend (which is the backend software). This is about the Tvheadend HTSP Client PVR Addon (aka pvr.hts).

@ksooo ksooo removed their assignment Mar 13, 2020
@ksooo
Copy link
Member

ksooo commented Mar 13, 2020

I don't feel responsible for our build system.

@DaVukovic
Copy link
Member Author

OK. No probs. Maybe there will be someone else who might be responsible then.

@AlwinEsch
Copy link
Member

AlwinEsch commented Mar 14, 2020

Has it worked with other addons on /usr/local/lib/kodi?
How looks his symlinks?
What is showed if you call nm -D pvr.hts.so.5.4.1?

If with first then can be something wrong with Kodi's path search by "special://xbmcbin/", this can the case if Kodi is installed in /usr/lib/kodi and the addons in */local/*.

@AlwinEsch
Copy link
Member

AlwinEsch commented Mar 14, 2020

Seen it have /usr/local/lib64/kodi/addons. Also maybe possible that it expect lib without 64.

Can you add after https://github.com/xbmc/xbmc/blob/master/xbmc/addons/binary-addons/AddonDll.cpp#L110
a fprintf(stderr, "strFileName %s\n", strFileName.c_str()); to see the complete path.

It would be also good to change his log call on a request to see full path, with library name only hard to see 😏.

@AlwinEsch
Copy link
Member

Just saw by test another circumstance, has deleted his dll and on Log show with complete path is one character missing!

ADDON: Could not locate '/home/alwin/Development/Kodi/kodi-Matrix.build/nputstream.adaptive.so.2.5.4'

The i missing!

@AlwinEsch
Copy link
Member

Has looked further, has you started Kodi from /usr/local/bin or from his build folder?

Seen if from his build folder it fails and use this path on comment before, only if the Kodi started from install path has it worked.

@AlwinEsch
Copy link
Member

Saw now on your log:

2020-03-13 15:48:19.319 T:19285   ERROR: GetDirectory - Error getting /usr/local/lib64/kodi/addons
2020-03-13 15:48:19.319 T:19285   ERROR: GetDirectory - Error getting special://xbmcbin/addons

What says stat -c "%U %G %a" /usr/local/lib64/kodi/addons?

By me for /usr/local/lib/kodi/addons is it root root 755

@AlwinEsch
Copy link
Member

AlwinEsch commented Mar 14, 2020

OK enough comments now 😁, you installed by /usr/local/lib/kodi/addons/pvr.hts/pvr.hts.so.5.4.1 but it expect lib64.

There is then something wrong by global CMAKE_INSTALL_LIBDIR
https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html?highlight=cmake_install_

Either set incorrectly by the system itself or by Kodi's creation.

How it come if you do this from addon source:

mkdir build && cd build && cmake -DADDONS_TO_BUILD=$(basename $(dirname $(pwd))) \
   -DADDON_SRC_PREFIX=../.. \
   -DCMAKE_BUILD_TYPE=Debug \
   -DCMAKE_INSTALL_PREFIX=/usr/local \
   ../../xbmc/cmake/addons # Path to your Kodi source
sudo make

Still install to /usr/local/lib or then correct to /usr/local/lib64?

@DaVukovic
Copy link
Member Author

@AlwinEsch I followed directly the build instructios for Fedora and Linux to build Kodi and also the instructions for Linux to build the binary addons which are mentioned at our 'docs'-secrion at the code. The prefix is always /usr/local. So I'm not where something is going wrong. I'll run those commands later after I''m awake again.

The addon itself builds fine. It's just Kodi that can't locate the specific file.

@DaVukovic
Copy link
Member Author

DaVukovic commented Mar 15, 2020

Side node first:

So....what I've tested now is, that I have copied the addons folder from /usr/local/lib/kodi to /usr/local/lib64/kodi and after that Ithe TVH client started. So I can confirm, that Kodi expects the pvr.hts.5.4.1.so file to be at the lib64 folder instead of the lib folder.

What have I done to build:

I simply followed the instructions given here:
https://github.com/xbmc/xbmc/blob/master/docs/README.Linux.md#5-build-binary-add-ons
and I used the following command:
sudo make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons PREFIX=/usr/local ADDONS="pvr.hts"

Answering above questions:

Has it worked with other addons on /usr/local/lib/kodi?

yes

I have tried to build audioencoder.lame as another binary add-on and that addon has its audioencoder.lame.so.2.1.0 file located at: /usr/local/lib/kodi/addons/audioencoder.lame and that works fine. So I guess, those binary add-ons *.so files being located at the lib folder instead of the lib64 folder isn't totally wrong.

How looks his symlinks?

davu@fedora-desk pvr.hts ]$ ls -al
insgesamt 556
drwxr-xr-x. 2 root root   4096 14. Mär 07:13 .
drwxr-xr-x. 4 root root   4096 15. Mär 08:37 ..
lrwxrwxrwx. 1 root root     15 14. Mär 07:13 pvr.hts.so -> pvr.hts.so.19.0
lrwxrwxrwx. 1 root root     16 14. Mär 07:13 pvr.hts.so.19.0 -> pvr.hts.so.5.4.1
-rwxr-xr-x. 1 root root 559864 14. Mär 07:13 pvr.hts.so.5.4.1
[davu@fedora-desk pvr.hts ]$ 

What is showed if you call nm -D pvr.hts.so.5.4.1?

https://termbin.com/mt6s

the case if Kodi is installed in /usr/lib/kodi and the addons in /local/.

Not sure if I got that, but here are some outputs which might help:

davu@fedora-desk pvr.hts ]$ which kodi
/usr/local/bin/kodi
[davu@fedora-desk pvr.hts ]$

lib folder

What you see here is, that both (pvr.hts and audioencoder.lame) are located here, but only the audioencoder works.

[davu@fedora-desk lib ]$ ls -R
.:
firewalld  kodi

./firewalld:
services

./firewalld/services:
kodi-eventserver.xml  kodi-http.xml  kodi-jsonrpc.xml

./kodi:
addons

./kodi/addons:
audioencoder.lame  pvr.hts

./kodi/addons/audioencoder.lame:
audioencoder.lame.so  audioencoder.lame.so.19.0  audioencoder.lame.so.2.1.0

./kodi/addons/pvr.hts:
pvr.hts.so  pvr.hts.so.19.0  pvr.hts.so.5.4.1
[davu@fedora-desk lib ]$ 

lib64 folder

You see here, what I've mentioned above and that I have created an addons folder and also copied the pvr.hts folder recursively to that location. This change makes the pvr.hts client work!

[davu@fedora-desk lib64 ]$ ls -R
.:
kodi

./kodi:
addons  kodi-x11  kodi-xrandr  system

./kodi/addons:
pvr.hts

./kodi/addons/pvr.hts:
pvr.hts.so  pvr.hts.so.19.0  pvr.hts.so.5.4.1

./kodi/system:
libsse4-x86_64-linux.so  players

./kodi/system/players:
VideoPlayer

./kodi/system/players/VideoPlayer:
libdvdnav-x86_64-linux.so
[davu@fedora-desk lib64 ]$ 

has you started Kodi from /usr/local/bin or from his build folder?

After I have compiled Kodi I ran sudo make install and it's started from /usr/local/bin as you can see from the which command I have posted above.

What says stat -c "%U %G %a" /usr/local/lib64/kodi/addons?
By me for /usr/local/lib/kodi/addons is it root root 755

same for me:

[davu@fedora-desk ~ ]$ stat -c "%U %G %a" /usr/local/lib64/kodi/addons
root root 755
[davu@fedora-desk ~ ]$ 

How it come if you do this from addon source:

Not sure what you want me to do here ;). As said, I followed the instructions given from our docs. I don't have cloned the binary addon repo to compile an addon directly from there, which should not be the recommended way anyway if we tell users to follow our docs.
But I'm for sure willing to test everything you want me to, but I'm not sure where I should run this command:

mkdir build && cd build && cmake -DADDONS_TO_BUILD=$(basename $(dirname $(pwd))) \
   -DADDON_SRC_PREFIX=../.. \
   -DCMAKE_BUILD_TYPE=Debug \
   -DCMAKE_INSTALL_PREFIX=/usr/local \
   ../../xbmc/cmake/addons # Path to your Kodi source
sudo make

@AlwinEsch
Copy link
Member

AlwinEsch commented Mar 15, 2020

Our docs are not always perfect 😄

Because of the audio encoder, this can be a bit deceptive. In contrast to PVR, this is not loaded after installation and would only be noticed when it is started (with a CD rip).

There can really be something wrong in addons cmake files for handling the lib64, so Kodi is correct but addons wrong. At ubuntu this is not noticeable since it only has lib.

@Rechi there seems a bug on our Toolchain.cmake.in and Toolchain_binaddons.cmake.in and the by cmake needed CMAKE_INSTALL_LIBDIR not given and on Fedora it is different from standard!!!

Normally I do this for direct build:

mkdir build && cd build && cmake \
  -DADDONS_TO_BUILD=$(basename $(dirname $(pwd))) \
  -DADDON_SRC_PREFIX=../.. \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_INSTALL_PREFIX=$HOME/.kodi/addons \
  -DPACKAGE_ZIP=1 \
  ~/Development/Kodi/kodi-Matrix/cmake/addons && \ # My Kodi source
  make

where then on $HOME/.kodi/addons

Or if crossplatform build by the Jenkins way (where also work for normal build):

cd ./tools/depends/target/binary-addons
mkdir -p addons/pvr.hts
echo "pvr.hts . ." > addons/pvr.hts/pvr.hts.txt
echo all > addons/pvr.hts/platforms.txt
make ADDONS='pvr.hts' \
     ADDONS_DEFINITION_DIR=`pwd`/addons \
     ADDON_SRC_PREFIX=`pwd` \
     EXTRA_CMAKE_ARGS="-DPACKAGE_ZIP=ON" \ # This to become together
     PREFIX=$HOME/.kodi/addons # This his wanted install place

Addons must then available on tools/depends/target/binary-addons

With own download works with

# Replace of above
echo "pvr.hts https://github.com/kodi-pvr/pvr.hts Matrix" > addons/pvr.hts/pvr.hts.txt
#  This then leaved away "ADDON_SRC_PREFIX=`pwd` \"

@AlwinEsch
Copy link
Member

@DaVukovic is the xbmc/tools/depends/Makefile.include available on your build (or only the Makefile.include.in)?

If yes can you upload that I see his content and also if present to try addon build if it was deleted.

@AlwinEsch
Copy link
Member

AlwinEsch commented Mar 15, 2020

Cou can try with this hack to see the variable is missing:

From 3117636191aa018ccc61cf40d9aaa18eccf8715f Mon Sep 17 00:00:00 2001
From: Alwin Esch <alwin.esch@web.de>
Date: Sun, 15 Mar 2020 17:25:56 +0100
Subject: [PATCH] [addons] temporary hack fix

---
 cmake/addons/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt
index 7b217b85bd..08ffba3aa0 100644
--- a/cmake/addons/CMakeLists.txt
+++ b/cmake/addons/CMakeLists.txt
@@ -84,6 +84,7 @@ include(${CORE_SOURCE_DIR}/cmake/scripts/common/CompilerSettings.cmake)
.
 set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
                -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+               -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
                -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig
                -DADDON_DEPENDS_PATH=${ADDON_DEPENDS_PATH}
                -DOVERRIDE_PATHS=${OVERRIDE_PATHS}
--.
2.20.1

and then maybe after them on right place.

@DaVukovic
Copy link
Member Author

Here is the Maikefile.include.in:

Makefile.include.in.zip

I also removed everything pvr-related again, modified CMakelists.txt ( https://termbin.com/3p79 ), rebuild Kodi, rebuild pvr.hts, but it's still located at /usr/local/lib/ instead of lib64 and the add-on still couldn't be loaded.

@AlwinEsch
Copy link
Member

AlwinEsch commented Mar 16, 2020

The Makefile.include.in include does not matter 😄, then if not present it takes the system cmake settings (only the generated Makefile.include override the system).

I take now Fedora as Virtual System to see what happens there (https://www.osboxes.org/fedora/).

@DaVukovic
Copy link
Member Author

@AlwinEsch

Any updates on this? I'm currently not able to do/test anything PVR related

@enigma131
Copy link

enigma131 commented Sep 20, 2020

Same problem here, compiled from scratch Kodi and all plugins. I am on CentOs.
I had to copy all plugins from lib to lib64. Strange because kodi-x11 and kodi-xrand binarys are located in lib64!

@basilgello
Copy link
Collaborator

basilgello commented Jan 16, 2021

I spotted the similar behavior on Debian: the architectures where CMake can determinate the CMake LIBDIR location do work,
but where it can not, overriding LIBDIR without -DOVERRIDE_PATHS=1 produces solibs in /usr/lib/x86_64-linux-gnu/kodi/....

I have to add -DOVERRIDE_PATHS=1 to all packaged add-ons to make them load properly on different architectures of Kodi.
Colleagues from Debian suggest adding GNUInstallDirs upstream for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants