Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. GUI Hang while playing audio in Infinite loop
Forum Updated to NodeBB v4.3 + New Features

GUI Hang while playing audio in Infinite loop

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 3 Posters 1.0k Views 6 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
    SKWH
    wrote on 25 Feb 2021, 07:39 last edited by SKWH
    #1

    Hello,

    We are developing an embedded application using Qt QML v 5.9.4 for an embedded application based on Yocto BSP.
    In our application we need to read from a device every 1 second over serial port. We are using QSerialPort for that.
    In addition to this we need to play a wav file continuously. We are using Audio of Multimedia component(QtMultimedia 5.8) and playing audio file like below:
    function playAudioLoop() {
    source = alarmSource
    loops = Audio.Infinite
    bindVolume(1)
    play()
    }
    Audio file length is of 8 seconds.

    If we don't play the audio, app runs smoothly. Whereas, if run the application with audio part, then GUI freezes after 3-4 hours or sometimes even after 12 hours. This freeze time varies from 3 hours to 12 hours.
    We also tried to add a delay timer of 3 seconds before replaying the wav file. With this, application ran for 26 hours and then GUI hang was again observed.

    Please let us know

    1. if there is any known issue with QML Multimedia component and whether we should try QSound as an alternative?
    2. Can this be due to synchronization? but then app plays fine without the audio part and hence we wonder.
    3. Is audio playing consuming too much processor and not letting UI responsive?
      Please note that we cannot debug the application and need to run the application in Release mode only on the device due to setup limitations

    Thanks.

    1 Reply Last reply
    1
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 25 Feb 2021, 20:05 last edited by
      #2

      Hi and welcome to devnet,

      For possible issues, you should check the bug report system.

      One thing your should consider is to update Qt to a more recent version to check whether the situation has improved.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply 26 Feb 2021, 15:04
      0
      • S SGaist
        25 Feb 2021, 20:05

        Hi and welcome to devnet,

        For possible issues, you should check the bug report system.

        One thing your should consider is to update Qt to a more recent version to check whether the situation has improved.

        S Offline
        S Offline
        SKWH
        wrote on 26 Feb 2021, 15:04 last edited by
        #3

        @SGaist Currently we cannot change the Qt version that we are using.
        Also, we couldn't find any open bug to related to GUI freeze due to Multimedia/Audio component

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 26 Feb 2021, 15:06 last edited by
          #4

          @SKWH said in GUI Hang while playing audio in Infinite loop:

          @SGaist Currently we cannot change the Qt version that we are using.

          While it's an answer I was expecting, it's still valid to check with a more recent version. If it works correctly then you'll have at least a possible way to patch the Qt release you are currently using.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply 2 Mar 2021, 06:55
          0
          • S SGaist
            26 Feb 2021, 15:06

            @SKWH said in GUI Hang while playing audio in Infinite loop:

            @SGaist Currently we cannot change the Qt version that we are using.

            While it's an answer I was expecting, it's still valid to check with a more recent version. If it works correctly then you'll have at least a possible way to patch the Qt release you are currently using.

            S Offline
            S Offline
            SKWH
            wrote on 2 Mar 2021, 06:55 last edited by
            #5

            @SGaist
            We had added a timer(3 second Timer) which starts once OnStopped event from Audio is received and on timeout(3 sec), we were playing the Audio file.
            We observed that after some time, OnStopped event is not received and hence Audio playing stops.
            Does anyone know why we might not be receiving onStopped event even though Audio file completes playing?
            Also, rest of the application just hangs causing the GUI to freeze when onStopped event is not received. This should not happen right?
            Even though onStopped is not received, may be only Audio playing functionality should be paused, but rest of the application should proceed.

            Any help is very much appreciated.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 2 Mar 2021, 20:17 last edited by
              #6

              Did you check whether the freezing would happen at the same time of some resource exhaustion on your device ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              S 1 Reply Last reply 4 Mar 2021, 09:00
              0
              • S SGaist
                2 Mar 2021, 20:17

                Did you check whether the freezing would happen at the same time of some resource exhaustion on your device ?

                S Offline
                S Offline
                SKWH
                wrote on 4 Mar 2021, 09:00 last edited by
                #7

                @SGaist No there is no resource exhaustion that we are seeing during this freeze scenario.
                Also, we had kept the system with only audio functionality disabled, with this, system was running smoothly for 45+ hours. So Audio is surely playing some spoil sport here.
                We are using timers in C++, lowest interval being 1 sec and also we have timers in QML, there as well lowest being 1 second. QML 1 sec timer is need to updated clock on UI.
                Can it happen that while Audio is playing these timers cause some deadlock kind of thing?

                F 1 Reply Last reply 4 Mar 2021, 16:25
                0
                • S SKWH
                  4 Mar 2021, 09:00

                  @SGaist No there is no resource exhaustion that we are seeing during this freeze scenario.
                  Also, we had kept the system with only audio functionality disabled, with this, system was running smoothly for 45+ hours. So Audio is surely playing some spoil sport here.
                  We are using timers in C++, lowest interval being 1 sec and also we have timers in QML, there as well lowest being 1 second. QML 1 sec timer is need to updated clock on UI.
                  Can it happen that while Audio is playing these timers cause some deadlock kind of thing?

                  F Offline
                  F Offline
                  fcarney
                  wrote on 4 Mar 2021, 16:25 last edited by
                  #8

                  @SKWH Try a different machine with a different driver. Perhaps update the system driver for the audio. Make sure you are not fighting a system problem.

                  C++ is a perfectly valid school of magic.

                  1 Reply Last reply
                  0

                  1/8

                  25 Feb 2021, 07:39

                  • Login

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