[RPi4] Weird delay on first play after start

  • Hi everyone.

    My apologies if this was discussed elsewhere, but I can't find anything... Maybe I am just bad at putting this into the right words.

    For a while now, I have this strange problem: After booting the first play takes ages to start. As I hit play, for up to two minutes Kodi does not respond at all. After this, it wakes up the HDD and finally starts playing. After this, the consecutive plays work just fine. This also happens for videos played via the Youtube addon. It seems to be a rather general issue. For me, this started fully out of the blue - I am not aware of an update or something alike that may have caused this.

    I'm running LibreElec 12.2.1 on a RPi4. The RPi is connected to a rather ancient Samsung TV. Additionally, there is an HDD directly attached to the RPi via USB as storage.

    Any ideas?

  • Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link
  • Code
    2026-07-09 20:31:46.691 T:1228    debug <general>: OnPlayBackStarted: CApplication::OnPlayBackStarted

    In the log this is the first invocation of a 'play' ^

    Code
    2026-07-09 20:31:48.494 T:1455    debug <general>: Open - av_find_stream_info finished

    Stream info search has completed within 2 secs ^

    Code
    2026-07-09 20:31:48.969 T:1455    debug <general>: CVideoPlayer::HandleMessages - player started 2

    And by this point audio has synced and playback is started ^

    So i'm not seeing a two minute delay from the invocation of playback to playback starting.

    Code
    2026-07-09 20:30:35.747 T:1279     info <general>: VideoInfoScanner: Starting scan ..
    ...
    2026-07-09 20:31:46.691 T:1228    debug <general>: OnPlayBackStarted: CApplication::OnPlayBackStarted

    However there's a 75 second gap between an update scrape/scan of the USB drive and the playback event starting. Do you have Kodi configure to update the library on start? .. perhaps this is the delay you are seeing?

    Code
    Jul 09 20:31:28.529486 Raspberry sh[1197]: SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 00 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Jul 09 20:31:28.530216 Raspberry sh[1197]: /dev/sda1:
    Jul 09 20:31:28.530216 Raspberry sh[1197]:  setting standby to 12 (1 minute)

    NB: This ^ is also logged in the journal, but this is harmless. It's the result of hdparm configuring standby on the drive and the USB/SATA adapter not implemented all of the SCSI command set (common on cheap SATA bridges) so the kernel doesn't see responses to everything it gave instructions on and it logs this.

  • However there's a 75 second gap between an update scrape/scan of the USB drive and the playback event starting. Do you have Kodi configure to update the library on start? .. perhaps this is the delay you are seeing?

    Yes, but this process is long over and done before I hit play the first time - so, this is not the cause of the delay.

    Important: This delay always happens at the first play, absolutely no matter how long Kodi was already running.


    I did another test and measured the time Kodi needed to respond: it was ~50 s (well, not 2 minutes, but still damn long)
    --> https://paste.libreelec.tv/unturfed-edra.log

    Code
    2026-07-10 19:47:51.744 T:1232    debug <general>: OnPlayBackStarted: CApplication::OnPlayBackStarted

    I did hit play more or less precisely at 19:47:00. This means Kodi kind of did not recognize it for said ~50 s. Also, the overlay displaying RAM, CPU etc freezes during my delay, I am not fully sure if the log is even working during this.


    Btw... The Log is full of thousands of this stuff... What is this?

    Code
    2026-07-10 19:47:47.596 T:1268    debug <CSettingsManager>: requested setting (label533) was not found.