Advice with my Nextcloud + Kodi set-up
Hey there! I'm trying to repurpose a Raspberry Pi that's been collecting dust for a few years, and I'm a bit out of my depth with systems/networking, so I'm hoping for some guidance on what I did wrong (or what I could've done better).
The story is: I upgraded my PC and had an old SSD lying around, and I also had a Raspberry Pi that I never really had time to toy with. I figured I could combine both and make a small family “drive” where everyone can upload photos/videos/documents and keep them in one place at home.
Then I realized the Pi sits right behind the TV, next to the router since the Ethernet cable is short. So I thought: if it's already there, maybe it could also be a media player. The idea was: upload videos and store them on the SSD then play them on the TV via Kodi.
What’s going wrong is that Nextcloud uploads are painfully slow, even short videos take ages, and movies are basically impossible. On top of that, once files are there, Kodi playback is choppy/laggy.
I'm not sure what the real bottleneck is. Nextcloud was already "kinda slow" before Kodi. I don't know if this is Docker overhead/volume configuration, the Pi just being overloaded, Nextcloud background work (previews/scanning/etc.), or the SSD adapter to USB C limiting speeds.
If you have ideas, I'd really appreciate pointers on where to start diagnosing, and what the "sane" architecture is here (even if the answer is "don't do both on one Pi").
TL;DR: Tried to reuse an old SSD and a Raspberry Pi to make a family Nextcloud drive, then added Kodi because the Pi is behind the TV. Nextcloud uploads are extremely slow and Kodi playback is laggy. Not sure if it's Docker, Nextcloud tuning, USB/SSD adapter, or just too much for a small device. Looking for beginner-friendly troubleshooting steps and/or a better setup plan.
Which model of Raspberry Pi and what adapter are you using to power it? Newer ones like the 4 and 5 require 15W and 25W minimum respectively, using smaller ones will still boot and work most of the time but there will be all sorts of wonky behaviour.
To add, different Pis have different support for hardware accelerated decoding of video formats. It's very likely that the media files are in a format that the pi has to use CPU decoding for, which strains an already anemic system.
This caught my attention because I assumed the USB C port on the Pis was only for charging and didn't do data at all.
On further investigation I found that the Pi 4 at least can do USB OTG with the port but only over USB 2.0. If you have the SSD connected in this way and you're using it for the boot drive the performance could be sluggish. Better to use an adapter that can plug into one of the 3.0 type A ports.
Edit: according to this post, the USB C port on the Pi 5 is also limited to USB 2.0 https://forums.raspberrypi.com/viewtopic.php?t=375782
You're right to suggest a faster port in general (if the Pi they're using supports it; sounds like it's a few years old at least), but I'd be surprised if USB 2.0 alone is enough to cause the problems they've mentioned - it's still 480Mbps, which is definitely slow by "actual fast storage" standards, but it should still be plenty to drop a movie across the network and onto the drive in 20 seconds or so, even accounting for overheads.
I don't think USB limitations would be enough to cause the problems they're describing unless there's also a serious lack of RAM and the OS is trying to use the USB storage as swap space, or if the Pi 4 UAS bug someone mentioned below is coming into play.
I found this post that seems relevant:
STICKY: If you have a Raspberry Pi 4 and are getting bad speeds transferring data to/from USB3.0 SSDs, read this
I would also check the filesystem format of your external drive. If your drive is formatted for NTFS that might be exacerbating the issue.
My guess based on what you've said would be a CPU and/or RAM bottleneck, particularly because you say it got worse as you've added a second service to the device and because you're getting choppy playback when even a relatively slow USB adapter should have plenty of bandwidth to play compressed video from the disk.
If you know which generation of Pi it is, that might give a better idea of whether it should in theory be fast enough for what you're doing, whether it might be overheating, etc. but either way you'll want to look at the system info and just get an idea of what the CPU and memory load are looking like at idle, during file transfers, and during playback.
Do you have SSH access to the Pi to run
htop(orgotop, which I find a bit more readable)? That'd be a good starting point, assuming that's how you accessed it to set up the docker containers?I have basically the same setup (Pi4 wired to router, hdmi to TV, HDD connected to USB port)
For the HDD I just setup a samba server. So nothing fancy. I just need to be able to access the files from my desktop/phone. A samba server is just fine for that.
Kodi is installed on a RetroPie. Not ideal, as updates are seriously lacking. I'll redo it on a fresh Librelec installation.
To manage Kodi from the desktop, I can recommend Ember Media Manager. For android I have Yatse, which is basically a remote control for Kodi.
Oh another Yatse user in the wild! I've been using Yatse after an unsuccessful fling (flirtation?) with FLIRC on a Raspberry Pi 1 (back when Kodi was XBMC). One of my absolute favourite apps - if only my phone screen could extrude temporary little bumps on it so that I could locate the buttons more easily.
Depending on how you've installed it, Nextcloud might be too heavy for the pi. IIRC some Pis only have 2 GB of RAM. Hard to say more without specifics.
I never had a satisfactory experience with Nextcloud on any raspberry pi, it just wasn't light enough (or, more likely, I wasn't strict enough at stripping away the fluff to just use the essentials).