kodi-pvr / pvr.vuplus

Kodi's Enigma2 client add-on
GNU General Public License v2.0
56 stars 55 forks source link
hacktoberfest

License: GPL-2.0-or-later Build and run tests Build Status Build Status

Enigma2 PVR

Enigma2 PVR client addon for Kodi. Enigma2 is a open source TV-receiver/DVR platform which Linux-based firmware (OS images) can be loaded onto many Linux-based set-top boxes (satellite, terrestrial, cable or a combination of these) from different manufacturers. This add-on leverages the OpenWebIf project to interact with the Enigma2 device via Restful APIs.

Multiple E2 devices can be configured via Kodi PVR since Kodi 20 (Nexus). To setup multiple devices simply visit the add-ons settings under Configure, and choose new Add add-on configuration.

Supports streaming of Live TV & Recordings with features such as Timeshifting, EPG, Timers and Autotimers. In addition the majority of Enigma2 devices support viewing and recording IPTV streams. The add-on supports IPTV by simply passing the URL to inputstream.ffmpegdirect, allowing a local timeshift feature similar to native Enigma2 streams.

Note: Some images do not use OpenWebIf as the default web interface. In these images some standard functionality may still work but is not guaranteed. Some features that may not function include:

Some features are only available with at least certain OpenWebIf versions:

The contents of this README.md file are as follows:

  1. Build instructions
  2. Support links
  3. Compatibility with OpenWebIf and other WebIfs
  4. Configuring the addon
  5. Customising Config Files
  6. Appendix

Build instructions

Linux

  1. git clone --branch master https://github.com/xbmc/xbmc.git
  2. git clone https://github.com/kodi-pvr/pvr.vuplus.git
  3. cd pvr.vuplus && mkdir build && cd build
  4. cmake -DADDONS_TO_BUILD=pvr.vuplus -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/build/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
  5. make

The addon files will be placed in ../../xbmc/build/addons so if you build Kodi from source and run it directly the addon will be available as a system addon.

As an alternative to step 4 the following command can be run whic is addon agnostic:

Mac OSX

In order to build the addon on mac the steps are different to Linux and Windows as the cmake command above will not produce an addon that will run in kodi. Instead using make directly as per the supported build steps for kodi on mac we can build the tools and just the addon on it's own. Following this we copy the addon into kodi. Note that we checkout kodi to a separate directory as this repo will only only be used to build the addon and nothing else.

Build tools and initial addon build

  1. Get the repos
    • cd $HOME
    • git clone https://github.com/xbmc/xbmc xbmc-addon
    • git clone https://github.com/kodi-pvr/pvr.vuplus
  2. Build the kodi tools
    • cd $HOME/xbmc-addon/tools/depends
    • ./bootstrap
    • ./configure --host=x86_64-apple-darwin --with-platform=macos
    • make -j$(getconf _NPROCESSORS_ONLN)
  3. Build the addon
    • cd $HOME/xbmc-addon
    • make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS="pvr.vuplus" ADDON_SRC_PREFIX=$HOME

Note that the steps in the following section need to be performed before the addon is installed and you can run it in Kodi.

To rebuild the addon and copy to kodi after changes (after the initial addon build)

  1. cd $HOME/pvr.vuplus
  2. ./build-install-mac.sh ../xbmc-addon

If you would prefer to run the rebuild steps manually instead of using the above helper script check the appendix here

Support links

Logging

When reporting issues a debug log should always be supplied. You can use the following guide: Easy way to submit Kodi debug logs

For more detailed info on logging please see the appendix here

Configuring the addon

Settings Levels

In Kodi 18.2 the level of settings shown will correspond to the level set in the main kodi settings UI: Basic, Standard, Advanced and Expert. From Kodi 19 it will be possible to change the settingds level from within the addon settings itself.

Connection

Within this tab the connection options need to be configured before it can be successfully enabled.

General

Within this tab general options are configured.

Channels

Within this tab options that refer to channel data can be set. When changing bouquets you may need to clear the channel cache to the settings to take effect. You can do this by going to the following in Kodi settings: Settings->PVR & Live TV->General->Clear cache.

Note that channel numbers can be set in the addon based on either:

  1. Their first occurence when loaded, i.e. if a channel appears in multiple bouqets the channel number will be taken from the first bouquet in which it is loaded, any subsequent channel numbers will be ignored. This is useful as regardless of what group you are using in Kodi-PVR you can jump to a channel easily as it will always have the same number.
  2. Bouquet specific channel numbering, i.e. exactly as they appear in the backend. This can be useful when bouquet are used as differnt users (profile-like) lists of channels.

If Kodi PVR is set to use the channel numbers from the backend the numbers will match those on your STB. If this is not enabled each unique instance of a channel will be given the next free number starting from 1 (i.e. the 17th unique channel will be channel 17). Backend channel numbers will only work for OpenWebIf 1.3.5 and later and they have been tested using ABM (AutoBouquetsMaker).

EPG

Within this tab options that refer to EPG data can be set. Excluding logging missing genre text mappings all other options will require clearing the EPG cache to take effect. This can be done by going to Settings->PVR & Live TV->Guide->Clear cache in Kodi after the addon restarts.

Information on customising the extraction and mapper configs can be found in the next section of the README.

Recordings

The following configuration is available on the Recordings tab of the addon settings.

Timers

Using Padding for Timers in Kodi PVR

Using padding for timers allows you to start a recording some time earlier and finish later in case the actual start and/or run time of a show is incorrect. It's important to note that Enigma2 devices allow you set a padding for all timers, both regular timers and autotimers but it only applies to timers created on the Enigma2 device directly. In the case of autotimers it does not matter if they are created from Kodi or directly on the Enigma2 device as new once off timers are generated on the device so will use this default device padding. It is not possible to set padding for autotimers directly in Kodi PVR at present. You can change these settings on your Enigma2 device as follows:

  1. Hit Menu on the remote and go to Setup->Recordings, playback & timeshift->Recording & playback
  2. Set the following options to your chosen values:
    • Margin before recording (minutes)
    • Margin after recording (minutes)

If setting padding in Kodi PVR it's only supported on certain timer types, i.e. Once off time/channel based, Repeating time/channel based and One time guide-based. As the Enigma2 device does not support padding per Timer the tags field is used to store the padding set in Kodi PVR. If a padding value is not set for these timer types the addon will use the Enigma2 devices default padding value instead. So if you have set a value on the Enigma2 device, this can be overidden in the Kodi UI (note, the default from the Enigma2 device does not display in the Add Timer UI, it won't show until after the timer is created and only if no padding values are set).

Timer Types

The addon provides the following types of timers and timer rules that the user can create:

In addition there are some timers that can only be created by the addon and are read only:

Timer settings

The following are the settings in the Timers tab:

Timeshift

Timeshifting allows for native Enigma2 live TV stream to be paused as well as moved back and forward from your current position similar to playing back a recording. The buffer is deleted each time a channel is changed or stopped.

Timeshifting is also available IPTV streams via inputstream.ffmpegdirect. Note that if your IPTV provider restricts the number of active streams each kodi instance viewing it will count as an active stream.

Backend

This category contains information and settings on/about the Enigma2 STB.

Advanced

Within this tab more uncommon and advanced options can be configured.

Customising Config Files

The various config files have examples allowing users to create their own, making it possible to support custom config, other languages and formats. Each different type of config file is detailed below. Best way to learn about them is to read the config files themselves. Each contains details of how the config file works.

All of the files listed below are overwritten each time the addon starts. Therefore if you are customising files please create new copies with different file names. Note: that only the files below are overwritten any new files you create will not be touched.

After adding and selecting new config files you will need to clear the EPG cache Settings->PVR & Live TV->Guide->Clear cache for it to take effect in the case of EPG relatd config and for channel related config will need to clear the full cache Settings->PVR & Live TV->General->Clear cache.

If you would like to support other formats/languages please raise an issue at the github project https://github.com/kodi-pvr/pvr.vuplus, where you can either create a PR or request your new configs be shipped with the addon.

There is one config file located here: userdata/addon_data/pvr.vuplus/genres/kodiDvbGenres.xml. This simply contains the DVB genre IDs that Kodi supports. Can be a useful reference if creating your own configs. This file is also overwritten each time the addon restarts.

Custom Channel Groups (Channels)

Config files are located in the userdata/addon_data/pvr.vuplus/channelGroups folder.

The following files are currently available with the addon:

Note that both these files are provided as examples and are overwritten each time the addon starts. Therefore you should make copies and use those for your custom config.

The format is quite simple, containing a number of channel group/bouquet names.

Provider Name Mappings (Channels)

Config files are located in the userdata/addon_data/pvr.vuplus/providers folder.

The following file is currently available with the addon:

Note that the provided file is a working example but it is overwritten each time the addon starts. Therefore you should make copies and use those for your custom config.

The format is quite simple, containing a number of elements. Each one of those elements can map to name, type, icon path, country codes and language codes.

Season, Episode and Year Show Info (EPG)

Config files are located in the userdata/addon_data/pvr.vuplus/showInfo folder.

The following files are currently available with the addon:

Note: the config file can contain as many pattern matches as are required. So if you need to support multiple languages in a single file that is possible. However there must be at least one pattern and at least one pattern. Proficiency in regular exressions is required!

Genre ID Mappings (EPG)

Config files are located in the userdata/addon_data/pvr.vuplus/genres/genreIdMappings folder.

The following files are currently available with the addon:

Note: that each source genre ID can be mapped to a DVB ID. However multiple source IDs can be mapped to the same DVB ID. Therefore there are exactly 256 elements in each file as a genre ID is 8 bits. All values are in Hex. The first fours bits are the genreType in Kodi PVR and the last four bits are the genreSubType.

Rytec Genre Text Mappings (EPG)

Config files are located in the userdata/addon_data/pvr.vuplus/genres/genreRytecTextMappings folder.

The following files are currently available with the addon:

Note: the config file can contain as many mappings as is required. Currently genres are extracted by looking for text between square brackets, e.g. [TV Drama], or for major, minor genres using a dot (.) to separate [TV Drama. Soap Opera]. The config file maps the text to a kodi DVB genre ID. If the full text cannot be matched it attempts to match just the major genre, i.e. "TV Drama" in the previous example. If a mapping cannot be found the text between the brackets will be used instead. However there will be no colouring in the Kodi EPG in this case.

Appendix

Manual Steps to rebuild the addon on MacOSX

The following steps can be followed manually instead of using the build-install-mac.sh in the root of the addon repo after the initial addon build has been completed.

To rebuild the addon after changes

  1. rm tools/depends/target/binary-addons/.installed-macosx*
  2. make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS="pvr.vuplus" ADDON_SRC_PREFIX=$HOME

or

  1. cd tools/depends/target/binary-addons/macosx*
  2. make

Copy the addon to the Kodi addon directory on Mac

  1. rm -rf "$HOME/Library/Application Support/Kodi/addons/pvr.vuplus"
  2. cp -rf $HOME/xbmc-addon/addons/pvr.vuplus "$HOME/Library/Application Support/Kodi/addons"

Logging in detail

Some of the most useful information in your log are the details output at the start of the log, both for Kodi and the addon.

The first 5 lines of the log give details on the exact kodi flavour and version you are running:

01:10:45.744 T:140736264741760  NOTICE: -----------------------------------------------------------------------
01:10:45.744 T:140736264741760  NOTICE: Starting Kodi (18.0-BETA2 Git:20180903-5d7e1dbd9c-dirty). Platform: OS X x86 64-bit
01:10:45.744 T:140736264741760  NOTICE: Using Debug Kodi x64 build
01:10:45.744 T:140736264741760  NOTICE: Kodi compiled Sep  5 2018 by Clang 9.1.0 (clang-902.0.39.2) for OS X x86 64-bit version 10.9.0 (1090)
01:10:45.745 T:140736264741760  NOTICE: Running on Apple Inc. MacBook10,1 with OS X 10.13.6, kernel: Darwin x86 64-bit version 17.7.0

Secondly all the information of the Enigma2 image, web interface version etc. is also output:

12:36:55.888 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - Open - VU+ Addon Configuration options
12:36:55.888 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - Open - Hostname: '192.168.1.201'
12:36:55.888 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - Open - WebPort: '80'
12:36:55.888 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - Open - StreamPort: '8001'
12:36:55.888 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - Open Use HTTPS: 'false'
12:36:56.308 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - LoadDeviceInfo - DeviceInfo
12:36:56.308 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - LoadDeviceInfo - E2EnigmaVersion: 2019-01-03
12:36:56.308 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - LoadDeviceInfo - E2ImageVersion: 5.2.022
12:36:56.309 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - LoadDeviceInfo - E2DistroVersion: openvix
12:36:56.309 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - LoadDeviceInfo - E2WebIfVersion: OWIF 1.3.5
12:36:56.309 T:123145422725120  NOTICE: AddOnLog: Enigma2 Client: pvr.vuplus - LoadDeviceInfo - E2DeviceName: Ultimo4K

Description of Log levels

Cleaning up the log

(If you have a fresh install of version 3.15.0 or later you can ignore this)

As the addon was upgraded over time some old settings are no longer required. These old settings can create a lot of extra logging on startup. To date there are four of these and they will present like this in your log:

23:17:22.696 T:3990016880   DEBUG: CSettingsManager: requested setting (extracteventinfo) was not found.
23:17:22.696 T:3990016880   DEBUG: CAddonSettings[pvr.vuplus]: failed to find definition for setting extracteventinfo. Creating a setting on-the-fly...
23:17:22.696 T:3990016880   DEBUG: CSettingsManager: requested setting (onegroup) was not found.
23:17:22.696 T:3990016880   DEBUG: CAddonSettings[pvr.vuplus]: failed to find definition for setting onegroup. Creating a setting on-the-fly...
23:17:22.696 T:3990016880   DEBUG: CSettingsManager: requested setting (onlyonegroup) was not found.
23:17:22.696 T:3990016880   DEBUG: CAddonSettings[pvr.vuplus]: failed to find definition for setting onlyonegroup. Creating a setting on-the-fly...
23:17:22.697 T:3990016880   DEBUG: CSettingsManager: requested setting (setpowerstate) was not found.
23:17:22.697 T:3990016880   DEBUG: CAddonSettings[pvr.vuplus]: failed to find definition for setting setpowerstate. Creating a setting on-the-fly...

If you see these in debug mode and would like to clean them up you can either:

  1. Remove the offending lines from you settings.xml file OR
  2. Delete you settings.xml and restart kodi. Note that if you use this option you will need to reconfigure the addon from scratch.

Your settings.xml file can be found here: userdata/addon_data/pvr.vuplus/settings.xml