Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Fully offscreen QML rendering
Forum Updated to NodeBB v4.3 + New Features

Fully offscreen QML rendering

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
qmleglfsdummyoffscreen
4 Posts 2 Posters 809 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skinkie
    wrote on last edited by
    #1

    I am using a slightly modified version of qml_movie_renderer which gives the ability to render QML-output into separate images. I have noticed that this, in one way or the other, requires to have a platform such as eglfs available. Which indirectly requires a monitor to be connected. I am interested in the following things.

    1. Is it possible (like with a raspberry pi) to specify in the Linux cmdline directly that a certain HDMI-output must be always available, even when no screen is connected, to prevent the "No screens available" errors. Something like a non-hardware based dummy output would do too.
    2. The movierenderer code fails on a segmentation fault after QOpenGLFramebufferObject not being available. This is true for platform vnc as well. Is there a way to have a fully software backend QOpenGLFramebufferObject not dependent on hardware?
    sierdzioS S 2 Replies Last reply
    0
    • S skinkie

      I am using a slightly modified version of qml_movie_renderer which gives the ability to render QML-output into separate images. I have noticed that this, in one way or the other, requires to have a platform such as eglfs available. Which indirectly requires a monitor to be connected. I am interested in the following things.

      1. Is it possible (like with a raspberry pi) to specify in the Linux cmdline directly that a certain HDMI-output must be always available, even when no screen is connected, to prevent the "No screens available" errors. Something like a non-hardware based dummy output would do too.
      2. The movierenderer code fails on a segmentation fault after QOpenGLFramebufferObject not being available. This is true for platform vnc as well. Is there a way to have a fully software backend QOpenGLFramebufferObject not dependent on hardware?
      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @skinkie You can try running your app with -platform offscreen command line argument. Not sure if it will fix the issue, but it is the simplest to try :-)

      1. I don't know about command line, but you can search online and buy a "dummy monitor" device (also called monitor emulator), they are available for HDMI and not very expensive. You just plug it in and your Raspberry will think a monitor is connected.

      2. I think it should be possible with llvm-pipe, yes. MESA does have software-based OpenGL renderer. I don't know how to do it, though. But if you are using Raspberry Pi, there is no need for it, as it does have a GPU and good OpenGL drivers.

      (Z(:^

      S 1 Reply Last reply
      0
      • sierdzioS sierdzio

        @skinkie You can try running your app with -platform offscreen command line argument. Not sure if it will fix the issue, but it is the simplest to try :-)

        1. I don't know about command line, but you can search online and buy a "dummy monitor" device (also called monitor emulator), they are available for HDMI and not very expensive. You just plug it in and your Raspberry will think a monitor is connected.

        2. I think it should be possible with llvm-pipe, yes. MESA does have software-based OpenGL renderer. I don't know how to do it, though. But if you are using Raspberry Pi, there is no need for it, as it does have a GPU and good OpenGL drivers.

        S Offline
        S Offline
        skinkie
        wrote on last edited by
        #3

        @sierdzio the "-platform offscreen" option gives the same crash on the specific PC. The issue does not happen on a RaspberryPi since it allows for the "hotplug" option, and likely the proper drivers, I am trying to achieve that on a regular PC.

        Thread 1 "renderzmq" received signal SIGSEGV, Segmentation fault.
        0x00007fffeed8900a in QOpenGLContext::format() const () from /usr/lib/libQt5Gui.so.5
        (gdb) bt
        #0  0x00007fffeed8900a in QOpenGLContext::format() const () at /usr/lib/libQt5Gui.so.5
        #1  0x00007fffeed89089 in QOpenGLContext::isOpenGLES() const () at /usr/lib/libQt5Gui.so.5
        #2  0x00007fffef08110f in QOpenGLFramebufferObject::QOpenGLFramebufferObject(QSize const&, QOpenGLFramebufferObject::Attachment, unsigned int, unsigned int) () at /usr/lib/libQt5Gui.so.5
        #3  0x0000555555566099 in MovieRenderer::createFbo() (this=0x5555555e31d0) at /home/skinkie/render-zmq/renderzmq/movierenderer.cpp:196
        #4  0x0000555555565eac in MovieRenderer::start() (this=0x5555555e31d0) at /home/skinkie/render-zmq/renderzmq/movierenderer.cpp:166
        #5  0x000055555555bd9d in MovieRenderer::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x5555555e31d0, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffffffbe50)
            at /home/skinkie/render-zmq/build-renderzmq-Desktop-Debug/renderzmq_autogen/EWIEGA46WW/moc_movierenderer.cpp:129
        #6  0x00007fffee2d1253 in  () at /usr/lib/libQt5Core.so.5
        #7  0x00007fffee837305 in QQmlVMEMetaObject::metaCall(QObject*, QMetaObject::Call, int, void**) () at /usr/lib/libQt5Qml.so.5
        #8  0x00007fffee87ce04 in  () at /usr/lib/libQt5Qml.so.5
        #9  0x00007fffee77e006 in  () at /usr/lib/libQt5Qml.so.5
        #10 0x00007fffee780036 in QV4::QObjectMethod::callInternal(QV4::Value const*, QV4::Value const*, int) const () at /usr/lib/libQt5Qml.so.5
        #11 0x00007fffee7903b7 in  () at /usr/lib/libQt5Qml.so.5
        #12 0x00007fffee793d74 in  () at /usr/lib/libQt5Qml.so.5
        #13 0x00007fffee737100 in  () at /usr/lib/libQt5Qml.so.5
        #14 0x00007fffee7903b7 in  () at /usr/lib/libQt5Qml.so.5
        #15 0x00007fffee793d74 in  () at /usr/lib/libQt5Qml.so.5
        #16 0x00007fffee7372fa in QV4::Function::call(QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext const*) () at /usr/lib/libQt5Qml.so.5
        #17 0x00007fffee89837d in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) () at /usr/lib/libQt5Qml.so.5
        #18 0x00007fffee84f541 in QQmlBoundSignalExpression::evaluate(void**) () at /usr/lib/libQt5Qml.so.5
        #19 0x00007fffee84fc2c in  () at /usr/lib/libQt5Qml.so.5
        #20 0x00007fffee87cd25 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () at /usr/lib/libQt5Qml.so.5
        #21 0x00007fffee2d0980 in  () at /usr/lib/libQt5Core.so.5
        #22 0x00007fffee8e1e79 in QQmlTimer::event(QEvent*) () at /usr/lib/libQt5Qml.so.5
        #23 0x00005555555619ed in RenderApp::notify(QObject*, QEvent*) (this=0x7fffffffe900, obj=0x555555625970, event=0x55555578b9c0)
            at /home/skinkie/render-zmq/build-renderzmq-Desktop-Debug/renderzmq_autogen/EWIEGA46WW/../../../renderzmq/renderapp.h:25
        #24 0x00007fffee29c168 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
        #25 0x00007fffee2a10cb in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
        #26 0x00007fffee2e7138 in  () at /usr/lib/libQt5Core.so.5
        #27 0x00007fffe7d34f69 in  () at /usr/lib/libglib-2.0.so.0
        #28 0x00007fffe7d93367 in  () at /usr/lib/libglib-2.0.so.0
        #29 0x00007fffe7d33162 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
        #30 0x00007fffee2eaf7c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
        #31 0x00007fffee29ae74 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
        #32 0x00007fffee29c313 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
        #33 0x00005555555652d8 in main(int, char**) (argc=1, argv=0x7fffffffea48) at /home/skinkie/render-zmq/renderzmq/main.cpp:59
        (gdb) up
        #1  0x00007fffeed89089 in QOpenGLContext::isOpenGLES() const () from /usr/lib/libQt5Gui.so.5
        (gdb) up
        #2  0x00007fffef08110f in QOpenGLFramebufferObject::QOpenGLFramebufferObject(QSize const&, QOpenGLFramebufferObject::Attachment, unsigned int, unsigned int) () from /usr/lib/libQt5Gui.so.5
        (gdb) up
        #3  0x0000555555566099 in MovieRenderer::createFbo (this=0x5555555e31d0) at /home/skinkie/render-zmq/renderzmq/movierenderer.cpp:196
        196	    m_fbo = new QOpenGLFramebufferObject(m_size * m_dpr, QOpenGLFramebufferObject::CombinedDepthStencil);
        (gdb) list
        191	    destroyFbo();
        192	}
        193	
        194	void MovieRenderer::createFbo()
        195	{
        196	    m_fbo = new QOpenGLFramebufferObject(m_size * m_dpr, QOpenGLFramebufferObject::CombinedDepthStencil);
        197	    m_quickWindow->setRenderTarget(m_fbo);
        198	}
        199	
        200	void MovieRenderer::destroyFbo()
        

        I have also tried setting export LIBGL_ALWAYS_SOFTWARE=1. And QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); in the main function of the application.

        Now the obvious question is EGL available? According to eglinfo there is. But LIBGL_DEBUG=verbose does not give output either.

        1 Reply Last reply
        0
        • S skinkie

          I am using a slightly modified version of qml_movie_renderer which gives the ability to render QML-output into separate images. I have noticed that this, in one way or the other, requires to have a platform such as eglfs available. Which indirectly requires a monitor to be connected. I am interested in the following things.

          1. Is it possible (like with a raspberry pi) to specify in the Linux cmdline directly that a certain HDMI-output must be always available, even when no screen is connected, to prevent the "No screens available" errors. Something like a non-hardware based dummy output would do too.
          2. The movierenderer code fails on a segmentation fault after QOpenGLFramebufferObject not being available. This is true for platform vnc as well. Is there a way to have a fully software backend QOpenGLFramebufferObject not dependent on hardware?
          S Offline
          S Offline
          skinkie
          wrote on last edited by
          #4

          @skinkie said in Fully offscreen QML rendering:

          Is it possible (like with a raspberry pi) to specify in the Linux cmdline directly that a certain HDMI-output must be always available, even when no screen is connected, to prevent the "No screens available" errors. Something like a non-hardware based dummy output would do too.

          I can answer the first question. You can specify video=HDMI-A-1:1280x720-24@50D to force the digital output on (notice the D in the end, e will work too). My current system makes that interlaced output, so it has some particularities.

          If you want interlacing in Qt, on EGLFS that would still need this bug+patch to be applied. Sadly...

          For question two. Still stumbling.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved