[Development] [QML] Avoiding graphics flicker in Quick2

Denis Shienkov denis.shienkov at gmail.com
Fri Aug 5 14:56:08 CEST 2016


>> I suggested to use an OpenGL example
> Pure Open GL example does not work at all (e.g. I tried Cube example).. I
see only a black screen, and some of OpenGL textures errors.

Also I have tried to use an ContextInfo example, where it is possible to
choose an OpenGL or OpenGL ES.

1. So, when it is selected OpenGL, then app says that it is impossible to
create a context:

{quote}
Requesting surface format QSurfaceFormat(version 2.0, options QFlags(),
depthBufferSize 16, redBufferSize -1, greenBufferSize -1, blueBufferSize
-1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior 0,
swapInterval 1, profile  0)
Cannot find EGLConfig, returning null config
QEGLPlatformContext: Failed to create context: 3005
{quote}

2. So, when it is selected OpenGL ES, then app crashed:

{quote}
Requesting surface format QSurfaceFormat(version 2.0, options QFlags(),
depthBufferSize 16, redBufferSize -1, greenBufferSize -1, blueBufferSize
-1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior 0,
swapInterval 1, profile  0)
EGLFS: OpenGL windows cannot be mixed with others.
sh: line 1:  1842 Aborted                 DISPLAY=':0.0'
/home/root/deploy-apps/contextinfo
Application finished with exit code 134.
{quote}


So, it is impossible for me check it with pure OpenGL at all..



2016-08-05 14:53 GMT+03:00 Denis Shienkov <denis.shienkov at gmail.com>:

> > I suggested to use an OpenGL example
>
> Pure Open GL example does not work at all (e.g. I tried Cube example).. I
> see only a black screen, and some of OpenGL textures errors.
>
> PS: I have crerated a bug https://bugreports.qt.io/browse/QTBUG-55162
> (just in case)
>
> 2016-08-05 14:39 GMT+03:00 Sean Harmer <sean.harmer at kdab.com>:
>
>> I suggested to use an OpenGL example, not a Qt Quick one. We're trying to
>> isolate where the issue is in the stack. So use a single threaded, plain
>> OpenGL application with a 32 bit framebuffer and see if that gives the
>> same
>> issue.
>>
>> Cheers,
>>
>> Sean
>>
>> On Friday 05 August 2016 14:22:00 Denis Shienkov wrote:
>> > So, I have compiled the standard Samehame QMML application from:
>> >
>> > /home/builder/Projects/qt5/qtdeclarative/examples/quick/demos/samegame/
>> >
>> > and got same artifacts when I use RDBA=8888 mode.
>> >
>> > I have "screenshoot" of this flicking attifact:
>> > http://pasteboard.co/4XjMl3GNq.png
>> >
>> > I'm personally don't think that this is an NVidia's OpenGL ES2 bug... I
>> > think it is Qt bug...
>> >
>> > I'm not an OpenGL expert... so, can anybody point me what I need to do
>> with
>> > the Qt sources (where to look in)?
>> >
>> > Maybe I need to add some of gl_ functions to clear of content or
>> something
>> > else... but where?
>> >
>> > 2016-08-05 12:03 GMT+03:00 Sean Harmer <sean.harmer at kdab.com>:
>> > > On Friday 05 August 2016 12:02:10 Denis Shienkov wrote:
>> > > > > Can you try a plain OpenGL test application with RGBA8 framebuffer
>> > > >
>> > > > Do you mean: I should take any OpenGL application from the Qt
>> examples?
>> > >
>> > > And
>> > >
>> > > > to check there?
>> > >
>> > > You may need to modify it to explicitly request R8G8B8A8 using a
>> > > QSurfaceFormat but yes any of those should work to prove/disprove.
>> > >
>> > > Sean
>> > >
>> > > > 2016-08-05 11:53 GMT+03:00 Sean Harmer <sean.harmer at kdab.com>:
>> > > > > Hi,
>> > > > >
>> > > > > Can you try a plain OpenGL test application with RGBA8
>> framebuffer and
>> > >
>> > > see
>> > >
>> > > > > if
>> > > > > that exhibits the same flashing/flickering problem. If so, it's a
>> > > > > driver/hardware issue.
>> > > > >
>> > > > > If you are forced into then using a 16-bit framebuffer, then you
>> can
>> > >
>> > > avoid
>> > >
>> > > > > the
>> > > > > banding by using dithering in your gradients. Either apply the
>> > >
>> > > dithering
>> > >
>> > > > > offline
>> > > > > and store the gradients as images or write a custom material that
>> > >
>> > > applies
>> > >
>> > > > > the
>> > > > > dithering in the fragment shader.
>> > > > >
>> > > > > Cheers,
>> > > > >
>> > > > > Sean
>> > > > >
>> > > > > On Friday 05 August 2016 08:12:59 Denis Shienkov wrote:
>> > > > > > Hi all,
>> > > > > >
>> > > > > > I have an idea how to avoid flickering, but I don't know about
>> > >
>> > > results:
>> > > > > > what if I will discard the Open GL support in favor to Quick2
>> > > > > > render?
>> > > > > >
>> > > > > > I have read this documentation: http://doc.qt.io/QtQuick2DRend
>> erer/
>> > > > > > which says about the "Qt Quick 2D Renderer" module.
>> > > > > >
>> > > > > > So, my things is:
>> > > > > >
>> > > > > > 1. Download && build && install  this module:
>> > > > > >
>> > > > > > git://code.qt.io/qt/qtdeclarative-render2d.git
>> > > > > >
>> > > > > > 2. Use this env variable:
>> > > > > >
>> > > > > > export QMLSCENE_DEVICE=softwarecontext
>> > > > > >
>> > > > > > 3. Run my app...
>> > > > > >
>> > > > > >
>> > > > > > But, I  don't understand:
>> > > > > >
>> > > > > > 1) What of engine is used to 2D rendering in case if I have
>> EGLFS
>> > >
>> > > only?
>> > >
>> > > > > > 2) Should I re-build Qt5 too with the "--no-opengl" option (or
>> I can
>> > > > > > keep the "-opengl es2" option) ?
>> > > > > >
>> > > > > > 04.08.2016 16:10, Denis Shienkov пишет:
>> > > > > > > Hi Robin,
>> > > > > > >
>> > > > > > > > Repeating my last answer...
>> > > > > > > > http://lists.qt-project.org/pipermail/development/2016-> >
>> > > > >
>> > > > > July/026736.html
>> > > > >
>> > > > > > > I'm sorry, but I did not receive (did not see) your last
>> answer.
>> > > > > > >
>> > > > > > > > I'm going to guess you're using eglfs or something like that
>> > > > > > >
>> > > > > > > Yes, I use EGLFS via X11 on Linux Apalis T30 board, where are
>> used
>> > > > > > > NVIDIA's drivers.
>> > > > > > >
>> > > > > > > Seems, the flickering is when are used:
>> > > > > > >
>> > > > > > > export QT_QPA_EGLFS_FORCE888=1
>> > > > > > >
>> > > > > > > ENV variable... (I need this variable to smooth the Image's
>> > > > > > > gradients... even X11 started with 24-bit depth).
>> > > > > > >
>> > > > > > > PS: But, I'm not sure about QT_QPA_EGLFS_FORCE888... :(
>> > > > > > >
>> > > > > > > > Using an overlay to debug item positions
>> > > > > > > > (QSG_VISUALIZE=overdraw)
>> > > > > > >
>> > > > > > > could be handy for trying to rule
>> > > > > > > this out, as if it is specific to the application,
>> > > > > > >
>> > > > > > > Ok, many thanks, I will try it.
>> > > > > > >
>> > > > > > >
>> > > > > > > 2016-08-04 14:57 GMT+03:00 Robin Burchell <
>> robin+qt at viroteck.net
>> > > > > > >
>> > > > > > > <mailto:robin+qt at viroteck.net>>:
>> > > > > > >     Repeating my last answer...
>> > > > > > >
>> > > > > > >     http://lists.qt-project.org/pipermail/development/2016->
>> >
>> > > > >
>> > > > > July/026736.htm
>> > > > >
>> > > > > > >     l
>> > > > > > >
>> > > > > > >     On Thu, Aug 4, 2016, at 01:50 PM, Denis Shienkov wrote:
>> > > > > > >     > {quote}
>> > > > > > >     >
>> > > > > > >     > Hi all.
>> > > > > > >     >
>> > > > > > >     > I have some QML application, where just use QQuickView
>> as
>> > > > > > >     > QML
>> > > > > > >
>> > > > > > >     container.
>> > > > > > >
>> > > > > > >     > This application uses Qt 5.7.x and running on Linux
>> embedded
>> > > > > > >
>> > > > > > >     board with
>> > > > > > >
>> > > > > > >     > the
>> > > > > > >     > NVIDIA core (Toradex Apalis T30).
>> > > > > > >     >
>> > > > > > >     > But sometimes I got flickering in process of animation.
>> A
>> > > > >
>> > > > > flickering
>> > > > >
>> > > > > > >     > represents in form of a "white" strips with full-screen
>> > > > > > >     > width
>> > > > > > >
>> > > > > > >     and 1/5-1/6
>> > > > > > >
>> > > > > > >     > screen heigth. This flickers happens quickly and
>> frequently
>> > > > > > >
>> > > > > > >     (every ~20-60
>> > > > > > >
>> > > > > > >     > seconds, randomly)...
>> > > > > > >     >
>> > > > > > >     > I have seen this "Avoiding graphics flicker in Qt /
>> QML" [1]
>> > > > > > >
>> > > > > > >     blog where
>> > > > > > >
>> > > > > > >     > are
>> > > > > > >     > used QML with Qt 4.x,
>> > > > > > >     > where were used this trics:
>> > > > > > >     >
>> > > > > > >     > {code}
>> > > > > > >     > int main(int argc, char **argv)
>> > > > > > >     > {
>> > > > > > >     >
>> > > > > > >     >     ...
>> > > > > > >     >
>> > > > > > >     >  view.setAttribute(Qt::WA_OpaquePaintEvent);
>> > > > > > >     >  view.setAttribute(Qt::WA_NoSystemBackground);
>> > > > > > >     >  view.viewport()->setAttribute(
>> Qt::WA_OpaquePaintEvent);
>> > > > > > >     >  view.viewport()->setAttribute(
>> Qt::WA_NoSystemBackground);
>> > > > > > >     >
>> > > > > > >     >     ...
>> > > > > > >     >
>> > > > > > >     > }
>> > > > > > >     > {code}
>> > > > > > >     >
>> > > > > > >     > But, in my case I have use Quick v2, with QQuickView
>> instead
>> > >
>> > > of
>> > >
>> > > > > > >     > QDeclarativeView,
>> > > > > > >     > which does not allowed to setup any attributes.
>> > > > > > >     >
>> > > > > > >     > So, my questions is: is there are any way to setup
>> > > > > > >     > Qt::WA_OpaquePaintEvent
>> > > > > > >     > and/or
>> > > > > > >     > Qt::WA_NoSystemBackground in Quck2? Or, maybe is it
>> possible
>> > >
>> > > to
>> > >
>> > > > > use
>> > > > >
>> > > > > > >     > another
>> > > > > > >     > tricks?
>> > > > > > >     >
>> > > > > > >     > BR,
>> > > > > > >     > Denis
>> > > > > > >
>> > > > > > >     [1]https://blog.rburchell.com/2011/11/avoiding-graphics->
>> >
>> > > > >
>> > > > > flicker-in-qt-> >     qml.html>
>> > > > >
>> > > > > > >     > {quote}
>> > > > > > >     >
>> > > > > > >     > This flickering present on some HDMI displays...
>> > > > > > >     >
>> > > > > > >     > We currently have this flags:
>> > > > > > >     >
>> > > > > > >     > {code}
>> > > > > > >     > ...
>> > > > > > >     > view.setFlags(Qt::FramelessWindowHint |
>> > > > >
>> > > > > Qt::WindowStaysOnTopHint);
>> > > > >
>> > > > > > >     > ...
>> > > > > > >     > {code}
>> > > > > > >     >
>> > > > > > >     > Maybe is it an reasons of flikering? Has someone any
>> ideas?
>> > > > > > >     >
>> > > > > > >     > BR,
>> > > > > > >     > Denis
>> > > > > > >     > _______________________________________________
>> > > > > > >     > Development mailing list
>> > > > > > >     > Development at qt-project.org <mailto:Development at qt-
>> > >
>> > > project.org>
>> > >
>> > > > > > >     > http://lists.qt-project.org/ma
>> ilman/listinfo/development
>> > > > >
>> > > > > --
>> > > > > Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
>> > > > > KDAB (UK) Ltd, a KDAB Group company
>> > > > > Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
>> > > > > Mobile: +44 (0)7545 140604
>> > > > > KDAB - Qt Experts
>> > > > > _______________________________________________
>> > > > > Development mailing list
>> > > > > Development at qt-project.org
>> > > > > http://lists.qt-project.org/mailman/listinfo/development
>> > >
>> > > --
>> > > Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
>> > > KDAB (UK) Ltd, a KDAB Group company
>> > > Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
>> > > Mobile: +44 (0)7545 140604
>> > > KDAB - Qt Experts
>>
>> --
>> Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
>> KDAB (UK) Ltd, a KDAB Group company
>> Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
>> Mobile: +44 (0)7545 140604
>> KDAB - Qt Experts
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160805/2b149770/attachment.html>


More information about the Development mailing list