Choppy Playback Over WiFi on Raspberry Pi 4

  • Hi there!

    I just setup my raspberry pi 4 with libreelec to stream movies over WiFi from my Odroid HC4 via SAMBA.

    I watched one movie all the way through with zero issues. Afterward, I tried watching couple other movies in my collection, and they both had major issues with playback. Both of them would suddenly pause, then run at very low fps, then speed up, then pause again.

    Freaked (1993) worked without issues. The Aristocrats (2005) and The Fast and the Furious: Tokyo Drift (2006) both had problems. The log should only include the issues with Tokyo Drift as I enabled debug logging after the fact.

    I could imagine several different things could cause these problems, but I need your help to figure it out.

    Where should I begin?

    Thanks

    Hardware:
    Raspberry Pi 4 Model B (libreelec)
    Odroid HC4 (file host)


    Version:
    Kodi Media Center 21.1 (21.1.0) Git:21.1-Omega

    Debug log:
    https://paste.libreelec.tv/primary-jackal.log

  • Where should I begin?

    Check the Wifi first. Possible you have a weak connection and not enough for the video files with higher bitrate.Try it with a USB-wifi adapter (one with a "real" antenna). Better if it's possible to switch to cable connection. I recommand to avoid the onboard wifi on the RPi with that tiny antenna (this is when the size it's matter :)).

  • The WiFi data rate seems to be the problem (A/V goes out-of-sync):

    Code
    2024-10-29 20:48:30.709 T:1060    debug <general>: ActiveAE::SyncStream - average error of 29.588072, start adjusting
    2024-10-29 20:48:30.709 T:1060    debug <general>: ActiveAE::SyncStream - average error 0.588072 below threshold of 30.000000
    2024-10-29 20:48:31.815 T:1060    debug <general>: ActiveAE::SyncStream - average error -220.747135 above threshold of 100.000000
    2024-10-29 20:48:32.303 T:1060    debug <general>: ActiveAE::SyncStream - average error -20.747135 below threshold of 30.000000
    2024-10-29 20:48:33.063 T:1060  warning <general>: ActiveAE - large audio sync error: -1485.769446
    2024-10-29 20:48:33.065 T:1060  warning <general>: ActiveAE - large audio sync error: -1485.769279
    2024-10-29 20:48:33.356 T:1060  warning <general>: ActiveAE - large audio sync error: -1685.723723
    2024-10-29 20:48:33.356 T:1060    debug <general>: ActiveAE::SyncStream - average error -963.297485 above threshold of 100.000000
    2024-10-29 20:48:33.398 T:1394     info <general>: CVideoPlayerAudio::Process - stream stalled

    I agree with VLouis . The RPi WiFi is known to be weak. You could buy a USB-to-WiFi, or Ethernet-to-WiFi adapter.

    Before buying anything, I would try an Ethernet connection to the Odroid server. Maybe the WiFi is fine, but Odroid can't deliver higher data rates.

  • Sounds good! I'll try that shortly. In the mean time, I'll post the mediainfo for the three movies just to see if anything stands out that might also be responsible.

    Freaked:


    It looks like they all have pretty similar formats, though the two with issues have close to double and triple the bitrates. Seems like wifi issues are quite likely.

  • I moved my raspberry pi right next to my router. It turns out that it can playback these movies no problem, regardless if it is on WiFi or ethernet, but if it's on WiFi it needs to have a very strong signal. I was on 70-80% in the basement and that wasn't good enough.

    Solved!