TVMosaic addon for LibreELEC

TVMosaic live and recorded TV products for Desktop/NAS/Raspbery Pi
awiouy
Posts: 14
Joined: Tue Mar 27, 2018 10:25 pm

TVMosaic addon for LibreELEC

Post by awiouy » Mon Jun 04, 2018 10:20 pm

I have finally found the time to write a TV Mosaic addon for LibreELEC 9.0 for RPi.
It is running here, though I have issues completing a scan (it starts scanning but randomly fails with a general error 1000).

The provisional code is here.
A preview is here.

The addon is not compatible with a manual installation of TV Mosaic.
If a manual installation is already running, you must stop it.
The most conservative way to stop a manual installation is:
- edit /storage/.config/autostart.sh to comment out the line containing /storage/tvmosaic/start2.sh
- reboot LibreELEC

If you wish to revert to your manual installation:
- uninstall the addon
- uncomment the line
- reboot LibreELEC

Peculiarities:
- TV Mosaic is stored in /storage/.kodi/addons/service.tvmosaic
- user data is stored in /storage/.kodi/userdata/addon_data/service.tvmosaic

Happy testing
Last edited by awiouy on Mon Jun 11, 2018 7:57 pm, edited 2 times in total.

Oberon
Posts: 1130
Joined: Thu Jan 26, 2017 8:45 am

Re: TVMosaic addon for LibreELEC

Post by Oberon » Tue Jun 05, 2018 7:29 am

Thanks for your efforts.
It fails with error 1000 from time to time because you need to copy version.dat to be next to tvmosaic_server executable.

awiouy
Posts: 14
Joined: Tue Mar 27, 2018 10:25 pm

Re: TVMosaic addon for LibreELEC

Post by awiouy » Tue Jun 05, 2018 6:52 pm

Thank you for the feedback Oberon

I have updated the addon to keep both data and shared.inst across updates.
I have updated the links in the first post accordingly.


The directory structure is now:

$ADDON_DIR (static files)
$ADDON_DIR/bin (tvmosaic_reg, tvmosaic_server, version.dat)
$ADDON_DIR/config (configuration files that are copied $ADDON_HOME when the TV Mosaic is updated)
$ADDON_DIR/lib (missing libs)

$ADDON_HOME (user configuration: tvmosaic_configuration.xml, version.dat)
$ADDON_HOME/data (private root)
$ADDON_HOME/shared.inst (shared root)

Is that correct?


TV Mosaic still fails randomly, but I am not sure it fails because version.dat is misplaced.
You will certainly be able to find what goes wrong with the attached log.

Thank you for your help
Attachments
tvmosaic_server.log.zip
(12.24 KiB) Downloaded 28 times

Oberon
Posts: 1130
Joined: Thu Jan 26, 2017 8:45 am

Re: TVMosaic addon for LibreELEC

Post by Oberon » Fri Jun 08, 2018 2:32 pm

Yes, the log file still indicates that crash is because of misplaced version.dat file. This file also should match exactly the one from installation and it has to be next to the tvmosaic_server file.
Are you using start2.sh script to run application?

Also version.dat is redundant here:
$ADDON_HOME (user configuration: tvmosaic_configuration.xml, version.dat)

awiouy
Posts: 14
Joined: Tue Mar 27, 2018 10:25 pm

Re: TVMosaic addon for LibreELEC

Post by awiouy » Fri Jun 08, 2018 3:25 pm

In fact, I try to comply with LibreELEC standards, namely:
- binaries in /storage/.kodi/addons/service.tvmosaic/bin (automatically added to PATH)
- libraries in /storage/.kodi/addons/service.tvmosaic/lib (automatically added to LD_LIBRARY_PATH)
- data in /storage/.kodi/userdata/addon_data/service.tvmosaic

At the moment I use these TV Mosaic settings:
TVMOSAIC_ROOT_CONFIG_DIR=/storage/.kodi/userdata/addon_data/service.tvmosaic, and
<tvmosaic_configuration>
<install_path>/storage/.kodi/addons/service.tvmosaic/bin</install_path>
<private_root>/storage/.kodi/userdata/addon_data/service.tvmosaic/data</private_root>
<shared_root>/storage/.kodi/userdata/addon_data/service.tvmosaic/shared.inst</shared_root>
</tvmosaic_configuration>

I am not sure if the above is correct (probably not), nor where tvmosaic server expects the tvmosaic_server/version.dat pair of files.

I am aware that the manual installation uses /storage/tvmosaic and /storage/tvmosaic.data directories, but I would prefer to comply with the installation standard used by all LibreELEC addons.

Thank you for your patience.

Oberon
Posts: 1130
Joined: Thu Jan 26, 2017 8:45 am

Re: TVMosaic addon for LibreELEC

Post by Oberon » Fri Jun 08, 2018 3:34 pm

That should work (and, in fact, it does on your installation).
The only issue that I see in the log file is tvmosaic_server/version.dat, which must be located next to each other.

awiouy
Posts: 14
Joined: Tue Mar 27, 2018 10:25 pm

Re: TVMosaic addon for LibreELEC

Post by awiouy » Fri Jun 08, 2018 3:51 pm

Code: Select all

~/.kodi/addons/service.tvmosaic/bin # ls -al
total 16120
drwxr-xr-x    2 root     root          4096 Jun  8 16:32 .
drwxr-xr-x    7 root     root          4096 Jun  8 16:32 ..
-rwxr-xr-x    1 root     root          1050 Jun  8 16:32 tvmosaic.cli
-rwxr-xr-x    1 root     root        696588 Jun  8 16:32 tvmosaic_reg
-rw-r--r--    1 root     root          4540 Jun  8 17:34 tvmosaic_reg.log
-rwxr-xr-x    1 root     root      15776732 Jun  8 16:32 tvmosaic_server
-rwxr-xr-x    1 root     root          1518 Jun  8 16:32 tvmosaic.start
-rwxr-xr-x    1 root     root          2320 Jun  8 16:32 version.dat

awiouy
Posts: 14
Joined: Tue Mar 27, 2018 10:25 pm

Re: TVMosaic addon for LibreELEC

Post by awiouy » Sun Jun 10, 2018 7:45 pm

I found the issue:
- the LibreELEC build system strips binaries
- TV Mosaic fails when tvmosaic_server is stripped

Stripping tvmosaic_server saves 20 684 834 bytes

Would it be possible to create a LibreELEC release where:
- the binaries are statically built (to avoid having to ship libraries)
- the binaries are stripped

Thank you for your attention

Oberon
Posts: 1130
Joined: Thu Jan 26, 2017 8:45 am

Re: TVMosaic addon for LibreELEC

Post by Oberon » Sun Jun 10, 2018 7:55 pm

- the binaries are statically built (to avoid having to ship libraries)
Unfortunately, not. We must do this to comply with the license terms.
- the binaries are stripped
Yes, it is on our todo list.

Oberon
Posts: 1130
Joined: Thu Jan 26, 2017 8:45 am

Re: TVMosaic addon for LibreELEC

Post by Oberon » Mon Jun 11, 2018 1:08 pm

awiouy wrote:
Sun Jun 10, 2018 7:45 pm
I found the issue:
- the LibreELEC build system strips binaries
- TV Mosaic fails when tvmosaic_server is stripped

Stripping tvmosaic_server saves 20 684 834 bytes

Would it be possible to create a LibreELEC release where:
- the binaries are statically built (to avoid having to ship libraries)
- the binaries are stripped

Thank you for your attention
Build 16296 contains stripped binaries:
viewtopic.php?f=12&t=139

Post Reply