inputstream.adaptive not starting correctly

  • I am using LE 9.2 Generic x64 with the Teleboy PVR Client Addon which has some dependencies on inputstream.adaptive Addon.

    Now the problem is that inputstream.adaptive is not starting as it should.

    To get the Teleboy PVR Client to work I have to do the following steps everytime I reboot LE:

    • Disable Teleboy PVR Client addon
    • Disable inputstream.adaptive addon
    • Enable inputstream.adaptive addon
    • Enable Teleboy PVR Client addon

    As you can imagine this is not really an acceptable solution after every reboot. Is there a way I can automate this by a script or something? Any suggestions?

  • I found a way to automate this. What I did:

    Create a shell script:

    Code
    nano /storage/<myScriptFolder>/<myScript>.sh

    Added the following content:

    Bash
    #!/bin/bash
    curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.teleboy", "enabled": false }, "id": 1}' http://localhost:8080/jsonrpc
    sleep 1
    curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "inputstream.adaptive", "enabled": false }, "id": 1}' http://localhost:8080/jsonrpc
    sleep 1
    curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "inputstream.adaptive", "enabled": true }, "id": 1}' http://localhost:8080/jsonrpc
    sleep 1
    curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.teleboy", "enabled": true }, "id": 1}' http://localhost:8080/jsonrpc

    Saved the file, exit the editor and then made the script executable by running the following command:

    Code
    chmod +x /storage/<myScriptFolder>/<myScript>.sh

    Now, in my case, as I have multiple kodi profiles, the start of the Teleboy PVR and inputstream.adaptive addon are profile dependent, which means that they are started only after the according user did login.

    I found out that it is not possible to run a shell script directly and automatically in the background after a user has logged in so I had to create for every according profile an autoexec.py which is user profile dependent by default and is executed immediately after a user did login. So what I did was:

    Create the autoexec.py directly inside the according profile folder...

    Code
    nano /storage/.kodi/userdata/profiles/<myUser>/autoexec.py

    ...and adding the following content:

    Code
    import time
    import subprocess
    time.sleep(10)
    subprocess.call("/storage/<myScriptFolder>/<myScript>.sh")

    Saved the file, exit the editor and then made the autoexec.py executable by executing:

    Code
    chmod +x /storage/.kodi/userdata/profiles/<myUser>/autoexec.py

    Note: The time function is needed for adding a delay as in this special case it is necessary to wait until the Teleboy PVR and the inputstream.adaptive addons have fully started once. Otherwise, if you interrupt the start processes too early, they will not work correctly after disabling and enabling again.

    Hope this workaround helps someone.