Movie buffering with rclone on router

Which cloud storage system are you using? (eg Google Drive)

Google Drive

What is the problem you are having with rclone?

Hi all! The rclone itself don't have any problem. The mount is successfull up and running.
I just buyed few days ago an Asus RT-AC85P and installed latest OpenWRT on it. And I noticed in 4K movies starts the Kodi (in a CE tv box) buffering.
But, before I had that router I mounted directly the drive in CE box (S912 with 3GB of RAM, wifi connection about 200 mbit/s speed) and don't have any buffer problems.
I'm post here both the router and CE box mount options, maybe somebody see the difference what I don't see.
So first the CE box mount options (no buffer problems with Kodi)
rclone v1.57.0

  • os/version: coreelec 9.2.8 (64 bit)
  • os/kernel: 3.14.29 (aarch64)
  • os/type: linux
  • os/arch: arm64
  • go/version: go1.17.2
  • go/linking: static
  • go/tags: none

rclone mount
--config=/storage/.config/rclone/rclone.conf
--log-level NOTICE
--log-file /storage/logs/rclone.log
--poll-interval 10s
--timeout 1h
--umask 002
--dir-cache-time 5000h
--drive-pacer-min-sleep 10ms
--drive-pacer-burst 200
--vfs-cache-mode writes
--vfs-read-chunk-size 32M
--vfs-read-chunk-size-limit 1G
--rc
--rc-addr 127.0.0.1:5572
cryptmount: /storage/drive/

And here is the options when drive mounted on the router (I'm attached an 500GB hdd in usb3 connection to it to have space for cache)
rclone v1.57.0

  • os/version: openwrt 21.02.1
  • os/kernel: 5.4.154 (mips)
  • os/type: linux
  • os/arch: mipsle
  • go/version: go1.17.6
  • go/linking: dynamic
  • go/tags: none

rclone mount
--config=/root/.config/rclone/rclone.conf
--log-level NOTICE
--log-file /tmp/rclone.log
--dir-cache-time 5000h
--poll-interval 10s
--timeout 1h
--umask 002
--drive-pacer-min-sleep 10ms
--drive-pacer-burst 200
--cache-dir=/mnt/sda1/cache
--vfs-cache-mode writes
--vfs-cache-max-size 250G
--vfs-cache-max-age 5000h
--vfs-cache-poll-interval 5m
--vfs-read-ahead 2G
--buffer-size=0
--use-mmap
--rc
--rc-addr 127.0.0.1:5572
cryptmount: /mnt/drive/

The Kodi play the movie via NFS share from router. When I check nfsstat -s on router there is no badcalls/badfmt, etc, and says server nfs v3. In the CE box there is no nfsstat command (even no luck with nfs-utils package) so I can't give the nfsstat -c command.

Thank you!

hi,

i would assume that the asus lacks cpu power and features such as a GPU and hardware transcode.

  • is the 4K streamed as direct or transcode?
  • i would test using --vfs-cache-mode full

Thank you for your reply. I'm not using Plex in Kodi just play movies directly from NFS share.
Yes I'm playing between --vfs-cache-mode full and writes because (maybe it's sounds stupid) but I noticed with mode full the HDD not spin-down never even if nothing using the rclone (only the router itself of course because mount process running all the time)
Here is a picture from htop when the 4K movie running:

But the CPU usage going up when I'm mount the drive in the CE box and start a 4K movie, especially when filling up the buffer. Of course the tv box have 8 cores and stronger.

Edit: I just checked there is no big difference in CPU usage on the router if I play a 1080p movie or a 4K.

fwiw, when i stream media from rclone mount,
do not use any --vfs-cache-mode,
do not use any --vfs flags.
in effect --vfs-cache-mode=off and thus no need for a hard drive for a vfs cache.

what kind of device is kodi running on?
as a test, have you tried to run rclone mount direct on that.

as another test, instead of rclone mount, try rclone serve dlna
and have kodi stream from that.

as I told an S912 tv box with 3GB RAM and 8 cores running on CoreElec

this is what I wrote in my first post, no buffer when I mount directly the drive in the CE box.

Yepp I'm going to try that!

Ok then I try to remove the --vfs flags.

Thx.

sorry, i find your posts somewhat confusing.

to summarize it in short form, is this correct?

old setup - no buffering
--- rclone mount on CE box
--- kodi on CE box

new setup - buffering
--- rclone mount on asus
--- kodi on CE box

Yes you are correct!

Edit: I tried first with mount without --vfs flags and --vfs-cache-mode=off. But when I step in the mounted directory in the CE box it's just loading, loading, loading and thats all (in the drive there is 10TB movies and series)

After I tried dlna serve. I can "step" in the directories but not playing the movies or series.

I'm tested with --vfs-cache-mode full but 4K movies still buffering...I tried streaming from 2 devices and I see in the router the CPU usage 100% (memory is only 60MB) and all devices starts to buffering.
So I think the router CPU can't handle it. The CE box much more powerful this is why there is no problem with that.
I'm little bit sad because only this is why buyed a new router but it's good I choose the cheaper one for testing not the 300€ :smiley:

I can't edit my last post, sry.

So I'm played around all the options and I'm figured out what is working best is the rclone serve http. I mean working best on that Asus router, it's still eating the CPU but not as hard like with rclone mount and NFS/Samba share. With http serve the CPU goes about max 80% with 4K movie but only when fills up the buffer, after that going back about 30-40%, but with mount options and NFS share it's going up 100% all cores when buffering and then 60-70%.

So my flags for that are:
/usr/bin/rclone serve http
--config=/root/.config/rclone/rclone.conf
--log-level NOTICE
--log-file /tmp/rclone.log
--addr :8080
--read-only
--dir-cache-time 5000h
--poll-interval 10s
--umask 002
--rc
--rc-addr :5572
--rc-no-auth
--drive-pacer-min-sleep 10ms
--drive-pacer-burst 200
--cache-dir=/mnt/sda1/cache
--vfs-cache-mode full
--vfs-cache-max-size 200G
--vfs-cache-max-age 5000h
--vfs-cache-poll-interval 5m
--vfs-read-ahead 10G
--buffer-size=0
--use-mmap
cryptmount:

So if somebody know more tricks to decrease the CPU than please share with me/us. But the next time 100% that I'm going to buy better CPU router (if I was know that ....).

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