[SOLVED] Laggy video since last update

Guys. First of all, I love OSMC. It’s exactly what I was looking for when I ordered my Raspberry Pi 2. I’ve been running OSMC since a month now and I very satisfied. Unfortunately though, I am having a small issue with video playback since the last update. All video files seem to play without problems, but every now and then, it lags, sort of trips and isn’t as smooth as it was before. My setup:

  • Raspberry Pi 2
  • OSMC latest september build on a 16 GB Class 11 Micro USB
  • 2 TB WD Passport USB 3.0 drive
  • Movies files are on the drive mentioned above
  • max_usb_current = yes
  • running hd-idle to put USB drive in idle mode every 10 minutes
  • running NZB Get and Couchpotato
  • running DynamicDNS updater

Any 1080p, 720p, or random video file runs essentially without issues, but there are a few hickups every now and then. When I am watching a movie, NZBGet is not downloading anything, but the deamons are running of course. The same goes for Couchpotato.

Any ideas what might be causing this? Can I tweak some things and prevent the hickups?

Alright! I have updated it again and will test tomorrow with a new movie. Thanks for the quick reply!

My Pi2 has been dropping frames too for a couple of days. I assumed it was dodgy media files, and hadn’t noticed it being caused by the initial Sept update.

For some reason the 2nd update hadn’t appeared, and when I forced a manual scan for updates it just reported “addon error”. Everything worked fine after a reboot though, - the addon installed, and the SYstem Info reported that the Compiled date had incremented from Sep 27th to Sep 28th.

The skin now feels fast and responsive again. Hopefully no more video glitches.

1 Like

I am bumping my own thread. I updated after advice above here and this seemed to do the trick. However, I upgraded to a NAS and the dropped frames are back. Not all the time, but at some sort of unmeasured interval, it seems. My setup:

  • Raspberry Pi 2 (overclocked to Turbo, high quality power supply, 5V 2A) (wired ethernet, cat 6 cable)
  • 32GB Samsung EVO UHS Class 3 SD. Tested the card and reached internally 18 MB/s read/write.
  • OSMC latest version
  • Synology DS716+ with 2 x 4 TB 7200 rpm disks in RAID 0 configuration
  • NFS network share with movies on Synology added to OSMC/Kodi
  • Netgear Nighthawk R7000 router with cabled gigabit network
  • iMac and Macbook Pro reach 120 MB/s over network easily
  • When I upload a file through FTP from a wired station (iMac or Macbook Pro) to my Pi it is at a steady 11 MB/s
  • When I download a file through FTP to a wired stations (iMac or Macbook Pro) from my Pi, it is at a steady 11 MB/s

When I play a 10GB 1080p movie of about 100 minutes, it loads almost instantly, but every now and then, it is lagging/dropping frames, like it is sort of buffering in the background and it can’t keep up with video playback, when it is running something in the background. I tried it with both of the Hardware accelarators enabled, but no difference. Except with OMXPlayer I cannot see the dropped frames when I overlay the stats during playback.

What is happening? And more importantly, how can I solve it?

Edit: just tested a 3,3 GB movie (1280x530) h.264 of 1h41m12s. Framerate is 23.976, audio is 384 kb/s and picture is between 8000 Kb/s and 9500 Kb/s) and almost all the panning, zooming, action is laggy :disappointed:

Edit 2: I played around with advancedsettings.xml and changed it to:

> <advancedsettings>
> <loglevel hide="true">-1</loglevel> <!-- Comment: Disables logging -->
> <playcountminimumpercent>95</playcountminimumpercent>
> <skiploopfilter>0</skiploopfilter> <!-- Comment: For RPi or similar use 16 or h$
> <nodvdrom>true</nodvdrom>
>     <network>
> <buffermode>1</buffermode>
> <cachemembuffersize>104857600</cachemembuffersize>
> <readbufferfactor>2.0</readbufferfactor>
>     </network>
>     <imageres>540</imageres>
>     <fanartres>720</fanartres>
>     <splash>false</splash>
>     <handlemounting>0</handlemounting>
>     <samba>
>        <clienttimeout>30</clienttimeout>
>     </samba>
> </advancedsettings>

So far this seems to have solved the lagging. Is there any disadvantage to this? It will probably be overwritten with an OSMC update right?

It’s a bit surprising the NAS isn’t keeping up. 3.3GB for 1h41 is only about 10% of the bitrate of a BluRay which should be playable.

Can you copy that file to Pi (e.g. sdcard or USB) and check if it has any problem.
Also try playing from another network device (e.g. winows/linux PC).
That may narrow down where the bottleneck is a little more.

The buffermode setting you have tried won’t improve the network bandwidth, but it may “hide” network dropouts. Often useful for flaky wifi, but I wouldn’t expect it to be necessary for you. Obviously if it avoids the problem then no real harm in using it, but there may be a problem elsewhere on network or NAS that causes the dropouts.

Turns out it was a refresh rate setting… I noticed 24 fps movies had more stuttering than 23.976 fps movies. And apparantly, I had my video output set to 60 fps and the option to adjust refresh rate was disabled. So far, with the option to adjust framerate based on the video, my video is smooth.

1 Like