Req [RPI] Timeshift to RAM
#1
With my RPi, I don't want to be continually writing a timeshift file to either of my Flash devices (SD card or USB) as they're prone to wear, so what I'd like to be able to do is use a small RAM buffer instead.

I generally never skip back more than 1min and only have SD Freeview. I'm not sure exactly how much space that would require for 1min but say it's around 50MB, I think I could spare that on my 512MB RPi (using 128MB for GPU) as much of the RAM is only used for buffers at the moment. Ideally I suppose it would only reserve and use the RAM for the timeshift whilst watching TV and release it back to be used for other purposes when TV is stopped.
Reply
#2
Do this via the OS.

In OpenELEC I load

mount -n -t tmpfs -o size=6G tmpfs /storage/timeshift

via the autostart.sh file. This reserves 6GB of my ram. Point TVH to that folder in the timeshift settings and you are good to go.

It works on any Linux environment I guess but you have to mount to an existing folder.

6G could also be 512M for example.
Reply
#3
Thanks Frank-NL, I'll try that, with 50M rather than 512M though, as that's the total RAM my RPi has Wink

Although as I said, it would be better if we didn't have to setup a RAMdisk like this and tvheadend could just use the RAM temporarily so that it could be released and used for other stuff when not LiveTV isn't running.

EDIT: Actually, maybe I misunderstood this command (I'm no Linux expert!) as free -m shows the same before and after running it, so it seems it doesn't actually reserve the RAM until it's used, so I suppose once timeshifting stops and the file is deleted, the RAM will be freed up again?
Reply
#4
OK, did that and set TVH to only use 49M for timeshifting. I started TV but couldn't shift at all and then I tried to go to Addons to check if there were any timeshift settings in tvheadend client or service but the TV audio started pausing and then it locked up completely, no SSH or WinSCP access either. Might just be coincidence that this happened after setting up timeshift but here's the log in case anyone wants to check it (obviously the relevant bits are towards the end but I've been told before not to post parital logs). I'll try again anyway.

http://xbmclogs.com/show.php?id=58216

Not sure why but although TV is continuing to play fine, the Putty SSH session died and WinSCP wasn't responding properly for a while. It's OK again now and I was able to reconnect with a new SSH session but it seems using timeshift is doing something a bit weird.

http://xbmclogs.com/show.php?id=58225

I'll go and see if I can timeshift now.
Reply
#5
Nope, the OSD comes up showing -30s, etc when I press the keys but it doesn't actually step back the video. I tried rewind as well and that just froze the playback and it resumed from the same point when I pressed play.

See from 18:07 http://xbmclogs.com/show.php?id=58228

EDIT: Should mention I've been doing the mount command manually, not in autostart.sh so far, whilst I'm testing but I don't suppose that matters. ls /storage/timeshift also shows that a buffer file is being created there when TV is running.
Reply
#6
Check that /storage/recordings is writable. When you press pause a bunch of files should start appearing in that folder.
Reply
#7
/storage/timeshift, which is what I'm using, is writable and I see buffer created in there as soon as I start TV, which is what I'd expect as it's no good if it only creates files when I pause.
Reply
#8
If the file is created then it should work. Maybe you're just running out of RAM when the freezing happens? I wouldn't recommend having this kind of setup on such a RAM constrained device as the Rpi.
Reply
#9
In Frodo timeshift -30s does not work with TVH so wait for Gotham. It looks like the setup might indeed be too much for the pi?
Reply
#10
OK. I was using rbej's Gotham but changed to his latest Frodo build recently so I'm not sure what I was using when I tested this.

I'll try again when there's a new Gotham build anyway.
Reply

Logout Mark Read Team Forum Stats Members Help
[RPI] Timeshift to RAM0