RP4 Kodi random freeze

  • Hi,

    i use a raspberrypi4 (4gb) connected to a synology nas (smb) via wifi, since this month kodi randomly freeze. (used this setup since july without problem since now)

    systemctl restart kodi - restarts kodi but the first file freeze kodi again

    reboot - fixes the problem until it randomly (30m - 1day) freeze it again

    Video is playing -> loading cycle appears -> loadings cycle disappears, image stuck but time is playing, if i stop or press return button it freeze.

    kodi.log: Pastebin.com - Potentially offensive content ahead!


    Hope someone can help me.

    Edited once, last by racky (November 23, 2020 at 8:20 PM).

  • Looks line an AAC buffering issue:

    Code
    2020-11-23 19:58:21.796 T:2256528240  NOTICE: Finding audio codec for: 86018
    2020-11-23 19:58:21.799 T:2256528240  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
    2020-11-23 19:58:21.799 T:2256528240  NOTICE: Creating audio thread
    2020-11-23 19:58:21.799 T:2148066160  NOTICE: running thread: CVideoPlayerAudio::Process()
    2020-11-23 19:58:21.799 T:2256528240  NOTICE: Opening stream: 6 source: 256
    2020-11-23 19:58:21.819 T:2148066160  NOTICE: Creating audio stream (codec id: 86018, channels: 2, sample rate: 44100, no pass-through)
    2020-11-23 19:58:21.953 T:2117079920 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
    2020-11-23 20:09:36.192 T:2117079920 WARNING: Previous line repeats 3 times.

    Option a) Activate pass-through at the audio settings.

    Option b) Use advancedsettings.xml (chapter 2.9.5: cache) to edit buffering.

  • Thanks i changed cache settings to:

    Code
    <buffermode>0</buffermode>
    <memorysize>350460608</memorysize>
    <readfactor>6</readfactor>

    But there is still a: "WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer, WARNING: Previous line repeats x times."

    Is the buffer problem a wifi problem or a encode/decode problem?

    wifi connection is ~76.1 Mbits/sec (iperf3)

  • yes, same buffer timeouts on sdcard. But shouldnt the problems occur at some point on every libreelec rp4 installation?

    Yes, we already had other reports about AAC issues. Another theory is that the RPi4 data bus is too slow to handle AAC. Try this trick, which will set some data bus resources free, and hopefully solves your issue.

    PS: I just found this buffering settings, which you can try, too. I'm optimistic that one of those two approaches will work. :)

  • The kodi freezes appears since i put the rp4 in a case with a fan (better temperatures than before). I replaced that with a aluminum case without fan and no freezes anymore since 2 days. The only change is the fan connected with the gpio pins.

    Is it possible that the gpio pins generate this problems?


    (Logs still with timouts, even with the other buffer settings, but no freezes anymore)

  • Is it possible that the gpio pins generate this problems?

    I don't think so, I never heard about such issues.

    However, every power consuming device (fan) can become a problem, if your PSU isn't strong enough. My advice is to check the PSU's wattage, because you are using WiFi, which is known to be power consuming. An unstable WiFi connection to your NAS can make the RPi freezing.

  • Used the official Raspberry Pi 15.3W USB-C Power Supply, so this shouldn't be a problem.

    Things i tried:

    rp4 without case, onboard wifi <-wifi-> router <-lan-> nas (worked)

    rp4 with case+fan, onboard wifi <-wifi-> router <-lan-> nas (freezes randomly)

    rp4 with case+fan <-lan-> fritz repeater 3000 <-wifi-> router <-lan-> nas (freezes randomly)

    rp4 with metalcase <-lan-> fritz repeater 3000 <-wifi-> router <-lan-> nas (works)

    /shrug

  • Is there a decent air flow in that case? I doubt it. You can put in/on a fan, but if there are no other ventilation holes to enable some kind of airflow, then all the fan does is trying to suck the heat out. That's not very efficient.

    yes, because of this inefficent i use overpressure for the pi, much better cooling. And without case ~60°C, with case+fan ~37*C.

    I don't know your old case, but that could be the issue. New shiny metal case -> problem solved?

    I hope, as the problem is random i still testing, but looks good.

  • Yes, temperature can't be the problem. I'm skeptical that the case will make a big difference. More likely is a WiFi issue, because AAC (see log above) needs higher data rate, which is may not available all the time. If you have chance to switch from WiFi to Ethernet, go for it.