Error: LE 8.2.5 -> 9.2.5 constant library re-scan on data source entry

  • Hello everybody,

    I have a slight problem after upgrading from LE 8.2.5 (Kodi 17.6) to 9.2.5 (Kodi 18.8) on my Pi 4.

    Already having asked that in the Kodi forum, they could not find the source of this error and asked me to post it here, it might have sth to do with LE.

    Original posting over in the Kodi forum:


    ----

    After migrating from Kodi 17.6 (Libreelec 8.2.5) to Kodi 18.8 (Libreelec 9.2.5) I have aproblem with Kodi always re-scanning all the media files after entry into a datasource.

    Clarification:


    Storage is mounted via SMB smb://storage/files, there are around 1000 files stored there.


    Datasource for said SMB share is created.


    On entry into that datasource, kodi 18.8 starts scanning the files and increments the total runtime of all videos and as well updates the media flags(HD or SD) for every file.


    This is done every time I enter that datasource and takes around 45s.


    This was not the case with Kodi 17.6, upon re-entering that datasource, the runtime as well as the media flags/tags (HD or SD) were already present and are not updated/re-scanned.


    Settings have not been changed by me after upgrade.----

    Complete kodi debugging logs from system bootup until entering that datasource a few times can be found here:

    hastebin

    Would be great if somebody knew what is going on, because this keeps me from using 9.2.5 and I am still stuck with 8.2.5.

    Thanks for any help.

  • The log doesn't shows related errors. Maybe you have to increase cache to avoid re-scanning. Try this at advancedsettings.xml:

    Code
    <advancedsettings>
        <cache>
            <memorysize>139460608</memorysize>
            <buffermode>1</buffermode>
            <readfactor>20</readfactor>
        </cache>
    </advancedsettings>
  • Thanks for the tip, however the final problem remains.

    But something is different.

    I have my disks set to sleep. With this setting kodi starts scanning the files and incrementing runtimes, without waking up my disks. half way through the scaning process, my disks wake up.

    Without that setting the disks are woken up as soon as the scan starts.

    Plus, the watchdog seems to restart kodi during the scan, because waking the disks up in the middle of rescan seems to trigger a timeout as nothing happens during disk spin up....

  • I beg to differ. The result is always the same! Scanning the file library (local database on the raspberry) all over again and adding up the runtimes. This was done in a fraction of a second on LE 8.2.5 but can be seen (times adding up rapidly, then media tags appearing after that). I cannot see how that would change with adding buffers for files/drives.

    The mentioned advancedsettings.xml setting does seem to only have effect to stream buffering and does not influence any kodi DB reading at all....

  • When you read the doc, it says that cache settings can be relevant (2.8.5 cache -> buffermode). Please try this advancedsettings.xml:

    Code
    <advancedsettings>
        <samba>
            <statfiles>false</statfiles>
        </samba>
        <cache>
            <buffermode>4</buffermode>
        </cache>
    </advancedsettings>

    This should optimize SMB access for big file amount.

  • Thanks for the hints, but the problem is persisting. Due to disabling statfiles, it has gotten even worse.

    Now LE seems to need to access not only the video DB on the raspberry, but also every single video file on the samba storage. It slows down to the point when the watchdog resets kodi....

  • Next things you can try:

    1) disable buffering (<buffermode>3</buffermode>)

    2) test latest nightly builds (maybe it's already fixed)

    3) if 1) and 2) fails, provide a link to a complete log file

    Let me clarify what I do, maybe there is a misunderstanding or I am doing something wrong:

    From the main screen: VIDEOS->Files->(select datasource+enter)->list of videos is showed and runtimes is being read from local kodi DB and added up

    That last step , showing the runtimes of the files, was shown in a fraction of a second on LE 8.2.5


    Results as from the steps above:

    1) same as before, every single file on the storage will be touched/read as soon as datasource is opened for the files to be displayed.

    2) tried latest nightly for RPi4, LE 9.8 , the problem is still there.

    3) full debug log of previous tries with LE 9.2.5 can be found here: hastebin

    However I created a new debug log for LE 9.8, just in case hastebin

    Just booted up, went to videos->files->my datasource (smb://storage/files) and left and entered again, then shut down.