Autoplay Radio channel not working (worked in OpenElec)

  • Hi,
    I recently upgraded to a WetekPlay2 and am using LiberELEC.
    On my "old" WetekPlay I used this autoexec.py

    Code
    ~
    import xbmc
    xbmc.executebuiltin('XBMC.PlayMedia(pvr://channels/radio/All channels/pvr.hts_824822099.pvr)')

    To automatically start a radio channel after startup and works like a charm (box is running OpenElec 7.0.1 and Kodi 16.1)


    On my new box Running LibreElec RB beta3 & Kodi 17 I tried a lot of things, radio channel works fine, but no way it is automatically starting at startup using this autoexec.py

    Code
    import xbmc
    
    
    xbmc.executebuiltin("PlayMedia(pvr://channels/radio/All channels/pvr.hts_1595007353.pvr)")


    Anyone who can point me in the right direction ?
    My guess it's a syntax issue (I hate python for it) but there are so many different examples and the Kodi WiKi is not clear what to use with which version ..

    Your help is much appreciated !

  • Any errors in /storage/.kodi/temp/kodi.log?

    You can get more information by enabling debug logging in /storage/.kodi/userdata/advancedsettings.xml:

    Code
    <advancedsettings>
    <loglevel hide="true">1</loglevel>
    </advancedsettings>

  • Any errors in /storage/.kodi/temp/kodi.log?

    You can get more information by enabling debug logging in /storage/.kodi/userdata/advancedsettings.xml:

    Code
    <advancedsettings>
    <loglevel hide="true">1</loglevel>
    </advancedsettings>



    I need to check this, will do so tonight.. thanks for this.

  • This is what the log tells me, no obvious reason.

    Enabled the debug / full logging and found out that PVR plugin loaded later than the autoexec.py was executed.

    Code
    01:00:25.240 T:3854447520 WARNING: CPythonInvoker(2): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This be
    haviour will be removed in future version.
    01:00:25.543 T:3906991008 WARNING: CSkinInfo: failed to load skin settings
    21:06:24.773 T:4117798912   ERROR: CApplication - PlayMedia PVR manager not started to play file 'pvr://channels/radio/All channels/pvr.hts_1595007353.pvr'
    21:06:24.773 T:4117798912   ERROR: PlayMedia could not play media: pvr://channels/radio/All channels/pvr.hts_1595007353.pvr

    So I added

    xbmc.sleep(5000)
    And that fixed the issue :)

    Thanks for helping out !

    For future reference this is my working autoexec.py :

    Code
    import xbmc
    xbmc.sleep(5000)
    xbmc.executebuiltin("PlayMedia(pvr://channels/radio/All channels/pvr.hts_1595007353.pvr)")

    Edited once, last by Maikel (March 9, 2017 at 8:20 PM).