RaspPinoob
Posts: 1
Joined: Wed Mar 26, 2014 1:53 pm

How to cache memory to USB stick

Wed Mar 26, 2014 1:57 pm

Hello all.
This is my 1st post in this forum.
I received my Pi a few weeks ago, and use it as a media centre running Openelec.
When playing back movies, many times the movie will pause as it buffers. In order to overcome this issue, I was wondering if someone could help me or point me in the right direction?
I have partitioned a USB stick as EXT4, but how do I change how the Pi (Openelec) caches? How do I make the USB stick my internal memory?

Thanks

Darren

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: How to cache memory to USB stick

Wed Mar 26, 2014 6:46 pm

To answer the question asked, you would set up a swap partition on the USB stick, and tell OpenOLEC to use that as swap. Also, expect the USB stick to die VERY fast. Flash memory, regardless whether it's in an SD card, USB drive, solid state hard drive, or anything else has a limited lifespan of approximately 1 million writes per block. If you're swapping to it, you'll burn it out pretty quick. If you want to do it anyway, google "Linux swap" and you should find instructions.

To address the actual issue, buffering usually isn't a lack of memory, it's a read speed issue from the source. What are the videos you're playing? If they're over the network, you would be better off investigating and alleviating the bottleneck. If you're streaming it over the Internet, there's probably not much you can do about it though, besides downloading it in its entirety and saving it locally. If it's from another machine on your LAN, or from local media, you'll probably be able to solve the issue. I stream videos from my laptop through the Pi using omxplayer all the time, and I don't think I've seen it pause for buffering ever.

Return to “Advanced users”