[mythtv] LiveTV BufferSize in MB instead of GB?

Kristian Kalweit kalweit at exorpro.de
Thu Sep 15 07:19:02 UTC 2005


David Armstrong schrieb:

> Hi,
>
> Can the "BufferSize" setting for livetv be changed to specify size in 
> MB instead of GB?  On my MythTV box I have a EPIA M10k 512MB box 
> running both front and backends; livetv buffer is on a tmpfs partition 
> to eliminate the hard drive ticking, and buffersize set to 384MB.  I 
> have been running this way since v0.17 with no problems, aside from 
> the obvious limitation on how long I can pause.
>
> Attached is a patch against 0.18 that achieves the above, with two 
> TODOs.  Firstly i'm not sure my default and max sizes will suit 
> everyone (128MB default, 128MB increments on the slider, 4096MB max), 
> secondly how to handle upgrades.  Clearly simply changing the meaning 
> (from GB to MB) of this setting where existing users have something 
> like "1" wont be very helpful.  I'm aware there must be code somewhere 
> that detects a version upgrade and sorts out the database accordingly, 
> if someone could point me in the right direction i'll get to work on 
> adding something.
>
> I would appreciate any feedback or suggestions.
> thanks,
> David.
>
>------------------------------------------------------------------------
>
>diff -ur mythtv-0.18/libs/libmythtv/tv_rec.cpp mythtv-0.18-patched/libs/libmythtv/tv_rec.cpp
>--- mythtv-0.18/libs/libmythtv/tv_rec.cpp	2005-04-03 17:42:10.000000000 +0100
>+++ mythtv-0.18-patched/libs/libmythtv/tv_rec.cpp	2005-05-01 11:35:00.000000000 +0100
>@@ -1754,7 +1754,7 @@
>                             long long &fillamount, bool pip)
> {
>     ispip = pip;
>-    filesize = gContext->GetNumSetting("BufferSize", 5);
>+    filesize = gContext->GetNumSetting("BufferSize", 128);
>     fillamount = gContext->GetNumSetting("MaxBufferFill", 50);
> 
>     path = gContext->GetSetting("LiveBufferDir") + QString("/ringbuf%1.nuv")
>@@ -1762,7 +1762,7 @@
> 
>     outputFilename = path;
> 
>-    filesize = filesize * 1024 * 1024 * 1024;
>+    filesize = filesize * 1024 * 1024;
>     fillamount = fillamount * 1024 * 1024;
> 
>     rbuffer = new RingBuffer(path, filesize, fillamount);
>diff -ur mythtv-0.18/setup/backendsettings.cpp mythtv-0.18-patched/setup/backendsettings.cpp
>--- mythtv-0.18/setup/backendsettings.cpp	2005-03-28 00:53:22.000000000 +0100
>+++ mythtv-0.18-patched/setup/backendsettings.cpp	2005-05-01 11:35:00.000000000 +0100
>@@ -138,8 +138,8 @@
> 
> static HostSlider *BufferSize()
> {
>-    HostSlider* gc = new HostSlider("BufferSize", 1, 100, 1);
>-    gc->setLabel(QObject::tr("Live TV buffer (GB)"));
>+    HostSlider* gc = new HostSlider("BufferSize", 128, 4096, 128);
>+    gc->setLabel(QObject::tr("Live TV buffer (MB)"));
>     gc->setValue(5);
>     gc->setHelpText(QObject::tr("How large the live TV buffer is allowed to "
>                     "grow."));
>  
>
>------------------------------------------------------------------------
>
Sorry for the full quote, but this is an old post, so I think it is worth.

I think this would be a very nice feature, because RAM prices are low. 
Enter the buffer size in MB for disk usage should hurt anybody. Maybe 
the maximum buffer should be higher than 4096 MB.

Ticket?

Kristian Kalweit.


More information about the mythtv-dev mailing list