[mythtv] Captions/subtitles partially broken by mythrender_opengl.cpp commit

Lawrence Rust lvr at softsystem.co.uk
Mon Jan 4 19:00:52 UTC 2016


On Mon, 2016-01-04 at 19:53 +0100, Jonatan Lindblad wrote:
> Den 2016-01-04 kl. 19:26, skrev Lawrence Rust:
> > On Mon, 2016-01-04 at 09:33 -0800, Jim Stichnoth wrote:
> >> [This is mostly directed to lvr since I don't really know how this part of
> >> the code base works.]
> >>
> >> Regarding commit a437b178, "UI: Avoid texture memory exhaustion by
> >> shrinking the painter image cache".
> >>
> >> The change to mythrender_opengl.cpp, where ClearTexture() now fails if
> >> glCheck() reports an error, is having a weird effect on closed caption
> >> display on my systems.
> >>
> >> When it tries to draw the first line of text, glCheck() fails for some
> >> reason and nothing is drawn.  Subsequent caption lines display fine.  The
> >> black background rectangles display fine.  Repeated messages like this
> >> appear in the logs:
> >>
> >> 2016-01-03 18:09:29.515569 E  OpenGL: : 1281 @ mythrender_opengl.cpp, 1481
> >> 2016-01-03 18:09:29.515582 E  OpenGL: glTexImage size 180096 failed
> >> 2016-01-03 18:09:29.518569 E  Failed to create OpenGL texture.
> >>
> >> The log lines repeat once per video frame.
> >>
> >> Reverting that glCheck() call makes everything work fine.
> >>
> >> I see this with both cc708 and srt captions.  For some recordings, the
> >> first few captions will display fine, but then it drops into the mode where
> >> the first text line fails.
> >>
> >> Wondering if anyone else is seeing this problem and has any ideas.
> > 
> > Hi Jim,
> > 
> > Thanks for finding this.  Apologies for causing you the problem.  As you
> > have a system which demonstrates this problem perhaps you would help
> > debug the problem?
> > 
> > 1. Can you add this '-O UIPainterMaxCacheHW=96' to the FE command line
> > and see if the problem continues.
> > 
> > 2. If no change then would you add this patch:
> > 
> > --- a/mythtv/libs/libmythui/mythrender_opengl.cpp
> > +++ b/mythtv/libs/libmythui/mythrender_opengl.cpp
> > @@ -1461,6 +1461,7 @@ bool MythRenderOpenGL::ClearTexture(uint tex)
> >  
> >      memset(scratch, 0, tmp_size);
> >  
> > +    glCheck();
> >      if ((m_textures[tex].m_type == GL_TEXTURE_1D) && m_glTexImage1D)
> >      {
> >          m_glTexImage1D(m_textures[tex].m_type, 0,
> > 
> > 
> > If the problem is resolved by this patch then the GL error is occurring
> > in some previous code but being detected in ClearTexture.  In which case
> > would you move the glCheck() to various lines in
> > MythRenderOpenGL::CreateTexture to track which GL call is failing.  My
> > guess is it's in EnableTextures.
> 
> There aren't that many places where glCheck (really glGetError) is
> called so the error could be generated basically anywhere.  Qt have an
> interesting OpenGL debugging class since 5.1 that maybe could be of use,
> http://doc.qt.io/qt-5/qopengldebuglogger.html.
> 

The MythRenderOpenGL::CreateTexture call starts with a makeCurrent
followed by a glCheck, which succeeds.  So the failure occurs somewhere
between there and MythRenderOpenGL::ClearTexture.  There aren't that
many GL calls in between.

-- Lawrence Rust



More information about the mythtv-dev mailing list