Hardware: Raspberry Pi 3, with 2.4 A power supply.
Software: OSMC 2016.06-02
Freshly installed, yesterday, on a SanDisk Mobile Ultra microSDHC 16 GB UHS-I (Class 10).
I’m having issues while playing certain movie files with very high variable bit rate video and audio via SMB. One particular file I attempt to play has (according to MediaInfo 0.7.87) roughly 5 Mbps audio (TrueHD) (although OSMC overlay says closer to 9 Mbps), and h264 (x264, AVC) video at an average 20.1 Mbps (max 30 according to encoding parameters). I’ve enabled hardware decoding, which when there is data in the buffer makes the video and audio flow perfectly. (With software decoding it’s not working as well, but that’s another issue I may address in a separate post.)
The issue is that the buffer is not refilled fast enough. Slowly it is depleted (vq and aq drop down to 0%), video freezes, buffer starts to refill (vq and aq increase), and only once the buffer has refilled to 90+% (vq and aq) playback starts again.
The buffering happens with varying frequency. To me it appears to vary somewhat depending on the current measured bit rate of the video file. Often playback stops for buffering with between 30-90 second intervals.
Using bcmstat.sh I see the RX rate is between 1.5-3.5 MB/s, with the occasional rare spike close to 5 MB/s. Testing file transfer independently from the servers on my network, I was able to saturate the 100 Mbps line to the RPi, so it’s not a network issue. It is also not an issue with the share providing the video, as I am able to stream the same file to my Windows PC with no impact on the concurrent behavior on the Raspberry Pi. It continues to get stuck buffering as often as before.
Saturating the RPi network interface via SCP:
Time ARM Core H264 Core Temp (Max) IRQ/s RX B/s TX B/s
======== ======= ======= ======= =============== ====== ========== ==========
21:36:35 1200Mhz 400Mhz 300Mhz 61.22C (62.30C) 11,118 11,587,196 248,669
21:36:37 1200Mhz 400Mhz 300Mhz 61.22C (62.30C) 10,912 11,955,859 215,072
21:36:39 1200Mhz 400Mhz 300Mhz 61.22C (62.30C) 11,017 11,946,929 224,658
21:36:41 1200Mhz 400Mhz 300Mhz 60.69C (62.30C) 10,831 10,648,593 269,694
Maximum transfer speed during playback, with stuttering, default settings:
Time ARM Core H264 Core Temp (Max) IRQ/s RX B/s TX B/s
======== ======= ======= ======= =============== ====== ========== ==========
22:28:49 1200Mhz 400Mhz 300Mhz 58.53C (60.15C) 3,353 2,571,254 83,588
22:28:51 1200Mhz 400Mhz 300Mhz 58.53C (60.15C) 3,677 2,764,906 91,712
22:28:53 1200Mhz 400Mhz 300Mhz 58.00C (60.15C) 5,645 4,791,837 155,941
22:28:55 1199Mhz 400Mhz 300Mhz 58.53C (60.15C) 2,645 1,726,276 61,153
22:28:57 1200Mhz 400Mhz 300Mhz 58.53C (60.15C) 3,256 2,313,383 76,666
22:28:59 1200Mhz 400Mhz 299Mhz 58.00C (60.15C) 2,725 1,901,256 62,162
22:29:01 1200Mhz 400Mhz 300Mhz 58.00C (60.15C) 3,474 2,538,904 84,728
I attempted to change readbufferfactor
in the advancedsettings.xml
, to no avail. This seem to be described also in other threads. I experience the same buffering freezes with readbufferfactor=4.0
, readbufferfactor=8.0
, and even readbufferfactor=80.0
, and I believe this is to be expected when buffermode
is not set explicitly to 1
.
http://paste.osmc.io/enahusixof
I did further tests with buffermode=1
together with an increased cachemembuffersize
(between 30-100 MB) and high readbufferfactor
(between 4-16). Playback generally takes slightly longer to start, but buffers better and only stutter once in a while. bcmstat.sh shows spikes of 5-9 MB/s (depending somewhat on readbufferfactor
). It still seem to be too slow sometimes, especially during first start of playback, or during seek, where it can take many seconds before playback gets going. And with these settings I also sometimes receive “cache full” popups, which according to some research is more of an annoyance than a real problem itself.
Can I tune the SMB download speed in the “non-cache” scenario (buffermode
not explicitly set, defaults to 0
I think) to pull video faster and avoid playback freezing?
Edit:
List of things to test:
-
- Play video from NFS share mounted via fstab (ActionA) - Works like a charm! Update: Playback via SMB if mounted (e.g. via fstab) also works basically just as well.
-
- Add
smsc95xx.turbo_mode=Y
to /boot/cmdline.txt (DBMandrake) - Works well, also
- Add
Both seem like workarounds, and not proper fixes to the problem.