Solved Stuttering and buffering
#1
*EDIT* I have solved this issue. It turned out to be a faulty Plusnet Router (BT Home Hub Style) that I was using as a switch & WAP combo. I have since swapped it for a later model BT home hub and the issues have gone.


I'm having real issues watching my MKV files that have been ripped directly off blu rays. I assume it's just because these are a much higher bitrate than the files I don't have an issue with, but I'm not sure how to fix it.
I probably get 5 minutes of smooth playback, then it will either buffer, or start stuttering, loose audio, and eventually become totally unwatchable.
If it stutters I can fix it for another 5 minutes by hitting pause for a few seconds. I have noticed that when it stutters the 4th CPU core is sticking at 100%, with the others in either single figures or low teens. KODI CPU shows around 120%

The Pi is the only thing on my entire network that isn't Gb/s, and my PC with kodi plays these files perfectly, even when connected to the same network switch, so I don't think it's a network issue (Or a file issue for that matter

Any help would be much appreciated.

My advancedsetting.xml looks like this
Code:
<advancedsettings>
<network>
                <cachemembuffersize>34603008</cachemembuffersize>
                <curlclienttimeout>45</curlclienttimeout>

                <disableipv6>true</disableipv6>
        </network>
</advancedsettings>

Here is a log whilst watching the force awakens. I let it stutter for a few minutes then stopped playback.

https://dl.dropboxusercontent.com/u/3389...%20log.log
Reply
#2
A debug enabled log would have been nicer, but:
Code:
11:20:02 141.911438 T:1760490400  NOTICE: Creating video codec with codec id: 71
and look that up in ffmpeg: AV_CODEC_ID_VC1

So, the codec is VC-1 and you don't have the codec licence so no hardware decode and poor playback.
Try here: http://swag.raspberrypi.org/collections/...icense-key
Reply
#3
That's weird. I do have the VC-1 Codec. I think perhaps I linked an old log. give me a minute and I'll sort it.
Reply
#4
Yes, it was the incorrect log. Apologies.
Here's the correct one.
Playback of the force awakens starts at 11.47.08
https://dl.dropboxusercontent.com/u/3389...ng%203.log
Reply
#5
The two logs you have posted are identical.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#6
Apologies for my delayed response. I've been away for a while and not able to respond.
That log is the correct one, and log has my licences listed, so I assume they're working correctly.

Code:
decode_MPG2=0x1d5d5d94
decode_WVC1=0x5bccd2ae

When I installed them I checked they were activated using putty and everything was indicating they were.
Is there a kodi setting that would perhaps disable VC-1 hardware decoding?
Or is it possible it's something else?

Thanks again

John
Reply
#7
VC-1 codec is enabled, but the Force Awakens is a H.264 file.

One error in log:
Code:
11:57:58 2417.396240 T:1760490400   ERROR: ffmpeg[68EEF3A0]: [matroska,webm] Read error
11:57:58 2417.397461 T:1523577760   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_EOF
11:57:58 2417.397461 T:1760490400   DEBUG: CDVDPlayer::SetCaching - caching state 0
11:57:58 2417.397461 T:1760490400    INFO: Process - eof reading from demuxer

Usually indicates a corrupt file, or a failing disk, or unreliable network.
Can you copy the file to the Pi (e.g. to sdcard or USB stick) and see if plays from there?
Reply
#8
I'm struggling to get a movie onto a USB device as the files are all too big for a FAT 32 file system, however I've transferred a film over to one of my SSD's on my gaming PC and shared the folder so I could add it to my library. This should hopefully eliminate a failing HDD. The same thing happened. In fact it happened much faster than before with this setup.
The first time I tried playing the film it stuttered but chugged on with no audio and about 1 fps.
https://dl.dropboxusercontent.com/u/3389...og%201.log

The second time it got a few seconds in, chugged away briefly, then crashed back to the Kodi movie menu
https://dl.dropboxusercontent.com/u/3389...og%202.log

Search for "harry potter" if you want to find the part where I played the movie.
If it helps narrow it down, I've watched all these movies perfectly on my Windows 10 PC running the Kodi 17 MVC build, so I think the files and the network should be ok.

Thanks for your time

John
Reply
#9
If the file is mkv, then use mmg from mkvtoolnix to produce, say a 2 minute sample.
Confirm that has the same issue when played from network.
That should be small enough to copy to sdcard or usb stick.
Reply
#10
Ok, I did as you suggested and split off a 4Gb section of the film. There were a couple of frames that dropped, but other than that it was perfect.
The log is here if required
https://dl.dropboxusercontent.com/u/3389...%20log.log

I'm not sure what my next move is though.
Any suggestions?
Reply
#11
Have you tested your network bandwidth using iperf yet? Just because a Windows machine is OK doesn't guarantee the Pi will be. To rule out the network, test with iperf and we can put a number on your bandwidth, and move on.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#12
I hadn't even heard of Iperf Huh
I've just googled it and it doesn't look simple. Is there a guide somewhere I could study?
I don't even know how to install a program on the Pi. I bought this one with the appropriately named "Noobs" already installed Laugh
Reply
#13
Are all devices connected to the same switch ?
Did you try another cable.
Just to rule out basic hardware issues.
I'm playing 40 GB Blu-ray Remux with only HD audio that the raspberry needs to decode to 2.0 for my bedroom tv without any issues over my network.
So the hardware can handle it.
Oh and I don't have any codec license to help.
LibreElec Kodi | Aeon MQ ?
Reply
#14
My NAS is connected directly to the router, and everything else is connected to the same gigabit switch.
Reply
#15
After much googling I've managed to add the super repository and in turn install the iperf addon. However clicking it doesn't seem to do anything. I've rebooted to see if that fixed the issue, but no luck. Are there other dependencies?
Reply

Logout Mark Read Team Forum Stats Members Help
Stuttering and buffering0