Kodi Community Forum

Full Version: XBMC.RunScript in kemap takes too long to start
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I hav the following in keymap

Code:
<keymap>
  <global>
    <keyboard>
      <z>XBMC.RunScript(/home/knst/noolite.py)</z>
    </keyboard>
  </global>
</keymap>

When I press 'z' about 1min passes before script is executed. Is it possible to ran script immediately?
Have you confirmed it's not the script itself that is taking 1 minute to complete execution? Check your debug log (wiki) to see when the shortcut key was pressed and when the script was executed. You can also add your RunScript command to a favourite and launch it from the Favourites menu. If it takes a minute to run from there as well, then the delay is not from keymapping.
Scripts take less then a secod to execute (added logging to verify)

Looks like I've found the problem. After startup xbmc indexes all the files it can reach. Even in the sources with no content type selected:

Code:
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/man/cat9
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/man/mann
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/libdata
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/libdata/ldconfig32
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/libdata/ldconfig
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/libdata/pkgconfig
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/libexec
23:58:58 T:2938100592   DEBUG: OpenDir - Using authentication url smb://FREENAS/FileStorage/FreeNasPlugins/Jail/jail1/mnt/plugins/pbi/transmission-amd64/mnt

I've added whole NAS as source, it makes indexing take 30min, during this time xbmc consumes 100% CPU...
It was not xbmc, but watchdog add-on (http://wiki.xbmc.org/index.php?title=Add-on:Watchdog) which polls smb shares to detect new content.
Turned it off and log is clear, CPU consumption is gone, script starts immediatley both from favorites and keymapping.

I'd say it is a bug of add-on - there is no need to poll sources without content type, but I have not found where I can report it.

As workaround, I've set up peridical library update and clean instead. Turning light in the room on/off with remote control (script sends command to usb device controlling the light) worth the inconvenience of having delay between new movie stored on NAS and xbmc recognizes it Smile