Posts by DeltaMikeCharlie

    Just be advised that the moment there's upstream movement on a TVH 4.4 release we will be dropping the TVH 4.2 add-on (as 4.2 will no longer be the 'stable' TVH release). It would be better to develop against the 4.3 add-on.

    Thanks, I have already planned for that. The addon names are held in an external python file that only sets a few default values and can be easily created/edited via a script and basic tools. This file could be easily created/updated by a build script as version numbers progress if the addon is one day shipped as part of LE.

    The external file will also be useful if the addon is used as the basis for a NextPVR Quick Start guide.

    I hope that I am ready for the first public test of my addon so I am seeking volunteers who may be interested in testing this addon.

    Be warned: This addon is intended to be run on a pristine, newly installed system so it will do some significant damage if run on a running system. Testers should be prepared to backup/restore their live system or use a test/development system instead.

    Here are the steps that the addon takes:

    • Check to see that Kodi addons ‘service.tvheadend42’ and ‘pvr.hts’ are installed and enabled. If they are not installed, install them automatically answering user prompts. If they are installed but not enabled, enable them (You never know!).
    • If installation of the above addons fails, abort after presenting an error message to the user.
    • Check if parental rating labels are supported. Suppress the option if not.
    • Get the local IP address to display in the window sub-heading.
    • Check that there are adapters connected. If not, notify user and loop until the user connects adapters or exits.
    • Get the Kodi language and convert that into the closest TVH UI language.
    • Get the LibreELEC host name.
    • Automatically prompt the user to select a tuner type only showing the tuner types for the detected adapters.
    • Depending on the tuner type selected, automatically prompt the user for the first location category. This could be country or satellite longitude, etc.
    • Automatically prompt the user for the next location category. This could be geographical region, cable TV provider or satellite name.
    • If this version of TVH supports the feature, automatically prompt the user to enable parental rating labels, otherwise, skip this step.
    • Highlight the ‘Configure’ button.
    • Ask if the user really wants to proceed.
    • Perform configuration:
      • Set TVH UI language.
      • Set TVH server name.
      • Create a new TVH ‘Network’ of the appropriate type automatically associating the muxes from the selected location categories with that network.
      • Attached the new network to the adapters matching the selected adapter type.
      • Initiate a service scan time-limited according to the number of muxes.
      • Provide the user with a scan progress.
      • For successfully scanned services, rescan the source mux if no LCNs are present. Scanning a maximum of 3 scans.
      • If no services are found, display a message then exit.
      • If the user selected Australia as the country, set the OTA genre translations. If the TVH version does not support this feature, this request will be ignored by TVH.
      • If parental rating labels are supported and enabled by the user, enable the feature. Also search for pre-defined rating labels for the selected country and load those if found.
      • Automatically map every service to a channel.
      • Automatically create a channel tag for each mux that has services.
    • Notify the user that the setup is complete.
    • Change to the EPG grid view.

    To install the addon, copy the zip file to your system and install it using the ‘Install from zip file’ option. You may be prompted to allow addons from unknown sources.

    Once installed, you into Add-ons/My add-ons/Program add-ons, run ‘TVHeadEnd PVR Quick Start’ and follow the prompts.

    Both English and German should work. I plan to add French, Spanish and Czech.

    The addon is currently too large to attach here. I need to shrink some images. Instead, it can be downloaded from my GitHub repository: https://github.com/DeltaMikeCharl…pt.quicktvh.zip

    petediscrete - Thanks for the feedback.

    Based on your figures, you are averaging 26 seconds per mux. This is almost twice the time that I am allowing before taking my arbitrary limit into account. I definitely need to reconsider my approach!

    I think that I will still calculate the maximum time that a scan can last for, but remove the cap. In addition to this, I will give the user the option to abort the scan and then either exit completely or just map the services that have already been discovered to channels.

    For your particular setup, a scan could last for close to 2 hours with multiple passes to catch LCNs.

    Whilst I am sure that the time that it takes the adapter hardware to retune for each mux may play a role in the duration of a scan, I also think that the frequency with which the provider broadcasts the DVB table that contains the service information also plays a big role.

    I just with the "Generic - Australia" set of DVB-T muxes. This contains about 100 mux definitions and I was able to scan them all, including LCNs, in around 5 minutes. When I review my log file, I can see that the first scan of a mux did not always finds LCNs and that some muxes were scanned multiple times.

    With respect to LCNs: Do you use them? Does your broadcaster supply them?

    I may add an option “Extra scans for missing LCNs” and allows the user to set between 0 to 3 additional scans for muxes with services but no LCNs.

    I have decided to name it a "PVR Quick Start" rather than a "Wizard" because I think that it will translate with a clearer meaning and a "Quick Start" is a more modest claim than a 'Wizard".

    I’ve made most of the transition from my prototype stand-alone script to a Kodi-aware script addon.

    The green items are complete and the red items are outstanding.

    Once a red item is complete, it turns green and the next item is requested.

    One thing that I noticed during my initial development and also with the Kodi addon is that when TVH scans for services, it does not always capture the LCN (logical channel number) on the first attempt. Sometimes it can take up to 3 attempts to successfully scan services with their LCNs.

    The result that I get is that every service on a mux will be missing their LCNs. As tuning progresses, I check for the presence of LCNs on the scanned services and schedule a mux to be re-scanned if LCNs are not found for that mux. If a mux has no services, it is skipped for all future scans. I do this up to 3 times for each mux before abandoning the process.

    I also time-limit this exercise. I take the number of muxes, multiply by 3 and then allow 15 seconds per mux. If this calculated time exceeds 2 minutes, then I cap the process at 2 minutes.

    This works fine for my DVB-T system with 6 muxes (5 active) yielding 57 services. However, my previous experience with Topfield PVRs, suggests that DVB-C and DVB-S users may have many dozens of muxes providing hundreds, if not thousands of services.

    Some questions for DVB-C and DVB-S users:

    • Do you think that 15 seconds per mux is sufficient?
    • How long does a standard TVH scan take if you were to use the existing TVH wizard?
    • Do your broadcasters supply LCNs?
    • Are LCNs important to you?
    • Does anyone have multiple cable or satellite providers connected to their system.

    Why would that be needed on LE especially if you are trying to simplify things?

    I was referring to a change to TVH. The default location for TVH’s data files is something like ‘/home/<user>/config/.hts’ and for the LE addon, it is changed to something like ‘/storage/.kodi/addons/service.tvheadend42’.

    Having a command line switch in the TVH executable to change the default data location would allow for easier configuration for LE as well as allowing for multiple configurations on a system while testing.

    emveepee - I’m a little confused. I get my scan tables via the TVH JSON API.

    http://<TVH>:9981/api/dvb/scanfile/list?type=dvb-t

    I’m not sure where TVH gets that data from.

    Are you saying that in the process of building the LE TVH addon, that LE download and insert the updated scan tables into their build of the TVH server somehow?

    On my LE Dev box, I can see the scan files in:

    Code
    /storage/.kodi/addons/service.tvheadend42/dvb-scan/dvb-t/au-Sydney
    /usr/share/dvbv5/dvb-t/au-Sydney
    Code
    LEDev:~/.kodi/addons/service.tvheadend42/dvb-scan # ls -laF
    total 108
    drwxr-xr-x    7 root     root          4096 Dec 17 07:40 ./
    drwxr-xr-x    9 root     root          4096 Dec 17 07:41 ../
    drwxr-xr-x    2 root     root          4096 Dec 17 07:40 atsc/
    drwxr-xr-x    2 root     root          4096 Dec 17 07:40 dvb-c/
    drwxr-xr-x    2 root     root          4096 Dec 17 07:40 dvb-s/
    drwxr-xr-x    2 root     root         36864 Dec 17 07:40 dvb-t/
    drwxr-xr-x    2 root     root         53248 Dec 17 07:41 isdb-t/

    I assume that TVH parses the file name to extract the ISO 3166-1 alpha-2 value and then converts that to the country name for presentation via the API. Alternately, TVH may parse the content of the scan files because there are some location descriptions within the comments. I have not looked into it.


    Looking at how the scan table ‘vals’ are composed via the TVH API:

    DVB-T = Country:Region

    DVB-C = Country:Cable Provider

    DVB-S = Longitude:Satellite name

    Code
    }, {
        "key": "dvb-s/geo/dvb-s_> 76.5E:Telstar10_C",
        "val": "> 76.5E:Telstar10_C"
    }, {
        "key": "dvb-s/geo/dvb-s_> 75.0E:ABS1",
        "val": "> 75.0E:ABS1"
    }, {
        "key": "dvb-s/geo/dvb-s_> 72.0E:Intel4",
        "val": "> 72.0E:Intel4"
    }, {

    ATSC-T = Country:Region or Protocol

    Code
           }, {
               "key": "atsc-t/ca/atsc-t_ca-ON-Toronto",
               "val": "Canada: ca-ON-Toronto"
           }, {
               "key": "atsc-t/us/atsc-t_us-ATSC-center-frequencies-8VSB",
               "val": "United States: us-ATSC-center-frequencies-8VSB"
           }, {

    ATSC-C = Country:Protocol

    Harmonic Related Carrier (HRC)
    Incremental Related Carrier (IRC)

    ISDB-T = Country:Region

    Code
           }, {
               "key": "isdb-t/ar/isdb-t_ar-Argentina",
               "val": "Argentina: ar-Argentina"
           }, {
               "key": "isdb-t/br/isdb-t_br-Brazil",
               "val": "Brazil: br-Brazil"
           }, {
               "key": "isdb-t/br/isdb-t_br-ac-Bujari",
               "val": "Brazil: br-ac-Bujari"
           }, {

    I will make the Wizard split into the same categories provided by the TVH API and label the buttons/steps accordingly.

    With respect to users 'getting stuck': Perhaps an extensive 'try every combination' approach would be required. Unfortunately, that could take hours to do a scan. Every mux has a frequency, then several possible bandwidths for that frequency, then several possible encoding parameter variations.

    emveepee - ‘Tuner Type’ is a good suggestion, especially when it comes to localisation because ‘transport’ could also mean bus, train, etc. Thanks.

    The big box to the right of the screen is a flexible space. Perhaps Country and Region could be combined into that space with Country being a dropdown and Region being a list box populated based on the country selected.

    I use the TVH API to determine country and region:

    }, {
        "key": "dvb-t/au/dvb-t_au-Sutherland",
        "val": "Australia: au-Sutherland"
    }, {

        "key": "dvb-t/au/dvb-t_au-Sydney",
        "val": "Australia: au-Sydney"
    }, { . . . . . . 

        "key": "dvb-t/se/dvb-t_se-Sundsvall_S_Stadsberget",
        "val": "Sweden: se-Sundsvall_S_Stadsberget"
    }, {

    If TVH is updated to use the new scan tables then the wizard may need to be reviewed.

    If the scan tables are incorrect or absent, then the user will need to perform a manual configuration directly in TVH unfortunately. As I am basing my wizard on the scan tables that TVH knows about, then the user would probably be stuck unless they know their local frequencies, etc.

    I will freely admit that IPTV is a big blind spot for me. We do have an IPTV service in our house, but it is part of a proprietary set-top-box provided by our ISP. Perhaps if ‘IPTV’ is selected as the tuner type then the Country/Region button/s can be named to something else and the flexible area updated accordingly.

    petediscrete - Thank you for your kind words.

    I do not intent to abandon TVH and I have a list of potential improvements on my todo list. I just like some variety from time to time.

    I also have a number of Kodi PRs that are on hold until the current release cycle is finalised. Once the next Kodi release is open for development, I will give those some more attention.

    I do realise that TVH is a stand-alone project unrelated to LE. However, LE also has a Kodi binary addon that neatly packages a TVH installation. My primary objective would be to get DVB-T working and then see where that leads to.

    I only have access to a DVB-T system. In order to test DVB-C and DVB-S systems, I will have to rely on the kindness of forum members to provide feedback. When it comes to ATSC, IPTV and other transports, that may be a task for developers with better and/or region-specific knowledge.

    I still would like to see what happens with tvh2kodi before getting too carried away.

    I have been thinking about the architecture and specifically, how may addons are required and what their function will be. My thoughts are as follows:

    1) Existing LE First-Run Wizard
    2) Central PVR Wizard, responsible for asking ‘Which PVR’
    3) Individual customised wizards for each PVR.

    My initial thought was to have 2) above incorporated into 1), however, I perceive reluctance to change this in a major way.

    Having a separate central PVR Wizard will also allow users to revisit the decision should they choose to do so. It may also allow them to uninstall a PVR should they choose.

    The central wizard will be data-based. That is, the selection of available PVRs will not be hard-coded. IT will be provided in a configuration file or read directly from the LE addon repository.

    Regardless of the availability of a step-by-step wizard for a particular PVR, the bare minimum function would be to load the PVR server and the PVR client addons. For example ‘service.tvheadend42’ and ‘pvr.hts’ for TVH.

    For PVRs without a step-by-step wizard, perhaps a ‘what to do next’ window could be displayed.

    Attached are my thoughts on the workflow layout. Colours, text, icons, etc, yet to be determined.

    I managed to clear all the bugs that were stopping me from running the tvh2kodi DVB-T Wizard (there may be other unrelated bugs). Here are the steps that the wizard takes:

    • Start Wizard
    • (Are you sure?)
    • Select a single tuner
    • Select location mux list
    • (Full scan plus progress)
    • (Report on number of channels created with a message “You can now enable additional tuners in the adapters menu”)

    In addition to this, the Wizard silently created ‘Channel Tags’ within TVH for HD, SD, TV & Radio channels.

    What follows is a comparison, not really a critique per se:

    It only configures a single adapter. If you have multiple adapters servicing the same transport, the others will need to be enabled manually or have the Wizard run a second time. My wizard grouped the adapters by protocol and processed all of the adapters in that group.

    The UI language is not set in TVH based on the Kodi language. TVH remains as English. Some of the Kodi dialogue boxes are localised, however, the vast majority of the addon is in English, hard-coded in the scripts.

    The TVH server name is not set. This is not really a big deal though.

    The muxes are presented in a single 1119 item list not separated by country. Great for me in Australia, not so great for people in Vietnam. My wizard was going to group be country and then region.

    My wizard did not yet create channel tags, however, I was planning to create tags by provider name.

    At the mux selection stage, the 'Cancel' button does nothing. The Wizard just keeps going.

    Thanks to everyone who provided feedback.

    At the start of this process, I did have a vague recollection of a Kodi addon to manage TVH. I remember having installed it once, but for reasons that I can not remember, I uninstalled it and went on with my life.

    I tried to install tvh2kodi again yesterday, but it crashed because of a deprecated Kodi function. It seems that it has been updated for Matrix, but not Nexus. tvh2kodi claims to have a setup wizard, so if that can be made to work then I need not continue with my idea.

    I took a quick look into the tvh2kodi bugs and I fixed several problems. However, every problem I fixed just uncovered a new one until it lead to a problem with an external dependency so I stopped there. I think that tvh2kodi needs some remediation to get it working again.

    Unless the ‘PVR Setup Wizard’ is either part of, or run from, the LE ‘First Run Wizard’, then its value to end users is reduced. If the user needs to finish the LE wizard and then load a Kodi addon manually, they may as well just load the PVR back/front-ends of their choice manually and get on with their day. I have no interest in creating an LE fork just for that.

    I need to reconsider my approach. If tvh2kodi can be revived, then that is my referred option as it already has the functionality that I proposed for the TVH part. Perhaps it can be modified to detect that it is running on an LE system and adapt accordingly, or, perhaps if there ever is an LE ‘PVR Wizard’ then it can call the tvh2kodi wizard with a parameter.

    I’ve been working on the concept of a PVR Setup Wizard to aid users in configuring a basic PVR using LibreELEC. The idea is that the users will be able to setup a simple PVR from scratch with little effort.

    Bits and pieces of this already exist, however, I’d like to try to consolidate these pieces so that a new user can setup a ‘default PVR’ quickly and easily with LibreELEC out-of-the-box via the Kodi interface.

    I have already built a prototype Python script to do this for Tvheadend. I’d like to hear some options regard the merits of this idea and whether it is worth pursuing for other backends.

    Part One

    Expand the existing LibreELEC setup wizard to ask the user if they want to install a PVR. If the user answers positively, they would continue into the PVR Setup wizard.

    From what I have found, LE seems to have 3 PVR servers that can be run as Kodi addons (NextPVR, Tvheadend and VDR), there may be more, these are just what I have found so far. Furthermore, it seems that only Tvheadend in installed in the LE image. The others needs to be installed from the LE repository.

    I think that the user question would be something like “Which PVR would you like to install?” providing a list of available PVR servers with “None” being the first and default option. Based on this selection, the appropriate Kodi PVR server and client addons will be installed by the existing TVH setup wizard script.

    Part Two

    Each of the LE PVR server addons will be updated with their own setup wizard that will run when first loaded. I have already mostly completed this step for Tvheadend.

    In my TVH wizard, I perform the following steps:

    • Set the TVH GUI language to be the same as the Kodi GUI language, defaulting to ‘eng_GB’ if there is no suitable equivalent.
    • Set the TVH server name to be the same as the LE hostname.
    • Fetch the tuner adapters that TVH has auto-detected and work out which transport (DVB-T, DVB-C, etc) they support.
    • Give the user the choice of ONE of these transports.
    • Based on the selected transport, list the Country and then Region for the pre-defined muxes.
    • Create a new ‘Network’ connected to the adapters of the selected transport and link in the selected pre-defined muxes for the transport/country/region.
    • Perform a scan for services. This is not always successful the first time, so that runs in a loop until all services have an LCN or a timeout is reached.
    • Create a channel for every service.
    • Perform an initial EPG scan.

    I’m thinking of adding an easy way to configure the EPG scan interval too.

    This was very specific to TVH. I suspect that other PVRs will follow a similar logic, but that all of the details will be customised to each PVR’s architecture.

    Running the script on a remote system, I was able to get a virgin LE system (with TVH server and client manually installed for testing purposes), to the stage where the EPG grid in Kodi could be seen populating in real-time as the first EPG scans occurred.

    Thoughts, opinions and comments welcome.