Let's talk about 1080p and network buffering

I've been using rasplex for a while, more than 2 years.  It's been playing 1080p nearly flawlessly for most sources.  During that time, I have actually done (manual) upgrades and never done a clean install through v0.50!

 

My environment looked like this:

Synology NAS 1812+ (Dual core x86 Atom 2700, 3GB ram)

Raspberry Pi B, Wireless N 150 Mb/s ( $7.50 | http://www.monoprice.com/Product?c_id=105&cp_id=10501&cs_id=1050108&p_id=8072 )

MPEG2/VC1 licenses installed

DTS/AC3 receiver with passthrough enabled

 

Rasplex uses directplay for 1080p .mkv containers.  Lately, and especially with v0.50 I have been noticing some major playability issues.

 

In order to resolve, I tried a much better 300Mb/s MIMO network dongle, though no effect. ( http://www.monoprice.com/Product?c_id=105&cp_id=10501&cs_id=1050109&p_id=8076)  That introduced some power issues, so I upgraded to Raspberry Pi B+ and to a 25MB/s+ microsd card.

 

This didn't resolve any of the stuttering issues.

 

I noticed that when I ran the info panel during playback, the cache always read 0B (usually shows a number in MB) regardless of the fact that I had cache set to 30% and would either be at 100% or 0%, sometimes flashing 33%.  I went ahead and did a clean install of v.0.50 --- this made no difference.

 

I checked /storage/.plexht/userdata/advancedsettings.xml and the cache was set properly 30242880

...

So I noticed a few things:

1. The problem seemed to happen when the swap file was introduced (I believe)

2. Swap is never used even during playback

rasplex-lr:~/.plexht/userdata # free
             total         used         free       shared      buffers
Mem:        307660       263144        44516            0        26052
-/+ buffers:             237092        70568
Swap:       255996            0       255996

3. Does it make sense that top reports 170% memory usage even though there is still 44KB free and no swap being used?

  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
  930     1 root     S     512m170.7   0  7.4 /usr/lib/plexhometheater/plexhometheater --standalone -fs --lircdev /var/run/lirc/lircd

Do we think that the cache may be broken in v0.50?

Once the cache/swap issue is resolved, I wonder if there may be some value to enabling network cache to use a swap file and grow to be larger than 30% (assuming your card or usb stick is fast enough)

 

Buffer efficacy:

By my math, the allocated buffer should be able to handle a pretty bumpy network connection.

Under the assumption that a 1080p vid is roughtly 20Mb/s

512MB * 30% = 153.6 megabytes for cache

153.6MB cache = 1,228.8Mb cache

1,228.8 Mb cache / 20 Mb / s = 61.44 second cache

Look in the 0.50 thread, you should disable FFMPEG AVIO.

Ok so that worked as far as fixing the buffering not showing up in the info view, and now h.264 vids seem to be watchable.

It looks like there are still 2 issues:

1. Even though I have the MPEG2 license loaded, MPEG2 encoded 1080p vids do not play withoug substantial stuttering.  I even tried the turbo overclock.

2. The buffer fills too slowly even with 300Mb wireless. Takes 15 seconds or so, should take 2-3 max. Is there something wonky with how openelec handles TCP/IP?  Maybe not enough memory for the driver?

I don't think this is OpenELEC related. Found out about RasPlex a while ago and installed it on a spare SD-Card. Even though the UI is much nicer than OpenELEC+PlexBMC, I cannot watch 1080p movies recorded on my videocamera. The network (wired) can't seem to keep the buffer filled, which results in screen going black every few seconds and sound stuttering.

OpenELEC+PlexBMC plays those movies without a stutter though.

I fought with this endlessly with my original RaspBMC efforts and multiple adapters. I eventually found the only way to get consistently good results was through the Ethernet port. Bought a wireless bridge, and I've had flawless experiences ever since.

I fought with this endlessly with my original RaspBMC efforts and multiple adapters. I eventually found the only way to get consistently good results was through the Ethernet port. Bought a wireless bridge, and I've had flawless experiences ever since.

I found the same. While I don't have ethernet connections throughout my house, I do use a 100 Mb/s powerline adapter connected to my Pi and I can play 1080p movies (mkv container) without any issues.

get some powerline/homeplugs. you won't regret it!

Ok so that worked as far as fixing the buffering not showing up in the info view, and now h.264 vids seem to be watchable.
It looks like there are still 2 issues:
1. Even though I have the MPEG2 license loaded, MPEG2 encoded 1080p vids do not play withoug substantial stuttering.  I even tried the turbo overclock.
2. The buffer fills too slowly even with 300Mb wireless. Takes 15 seconds or so, should take 2-3 max. Is there something wonky with how openelec handles TCP/IP?  Maybe not enough memory for the driver?


Have you turned off FFMPEG AVIO, if so you will not be using Rasplex custom caching, just the bog standard XBMC caching which is not that good on the Pi. Users with this off may have problems with 1080p content, especially anything over 6-8Mb/s.

The issue with FFMPEG AVIO when enabled stopping transcoding is being looked at.

Regards

So yeah I did turn off FFMPEG AVIO, which turned the rasplex network buffers back on.  (Thanks to KnightOrc for pointing that out)  I think now though that the issues are the actual TCP buffers set in /etc/sysctl.conf  (you can modify in /storage/.config/sysctl.conf)  I just don't think that the "default values that openelec chose make sense with a 300Mbs wireless adapter and/or a 20-40Mbs wireless video stream.

Honestly, there is no technical reason that wireless shouldn't work with the 30%/70MB streaming cache.  I wanted to try to test different tcp buffer values programmatically, but not sure how best to do it since the version of nc packaged with openelec < v5 does not have "listen" mode.

As for Powerline adapters I have had bad luck with due to the the noisy wiring in my house.  It's worse then wireless for some reason.

I have been using Rasplex since version .0.4.0 to playback my Bluray collection in uncompressed MKV containers flawlessly. My Pi is wired as is everything in my setup through GigE switches. I only playback stereo (never saw the need for multi-channel in my tiny apartment but thats a whole other thread!) through my TV with a pair of self-powerd monitors attached. I also overlock the Pi (1000/500/500/6). Wireless in my environment (NYC apartment) is useless for anything other then my iPad and iPhones. The amount of WiFi polution in big apartment buildings is rediculous  B)

Just my 2 cent.

Yeah I have no issues with 1080p bluray playback on rasplex+gigabit, plex mobile on ipad 2/4, or plex mobile on android phone/tablet.  Only have issues with rasplex b+ using 2 different wireless cards.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.