Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Long GUI Thread Sync causes stuttering



  • Hi there,
    I'm drawing a horizontal line at 25 Hz triggered from QTimer in a ChartView. If no other animations appear on screen it is drawn fluently and without any stuttering:
    pleth_fb_buffer_4_no_other_animations.PNG

    Once there is another item drawn besides that line (here a digital clock as text updated every second) the duration for GUI thread sync increases significantly:
    pleth_fb_buffer_4_time_only_detail.PNG

    If there a more items / plots updated in parallel the situation gets even worse and the line is visibly stuttering.

    How can I overcome this issue and shorten the GUI blockage / synchronization time within the render thread?
    Note the 19 ms spent in renderloop (thereof 18 for render):

    <7>Frame prepared with 'threaded' renderloop, polish=0, lock=0, blockedForSync=0, animations=0 - (on Gui thread) QQuickApplicationWindow_QML_55(0x226e3a8 active exposed, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint), name="mainWindow", geometry=0,0 1024x600)
    <7>Frame rendered with 'threaded' renderloop in 6ms, sync=0, render=5, swap=1 - (on render thread)
    
    <7>Frame prepared with 'threaded' renderloop, polish=0, lock=0, blockedForSync=0, animations=0 - (on Gui thread) QQuickApplicationWindow_QML_55(0x226e3a8 active exposed, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint), name="mainWindow", geometry=0,0 1024x600)
    <7>Frame rendered with 'threaded' renderloop in 7ms, sync=0, render=6, swap=1 - (on render thread)
    
    <7>Frame prepared with 'threaded' renderloop, polish=0, lock=0, blockedForSync=0, animations=0 - (on Gui thread) QQuickApplicationWindow_QML_55(0x226e3a8 active exposed, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint), name="mainWindow", geometry=0,0 1024x600)
    <7>Frame rendered with 'threaded' renderloop in 19ms, sync=0, render=18, swap=1 - (on render thread)
    
    <7>Frame prepared with 'threaded' renderloop, polish=0, lock=0, blockedForSync=4, animations=0 - (on Gui thread) QQuickApplicationWindow_QML_55(0x226e3a8 active exposed, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint), name="mainWindow", geometry=0,0 1024x600)
    <7>Frame rendered with 'threaded' renderloop in 8ms, sync=0, render=6, swap=2 - (on render thread)
    
    <7>Frame prepared with 'threaded' renderloop, polish=0, lock=0, blockedForSync=0, animations=0 - (on Gui thread) QQuickApplicationWindow_QML_55(0x226e3a8 active exposed, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint), name="mainWindow", geometry=0,0 1024x600)
    <7>Frame rendered with 'threaded' renderloop in 6ms, sync=0, render=5, swap=1 - (on render thread)
    

    QSG_INFO:

    <7>Using sg animation driver
    
    <7>Animation Driver: using vsync: 16.95 ms
    
    <7>Frame rendered with 'threaded' renderloop in 0ms, sync=0, render=0, swap=0 - (on render thread)
    
    <7>texture atlas dimensions: 1024x1024
    
    <7>R/G/B/A Buffers:   8 8 8 0
    
    <7>Depth Buffer:      24
    
    <7>Stencil Buffer:    8
    
    <7>Samples:           0
    
    <7>GL_VENDOR:         Vivante Corporation
    
    <7>GL_RENDERER:       Vivante GC880
    
    <7>GL_VERSION:        OpenGL ES 3.0 V6.2.4.p2.163672
    
    <7>GL_EXTENSIONS:     GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_EXT_frag_depth GL_EXT_multi_draw_arrays GL_EXT_multisampled_render_to_texture GL_EXT_read_format_bgra GL_EXT_robustness GL_EXT_sRGB GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_sRGB_decode GL_EXT_texture_type_2_10_10_10_REV GL_OES_EGL_image GL_OES_EGL_sync GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_te
    <7>Max Texture Size: 8192
    

    Using Qt 5.12.6 on NXP's i.MX6DL.

    Thanks and best
    Stephan


Log in to reply