Video Stuttering and high CPU usage on Raspberry Pi 3

Hello all,

I was wondering if someone could help me, I’ve done as much basic fault finding as I can but I’m completely stumped over the really poor performance I’m getting on the Pi3.

I’ve had most of this configuration set up for years now, including on an old Pi2 and have not had any issues with video playback - but recently streaming media to my Pi3 has become unwatchable due to the stuttering of the video itself (the audio playback doesn’t seem to lag). When checking the performance overlay I can see really high CPU usage across all 4 (in the 80s/90s). Here’s a screengrab I did of the Pi3 in top when playing my designated test file (Frozen in this case):

I had recently upgraded to the pi3 and have had these problems ever since. I have re-installed Kodi once, diabled addons and tried playing the same file locally and the issues still persist.

My media is being streamed from a NAS (Ubuntu Server) via the NFS mount that was done in the command line rather than through the UI (192.168.1.10:/srv/nfs/media /mnt/media nfs soft,rsize=32768,sync,intr,rw,x-syst$ is the config I’ve set in /etc/fstab).

This is connected via powerlines (devolo brand) which I’ve had for a number of years now and have had no real issues with. Given that my main issue is video stuttering rather than wholesale buffering (and it happens when the file is locally hosted) I’m confident the network shouldn’t be the issue. I’m able to stream files from my NAS on my desktop, mobile phone and tablet on Kodi with no issues.

My log is here: https://paste.osmc.tv/emugujimab, I most recently tried to play Frozen that I’d handbraked and the mediainfo output for that is further below. I am wondering if someone more educated than me could tell me whether I’ve done something crazy in the encoding? I have the licences applied to my pi3 and both of them are confirmed both in the UI and via the command line.

I’m using a proper power supply that I purchased from the Pi Hut (https://thepihut.com/collections/raspberry-pi-power-supplies/products/official-raspberry-pi-universal-power-supply) and a Samsung Class 10 32GB SD card.


 General

Unique ID : 207046776555764921541500091520788486355 (0x9BC3C2393ADF7A3412EBB622CBBC58D3)
Complete name : C:\Users\Wintermute\Frozen.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 3.33 GiB
Duration : 1 h 42 min
Overall bit rate : 4 667 kb/s
Movie name : Frozen
Encoded date : UTC 2017-04-17T22:14:18Z
Writing application : HandBrake 1.0.1 2016122900
Writing library : Lavf57.7.2

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 1 h 42 min
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Writing library : x264 core 148 r2708 86b7198
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Audio #1
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC
Duration : 1 h 42 min
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 spf)
Compression mode : Lossy
Delay relative to video : -21 ms
Title : Stereo
Language : English
Default : Yes
Forced : No

Audio #2
ID : 3
Format : AC-3
Format/Info : Audio Coding 3
Format settings, Endianness : Big
Codec ID : A_AC3
Duration : 1 h 42 min
Bit rate mode : Constant
Bit rate : 640 kb/s
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 spf)
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -5 ms
Stream size : 468 MiB (14%)
Title : Surround
Language : English
Service kind : Complete Main
Default : No
Forced : No

Text
ID : 4
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Language : English
Default : No
Forced : No

Menu
00:00:00.000 : :Chapter 1
00:05:59.860 : :Chapter 2
00:11:38.072 : :Chapter 3
00:19:53.859 : :Chapter 4
00:31:03.195 : :Chapter 5
00:38:39.484 : :Chapter 6
00:44:21.325 : :Chapter 7
00:50:51.507 : :Chapter 8
00:57:48.423 : :Chapter 9
01:02:57.399 : :Chapter 10
01:09:36.089 : :Chapter 11
01:13:34.911 : :Chapter 12
01:18:07.600 : :Chapter 13
01:22:33.907 : :Chapter 14
01:27:10.851 : :Chapter 15
01:32:33.465 : :Chapter 16


Any help at all or pointers would be very much appreciated as the whole media centre I’ve built is largely a no go right now.

Many thanks in advance,

Adam

Needs to be a debug log – it’s not clear whether or HW acceleration is working. I suspect not because the CPU utilisation is too high.

Hi Sam,

Thanks for that, and I thought I’d managed to provide everything :slight_smile:

Annoyingly when enabling debugging and rebooting my NAS is no longer being picked up… I’ve been able to use the local copy of the file however which I hope provides at least a few pointers given that I’m fairly hopeful my network isn’t the issue.

New debug log uploaded at - https://paste.osmc.tv/tadovuhetu , hope that’s correct.

Thanks again.

Adam

The file is being software decoded which explains the high cpu.
What do you have set in video/acceleration settings? (set settings level to expert if you don’t see this).

It should have MMAL enabled and omxplayer disabled on a Pi2/Pi3.

Hi popcornmix,

On the videos section I have:
Skip Delay = 750
Adjust display refresh rate = Always
Sync playback to display = Yes
Minimise Black Bars =
Display 4:3 videos as Normal
Allow hardware acceleration OMXPlayer = No
Allow hardware acceleration MMAL = No
Limit GUI updates during playback = 10

I just set MMAL to Yes and tried playing the file again and it looks as though that’s solved it. Thanks very much for that, I was tearing my hair out trying to work out what was causing it.