Page 1 of 2

Buffering 4K HEVC video on ATV4K

Posted: 20 Aug 2018, 06:50
by rogbott
I am trying to play a large 4K HEVC file and am getting a lot of buffering issues. It is connected via 5Ghz 802.11ac to my router with a link rate of 680mb and even if that is half-duplex it should be enough to pass that through. I am using the AF hardware acceleration. I don't have any problem playing any compressed encoded types like x265 or x264. I am using the internal audio engine to process so I have my settings at 5.1 I have monkeyed around with some of the settings but nothing seems to change.

I also tried using one of my mesh satellites as a bridge because it does have a 4x4 backhaul and I thought that might help but it didn't matter either. I have attached a log here: https://pastebin.com/Zb2edB9s

Hopefully that provides some ideas. I am happy to test other builds or configurations as needed. Thanks!

Re: Buffering 4K HEVC video on ATV4K

Posted: 20 Aug 2018, 21:20
by davilla
did you try libdsm for the smb client ?

Re: Buffering 4K HEVC video on ATV4K

Posted: 20 Aug 2018, 22:22
by rogbott
I did not. Thanks for the suggestion- I'll give it a shot and report back!

Re: Buffering 4K HEVC video on ATV4K

Posted: 21 Aug 2018, 05:13
by rogbott
Unfortunately, that didn't seem to work. I grabbed another set of logs with libdsm enabled, https://pastebin.com/AcUVUp35

Re: Buffering 4K HEVC video on ATV4K

Posted: 22 Aug 2018, 16:11
by rogbott
I did some more digging and it appears that this is a SMB issue. I played the file over UPNP and it played perfectly. I believe SMBv3 may solve this problem but my understanding is that it is not available for ATV 4k just yet. My NAS has a hack to support NFS which I may try in the interim. Any other suggestions are appreciated

Re: Buffering 4K HEVC video on ATV4K

Posted: 23 Aug 2018, 13:36
by davilla
libsmb2 is the one that handles SMB2/SMB3 protocol

Re: Buffering 4K HEVC video on ATV4K

Posted: 23 Aug 2018, 14:42
by ogrim1
This is a known problem with the Kodi implementation of SMB (and also NFS): With large files, you can run into massive buffering problems even if your connection should be more than fast enough.
I had the same problem before when I had a ~120 mbit/s wifi connection (checked with iperf) trying to play a ~50mbit/s Blu-ray rip and it would buffer every 10 seconds...

Usually, the best workaround is mounting the partition in the OS directly (eg. via fstab). For example on my NVIDIA Shield TV, it makes a world of difference if I use the Kodi/MrMC implementation of SMB or NFS vs. mounting the drives on the Shield OS level.

However, unfortunately mounting the partition in the OS is not an alternative on IOS/TVOS. At the moment, the only solution I know of if your connection is too slow is to change the protocol. When I had the same problems back then, things got way better using (don't lough) FTP... except for database updates / cleanups, those took ages on FTP (no surprise there).

The problem seems to be with the SMB / NFS settings concerning read ahead and can't be fixed easily on the user level. There are more than enough threads for this problem on the net (see for example https://forum.kodi.tv/showthread.php?tid=285288 ).

Davilla, do you think libsmb2 on MrMC 3.7 could do something to solve those problems? Thanks!

Re: Buffering 4K HEVC video on ATV4K

Posted: 23 Aug 2018, 15:03
by davilla
Yes, based on my tests, libsmb2 > libdsm > libsmbclient.

We have also made several changes to how buffering works in MrMC. In particular, we remove the rate limiter, it's there in gui but does nothing.

The only quirk right now with libsmb2 is needing to use ip, user/pass AND share point info to setup. Our version of libsmb2 does not support browsing shares but upstream is working on that issue.

Once we get libsmb2 supporting browse, then libsmbclient dies off. for SMB1 -> libdsm, for SMB2/3 -> libsmb2.

Re: Buffering 4K HEVC video on ATV4K

Posted: 23 Aug 2018, 15:25
by cosmoxl
davilla wrote:
23 Aug 2018, 15:03
Yes, based on my tests, libsmb2 > libdsm > libsmbclient.

We have also made several changes to how buffering works in MrMC. In particular, we remove the rate limiter, it's there in gui but does nothing.

The only quirk right now with libsmb2 is needing to use ip, user/pass AND share point info to setup. Our version of libsmb2 does not support browsing shares but upstream is working on that issue.

Once we get libsmb2 supporting browse, then libsmbclient dies off. for SMB1 -> libdsm, for SMB2/3 -> libsmb2.
Libdsm doesn’t support browsing for my smb1 shares last I tried. If a share is already added it works.

Re: Buffering 4K HEVC video on ATV4K

Posted: 23 Aug 2018, 18:06
by rogbott
Thanks- this is really helpful information. It saves me some time having to create NFS shares if it isn't going to make any material difference. Quite honestly, I may just give the FTP route a shot. The way I currently I have it setup is that I have all my shares on a desktop instance of Kodi and then I use MYSQL to connect the instances of MrMc. I look forward to trying libsmb2 when it is released in 3.7.