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. Qt application laggy/rendering artifacts when startet using a systemd service
Forum Updated to NodeBB v4.3 + New Features

Qt application laggy/rendering artifacts when startet using a systemd service

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 2 Posters 722 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.
  • B Offline
    B Offline
    bozo
    wrote on 21 Oct 2019, 13:18 last edited by
    #1

    Hello,
    A Qt-based application is supposed to start on boot on a debian 9 based system. When starting the application manually over the console or deploy and start it with qt-creator it runs smoothly.

    When it gets startet by systemd on startup the application is not as responsive and there are some artifacts visible when swiping in the app.

    I thought that this might have something to do with priority and scheduling so I tried to set the priority manually. This did not help

    This is the .service:

    [Unit]
    Description=DM QT Application
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/sudo --user=dm /etc/init.d/dm-appstart-qt.sh
    #ExecStart=/etc/init.d/dm-appstart-qt.sh
    CPUSchedulingPriority=20
    
    [Install]
    WantedBy=multi-user.target
    

    What could be the reason for the difference in percieved performance between the systemd service starting the application and me manually starting it?

    S 1 Reply Last reply 22 Oct 2019, 06:28
    0
    • B bozo
      21 Oct 2019, 13:18

      Hello,
      A Qt-based application is supposed to start on boot on a debian 9 based system. When starting the application manually over the console or deploy and start it with qt-creator it runs smoothly.

      When it gets startet by systemd on startup the application is not as responsive and there are some artifacts visible when swiping in the app.

      I thought that this might have something to do with priority and scheduling so I tried to set the priority manually. This did not help

      This is the .service:

      [Unit]
      Description=DM QT Application
      After=network.target
      
      [Service]
      Type=simple
      ExecStart=/usr/bin/sudo --user=dm /etc/init.d/dm-appstart-qt.sh
      #ExecStart=/etc/init.d/dm-appstart-qt.sh
      CPUSchedulingPriority=20
      
      [Install]
      WantedBy=multi-user.target
      

      What could be the reason for the difference in percieved performance between the systemd service starting the application and me manually starting it?

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 22 Oct 2019, 06:28 last edited by
      #2

      @bozo said in Qt application laggy/rendering artifacts when startet using a systemd service:

      What could be the reason for the difference in percieved performance between the systemd service starting the application and me manually starting it?

      I think your app is started before GPU driver is loaded - and the app starts with software renderer (MESA). If only possible, launch it later, preferably when some user is already logged in.

      (Z(:^

      B 1 Reply Last reply 22 Oct 2019, 08:50
      2
      • B Offline
        B Offline
        bozo
        wrote on 22 Oct 2019, 08:37 last edited by bozo
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • S sierdzio
          22 Oct 2019, 06:28

          @bozo said in Qt application laggy/rendering artifacts when startet using a systemd service:

          What could be the reason for the difference in percieved performance between the systemd service starting the application and me manually starting it?

          I think your app is started before GPU driver is loaded - and the app starts with software renderer (MESA). If only possible, launch it later, preferably when some user is already logged in.

          B Offline
          B Offline
          bozo
          wrote on 22 Oct 2019, 08:50 last edited by
          #4

          @sierdzio The issue still exists after delaying the start of the application by 60s. By then the gpu driver should be loaded. This version of debian has no desktop environment installed so the only graphical application is the qt-app.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bozo
            wrote on 22 Oct 2019, 10:01 last edited by bozo
            #5

            I noticed this output from the systemd log:

            Oct 22 09:25:09 dlogic-dm dm-appstart-qt.sh[461]: QEglFSVivIntegration will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.
            Oct 22 09:25:09 dlogic-dm dm-appstart-qt.sh[461]:  If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
            

            This message does not appear in the output when starting the app manually. I permanently set QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER to 1 but there is still stuttering and tearing.

            I narrowed it down futher: When starting the service with

            systemctl start foo.service
            

            there also is stuttering. When calling the startscript the service uses manually, the application runs smoothly.

            1 Reply Last reply
            -1
            • B Offline
              B Offline
              bozo
              wrote on 28 Oct 2019, 11:12 last edited by bozo
              #6

              I managed to get it to run properly but I still am not sure why it behaved like described in the first place.
              Logging in as root and then starting the app manually also resulted in the same issues as using a service to start the app.
              The fix was to export the variable FB_MULTI_BUFFER=3. Setting it to 2 causes screen tearing, 1 results in animations running too fast since there is no vsync.

              1 Reply Last reply
              0

              1/6

              21 Oct 2019, 13:18

              • Login

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