<div dir="ltr">On Tue, Sep 17, 2013 at 4:43 AM, Daniel Foster <span dir="ltr">&lt;<a href="mailto:daniel@df.me.uk" target="_blank">daniel@df.me.uk</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Have you seen this?</div>
<div><a href="http://code.mythtv.org/trac/ticket/11020" target="_blank">http://code.mythtv.org/trac/ticket/11020</a><br>
</div><div><br></div><div>This looks like the issue described to a &quot;T&quot;... I am going to add the Patch to my Atom Frontend Build and see what happens..</div></div></blockquote><div><br></div></div><div>That does look very likely - I was looking in roughly the right place!  Mike is all from packages, but I think I&#39;ll have a go at building that in and see what happens.</div>

<div><br></div><div>I&#39;m not sure why the free recorders call is needed, as moving to another channel in the guide grid doesn&#39;t change the tuned channel until enter is pressed on it.  Some more code reading might be needed.</div>

<div><br></div></div></div></div></blockquote><div>Here&#39;s a section of the stack trace where the free recorder query is being made:</div><div><br></div><div>(gdb) where</div><div>#0  TV::IsTunableOn (this=0x164fc50, ctx=0x12ad840, chanid=1042, use_cache=true, early_exit=true) at tv_play.cpp:8325</div>
<div>#1  0x00007ffff74de93f in TV::IsTunable (this=0x164fc50, ctx=0x12ad840, chanid=1042, use_cache=true) at tv_play.cpp:8307</div><div>#2  0x000000000055606e in GuideGrid::updateChannels (this=0x2484820) at guidegrid.cpp:1553</div>
<div>#3  0x00000000005577b4 in GuideGrid::cursorUp (this=0x2484820) at guidegrid.cpp:1878</div><div>#4  0x000000000054fc7c in GuideGrid::keyPressEvent (this=0x2484820, event=0x7fffffffa4d0) at guidegrid.cpp:467</div><div>
...</div><div><br></div><div>For each channel of the guide displayed on the screen, GuideGrid::updateChannels() is determining whether that channel is available for tuning so that the theme can display the channel in a different font, presumably so the user knows whether they can switch to that channel.</div>
<div><br></div><div>The patch in the ticket is a nice proof of concept, but I don&#39;t think that&#39;s how the stuttering problem should be solved.  A better approach is to offload queries like this into a helper thread which later communicates the changes to the UI thread.  Even better, create a QEvent that periodically polls for the query result and updates the UI elements upon completion, which avoids extra threads and synchronization.</div>
<div><br></div><div>I also notice slight stuttering when scrolling left/right in the guide with an ION frontend.  No queries are going on when this happens, so I think it&#39;s the latency of creating all the grid items, especially using the expensive QTextLayout operations.  Background processing via QEvents should be useful here.</div>
<div><br></div><div>Jim</div></div></div></div>