2013/1/22 Alex Williamson <span dir="ltr"><<a href="mailto:alex.l.williamson@gmail.com" target="_blank">alex.l.williamson@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I've setup a very cpu and memory constrained slave backend solely for<br>
the purpose of connecting an hdpvr to the master backend. I'm running<br>
0.25+fixes and it appears to be working well so far, until I hit the<br>
recorded programs page in mythweb. At that point something decides<br>
it's a good mythpreviewgen target and farms out a few jobs to it. Not<br>
only do these jobs take a long time to complete on this slow box, but<br>
they risk interfering with the backend process and causing an oom on<br>
the slave.</blockquote><div><br></div><div>I've run into this problem also, but haven't found a good solution yet.</div><div><br></div><div>I found class PreviewGeneratorQueue which I thought would do exactly what I wanted. It limits the number of simultaneous preview generation jobs to <# CPU cores> * 2. Most preview generation inside mythtv seems to use this class, but the code used by mythweb and the upnp server seems to spawn mythpreviewgen processes directly.</div>
<div><br></div><div>I tried to use PreviewGeneratorQueue to also generate the upnp/mythweb previews but I'm having trouble getting the PREVIEW_SUCCESS/PREVIEW_FAILED callbacks back to the calling class. I think my problem is that the events I want end up MainServer::customEvent instead of being delivered to customEvent() of my own class. This could very well be the expected behaviour, I don't really understand QT's event handling.</div>
<div><br></div><div>I'd appreciate some input on this. Is using PreviewGeneratorQueue a good idea here? What would be the best way to implement this? Can I implement it all in class Content or do I need to fetch the events in MainServer::customEvent? Other suggestions/hints?</div>
<div><br></div><div>(My situation: I have a single backend which is quite low on RAM and CPU cycles. When mythpreviewgen runs it seems to allocate buffers for decoding 31 video frames and for my HD content this means it will allocate almost 30 Mb of memory for generating a single preview. Browsing recordings using mythweb or upnp can trigger preview generation for lots of recordings at the same time and the backend then runs out of memory in a very short time)</div>
<div><br></div><div>Robert</div>