Videos starting slow from SMB share

What is written below does not work, because the function that scans for local subtitle files in the movie folder is hard-coded to always run. The function CUtil::ScanForExternalSubtitles can be found in the Kodi source code file util.cpp on github: https://github.com/xbmc/xbmc

The subtitle extensions Kodi scans for are hard-coded in source code file AdvancedSettings.cpp in global variable m_subtitlesExtensions and cannot be set using e.g. advancedsettings.xml.

The only workaround is to divide homevideos over subfolders, e.g. per year, with a maximum of about 500 videos per folder, to keep the load on an acceptable level.

Old post:

(Home)videos can be stored on an external SMB device and added as a "source" to OpenElec/Kodi on a Raspberry Pi 2.

If those videos load extremely slow, while the CPU and the Wifi or cabled network connection have capacity enough, then this might be caused by:
  1. The spinning up/down of the external disk the source is pointing to
  2. The search for subtitle files on the external storage
The disable the search for subtitle files (written using Openelec 14.2):

1) In Kodi using the "Eminence" skin, enable logging under settings -> system -> debugging ->
  • enable debug logging: true
  • enable component specific logging: true
    • specify component-specific logging: "verbose logging for the SMB library"
2) Start a video from the SMB source
3) On a Windows client, use a SFTP-capable client like Filezilla to connect to the Raspberry Pi with these settings:
  • host: IP address of the Raspberry Pi, e.g. 192.168.0.95
  • protocol: sftp
  • user: root
  • password: openelec
4) Navigate to path: /storage/.kodi/temp and download the file kodi.log
5) Open kodi.log using a text editor and search for "ScanForExternalSubtitles: END". If the "total time" is more then say 10000 ms, then Kodi is trying to search for a subtitle file, e.g. movie.srt. There probably are none for a home movie, so this is not necessary
6)  In Kodi under settings -> video -> subtitles ->
  • subtitle storage location: custom location
  • customer subtitle folder: set to a local, empty folder, e.g. /home/screenshots
  • pause when searching for subtitles: disable

There might also be a difference between drives, used file system, and the number of files in the source folder.

My Seagate Expansion Portable (STBX2000401) 2TB USB disk on NTFS reports ~200ms for subtitle search, while my WD MyPassport 2TB on FAT32 reports ~13000ms subtitle scan time.

Create RSS feed from Microsoft Live Calendar and Google Calendar

In Microsoft Calendar:
  • Click "Share" on the top menu bar and select the calendar to share
  • Under Share, click Get link. If this has already been done, the message "You've already created all possible link types" appears. If both cases, continue with next step
  • Under Permissions, click Links to event details and select and copy the URL from the ICS textbox.

The URL from XML only contains a random subset of calendar events and can therefore not be used directly as a complete RSS feed.

That is why Google Calendar is needed:

In Google Calendar:
  • On the main page, click on the down arrow next to Other Calendar and click "Add by URL"
  • Paste the ICS link from the Microsoft Calendar. Replace the "webcal://" prefix with "http://". Enable "Make calendar publicly available?"
  • Wait for the calendar to be added and click on the down arrow next to it
  • In the section "Calendar Address", click on Change sharing settings and select "Make this calendar public" and press Save
  • Again, click on the down arrow next to the calendar that was just added
  • In the section "Calendar Address", click on the XML icon and copy the link
  • Test the link in a browser by pasting it. Add "?max-results=99999" at the end of the URL to get all events.
By default only the 25 most recently changed events are shown. To get all events in the RSS feed:
www.google.com/calendar/feeds//private-/basic?max-results=99999