Stuttering Playback

  • I first want to state that the I have a raspberry pi 2. Running NOOBS LibreElec newest version (checking for updates none coming back). The raspberry pi 2 (will be called my box in this post.)

    My box is connected to a gig switch with cat 6a cable ,when playing 1920x1080p High definition movies from a Western Digital 4TB NAS My Cloud located on the same gig switch movies for the most part are being ripped with x264 mkv file types DTS audio MPEG-4.


    I have the default settings running on the box, but have tried turning off the TOP hardware acceleration but that made it worse because the movie was starting to actually buffer when I turn this back on the buffering goes away, but then the stuttering starts again. When I say stutter, the video and audio will freeze for a few seconds maybe even 1 minute then play another 3-4 minutes then stutter again. Sometimes it just happens back to back.

    Ex. Last night My wife and I were watching Alice through the looking glass and it played 1.5 hours of video before it started stuttering. Then stuttering every minute or so we just stopped watching.


  • IvThe only time I had stuttering that wasn't buffer related, was when I forgot to add my MPEG codec licenses in my config.txt.

    Ive never had any problems playing these until i started getting higher and higher quality movies. Choosing a 1080p version thats around 3 gigs. Whereas before i would just pick the 800mb option mp4 or avi. And i have never purchased an MPEG codec license for my PI. Im new to the whole codec stuff, but its happened to be alot lately to where i havent even watched any movies because of this.
    [hr]


    Change cables/ports. Turn everything off and on again. There's no issue in the build (else we'd know.. too many thousands of users are running it) so it's something to do with network environment or hardware.

    Yes, turning off and on again, making sure all the connections are good. Ill take a wild guess and say im certain its not the network, or my NAS. But rather something in the pi that isnt configured correctly or not at all. Since each movie codecs are different its hard to track down why its stuttering not buffering. But ive watched the CPU usage on the pi while the stuttering is happening because its only in playback not in the system UI the cpu usage is low such as 30-50 % total. But all advise is welcome!

    Edited once, last by nhenry1541 (October 20, 2016 at 3:44 PM).

  • Manual update to the current v7.90.007 alpha (as nothing will be fixed in Jarvis now) retest. If the problem remains share the URL for a debug log + mediainfo for a file that doesn't work. If possible upload a 30-60 second except of the file that demonstrates the problem somewhere so we can download and test the file.


  • Manual update to the current v7.90.007 alpha (as nothing will be fixed in Jarvis now) retest. If the problem remains share the URL for a debug log + mediainfo for a file that doesn't work. If possible upload a 30-60 second except of the file that demonstrates the problem somewhere so we can download and test the file.

    I am just now running Jarvis. So when I go to check for updates that are set to manual, I never get anything. So updating to an Alpha build might not make sense (unless the next codename is alpha lol).

    I think the problem that I'm having is the DTS audio versus the AC3 audio. Im reading online that the raspberry pi 2 (or all of them probably) doesn't have the horsepower to decode that DTS audio. So try enable DTS passthrough.

    Maybe I'm wrong, but anything is worth a shot. I love the Raspberry pi and don't want to build a full forced pc to run these movies simply because I don't want to have to turn on a pc every time I want to watch a movie. Seems wasteful on power. I believe I do HAVE a DTS sounder so passthrough might work. I just don't have a lot of experience in the codec part...Sadly just found out a couple weeks ago that openelec had died and moved to Libreelec :D

  • it should be able to decode dts just fine, my rpi1 can do 1080p dts with overclock though, so the rpi2 should do it with ease.
    try set the switch port to 100Mbit instead of gb if you can, or try another one. or cable etc. or post a sample as suggested.
    what happened to openelec or the whole thing is sad yes, but there is nothing sad about moving on to libreelec.

    Edited once, last by tuxen (November 27, 2016 at 11:51 AM).


  • it should be able to decode dts just fine, my rpi1 can do 1080p dts with overclock though, so the rpi2 should do it with ease.
    try set the switch port to 100Mbit instead of gb if you can, or try another one. or cable etc. or post a sample as suggested.
    what happened to openelec or the whole thing is sad yes, but there is nothing sad about moving on to libreelec.

    Okay so an update. (I know its been awhile just haven't had the energy haha) I have put a test movie on a usb flash drive and the movie plays flawlessly. I have the raspberry pi 2 connected to an HP 1800-8g (1000/100/10mb) switch. So I can manage the switch if needed. But I can downgrade the port to 100mb if needed, but can also turn on jumbo frames if needed as well. I have turned the port for my pi to 100fdx (full duplex) and will test (as I'm typing this.) And will post back in a few.
    [hr]
    Okay changing the network speed on the local switch (100mb full duplex) that is connected to the raspberry pi 2 DID NOT fix the stuttering issue. I have a movie file MKV with the following info from VLC on pc.

    The movie stutters instantly when playing from my NAS, but is perfectly fine on USB flash drive. Now I have a Samsung 2.0 channel sound bar and subwoofer (this movie particularly seems to be in 5.1 Dolby. Im just trying to give as much info as possible since I'm only really running into problems that I haven't before.

    Edited once, last by nhenry1541 (January 28, 2017 at 8:01 PM).


  • The solution to the stuttering problem is to buffer the input stream. You do this by establishing an advancedsettings.xml file with the appropriate tags. Use the following link for more info: advancedsettings.xml - Official Kodi Wiki
    Please note that some tag names related to buffering have changed in Kodi Krypton.

    Sent from my GT-P3113 using Tapatalk

    Do you have an example of the value to use? Ive tried this before but after a reboot it corrupted the pi 2 install and made me reinstall. I believe what i tried was similar to this:
    <advancedsettings>
    <setting>20971520</setting>
    </advancedsettings>

    Cant remember the exact value that i used but i have turned on debugging on my kodi pi 2 and its using 288820/382320 even while stuttering. <<Again value isnt exact but very similar to what it actually was.


  • Have a look at this thread thread-4829.html

    I've done a lot of research on this on the RPi3 - It may help you solve the issue.

    Okay ive read through that post and i believe i have what i need to do with the advancedsettings.xml. For my Pi 2 would mine look like this:

    <advancedsettings>
    <network>
    <buffermode>1</buffermode>
    <cachemembuffersize>20971520</cachemembuffersize>
    </network>
    </advancedsettings>

    And would that be in this location: /storage/.kodi/userdata/ using cat advancedsettings.xml then !w ?

  • For Kodi Krypton the settings have changed. I use the following in my advancedsettings.xml file for buffering on my RPi:
    <cache>
    <memorysize>26214400</memorysize> <!-- number of bytes used for buffering streams ahead in memory
    Kodi will not buffer ahead more than this. WARNING: for the bytes set here, Kodi will consume 3x the amount of RAM
    When set to 0 the cache will be written to disk instead of RAM, as of v12 Frodo -->
    <buffermode>0</buffermode> <!-- Choose what to buffer:
    0) Buffer all internet filesystems (like "2" but additionally also ftp, webdav, etc.) (default)
    1) Buffer all filesystems (including local)
    2) Only buffer true internet filesystems (streams) (http, etc.)
    3) No buffer -->
    <readfactor>3.0</readfactor> <!-- this factor determines the max readrate in terms of readfactor * avg bitrate of a video file.
    This can help on bad connections to keep the cache filled. It will also greatly speed up buffering. Default value 1.0. -->
    </cache>


  • If you still have stutter problems and not seeing the buffering popup, can it be that you are watching 10bit color videos? Which the RPi is not really fond of?

    Not exactly sure how i would find these out. I have to say that a majority of blu-rays i download were torrents. i Have started ripping my own blu-rays as a test and


  • If you still have stutter problems and not seeing the buffering popup, can it be that you are watching 10bit color videos? Which the RPi is not really fond of?

    Not sure even about this but ill error on the side of since I have no clue what that means that no I'm not playing them. The test videos I have are blu-ray rips straight from the disk using Makemkv. then Handbrake the mkv file to mp4 using the default settings on Fast 1080p except I change the subtitles from forced only to not forced.
    [hr]


    This actually made it worse. used exact numbers and confirmed all tags were closed. Here is what I used:
    <cache><buffermode>0</buffermode><cachemembuffersize>20971520</cachemembuffersize><readfactor>3.0</readfactor></cache>
    [hr]

    Not sure even about this but ill error on the side of since I have no clue what that means that no I'm not playing them. The test videos I have are blu-ray rips straight from the disk using Makemkv. then Handbrake the mkv file to mp4 using the default settings on Fast 1080p except I change the subtitles from forced only to not forced.
    [hr]


    This actually made it worse. used exact numbers and confirmed all tags were closed. Here is what I used:
    <cache><buffermode>0</buffermode><cachemembuffersize>20971520</cachemembuffersize><readfactor>3.0</readfactor></cache>


    [hr]
    Okay not sure how I screwed that last reply up. But creating and editing the advancedsettings.xml didn't change much. still stuttering every few minutes.

    Edited once, last by nhenry1541 (February 16, 2017 at 2:20 AM).

  • **Edit. I have a raspberry pi 1b not 2. But will be getting a rpi3 very soon as i must have the latest tech and i just recently realized i am a few versions behind.**

    Giving some more information on this to hopefully get some more help. I wanted to inform everyone that i use a single drive 4tb Western digital MyCloud Nas (newest firmware.) Its hooked up to a gig unmanaged 16 port switch with cat 6a. I am still having this stuttering problem but its not as severe as other people might have. I dont have a "buffering" pop up on my screen. Basically when i click on a video it starts to play then audio/video stops for a few seconds then plays again, then a couple minutes then audio/video stop then plays. But this happens more often than not when playing videos. I have my libreelec setup to use NFS on the NAS, should i be using anything else? Such as SMB or whatever else is an option on there (not looking at the list so i cant remember all of the options)

    Info on my 4tb MyCloud NAS:
    I have DLNA Media Streaming turned on, Quick test under system Diagnostics Shows "passed", sleep HDD is turned on (maybe this is the problem? But as soon as i hit it with my PI shouldnt the drive wake up?), I dont know if the drive inside is a 7400 or a 5400 (could be 5400 would that matter tho?), Static IP address, I have safepoints turned on only to backup Sunday nights at 1am to another NAS setup in Raid 0 on the same switch. Backups done before monday Morning.

    Any and all help is appreciated. If my device is too old and slow to process full 1080p movies i would understand this, but it has happened more and more with the change over to Libreelec, (as much as i hate to say this, this didnt happen on openelec.) Nonetheless i love Libreelec and glad its working out so far. Once i can fix this issue then ill be the happiest camper ever!

  • Go back to basics. The RPi1 doesn't really have the horsepower to show 1080p movies reliably especially over the network..
    You need to find where the bottleneck is.
    Use a fresh install of LE with no other addons or other detritus.
    Use the same movie on NAS/USB/SD and see if there is any difference.
    Use LE addons System-tools and NMON to monitor where the issue is, CPU, I/O, N/W.

    You can't say (as much as i hate to say this, this didnt happen on openelec) as you probably aren't using the same parameters i.e same setup, nor same movie.