I want to setup a Pi4 (2GB RAM) as a local caching Device for my Kodi Players. The main Reason is, some devices like my Fire TV Stick are only connected via wifi, also the Kodi Addon for Gdrive is kinda slow / buggy. Thats why I want a local cache, for at least 4 Kodi Devices.
So I setup a Pi4, directly attached to the router. Added an 1TB SSD as cache drive, Mounted my Gdrive and created a NFSv4 Share. Downloads from Gdrive are fast, 500Mbit to the Pi.
Whats the Problem on the Kodi Devices?
listing the Gdrive Directory Structure is kinda slow (about 200 Folders)
Seeking in a ~ 8 GB Video File results in Kodi just closing the Video (playing from beginning works fine)
I feel like the vfs caching is not really working for me, there are files in the Cache folder, but performance is kinda bad, also directory listing is slow, am i using the wrong parameters?
Kodi starts to buffer for a few seconds sometime, even in 720p videos
I also tried to start rclone as an http Webdav server, but the problems were the same.
Not all Kodi Devices will stream at the same time, but i want to try to compensate any Wifi Problems, even thought all Devices are using 5ghz. Most files are 1080p or even 720p so it should be enough bandwidth.
Is there anything, i can do to optimize my buffering problems? Best scenario would be : Pi4 downloads the whole file, while the devices are streaming from the local cache. Directory structure gets fully cached, so switching back and forth is faster. Gdrive wont be updated much, so a long refresh time is no problem.
Any help would be great and sorry for the wall of text.
What is your rclone version (output from rclone version)
Which OS you are using and how many bits (eg Windows 7, 64 bit)
ARM - 64 Bit
Which cloud storage system are you using? (eg Google Drive)
The command you were trying to run (eg rclone copy /tmp remote:tmp)
rclone mount gdrive: /GD --allow-other
--log-level INFO --log-file /opt/rclone/logs/rclone.log
the mount can be primed before use. to download the directory/file structure.
for example, when i need my media server, jellyin, to search the mount for new media, i prime the mount, then have jellyfin scan.
to enable, that you need to add --rc to the mount command.
and run rclone rc vfs/refresh recursive=true
not a gdrive expert but gdrive supports polling, so i would use the default value.
my mount does not support polling and does not get updated a lot, so i use these values and prime as needed. --read-only=true --dir-cache-time=0 poll-interval=0 --vfs-cache-mode=full
some rcloners do not use the vfs cache, as a test, i would remove that .
do you have a kodi device using a wired connection, not wifi, how does that perform?
these are some simple steps to pinpoint the problem.
i have a PI4, and i setup a media server on it, using jellyfin media server.
jellyfin reads from the rclone mount and keeps a local database of the media.
clients access the jellyfin server, not the rclone mount
there is a kodi plugin.
jellyin can tweak the network settings for smooth playback
in this way, no need for NFS share. NFS might not work well with rclone mount.
This means that for every file that Rclone opens, it allocates 512MB of RAM. As you only have 2Gb, as soon as you have four Kodi users, your PI will run out of memory. Leave it at the default (16MB) which is normally fine.
I would also remove these params:
See how it goes now. You may also wish to experiment with --vfs-read-ahead. I have mine set to
which means, for the file being played, rclone will keep 256MB ahead in the cache, which helps to iron out any network glitches, and helps when skipping through a file during playback.