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. [ignored] Issue with QTimer::singleshot() on ARM
QtWS25 Last Chance

[ignored] Issue with QTimer::singleshot() on ARM

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 3 Posters 2.5k Views
  • 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.
  • H Offline
    H Offline
    helthans
    wrote on last edited by
    #1

    I have an application which consists of a number of plugins. One of the plugins is a HTTP server which listens for inputs and sends request to a mediplayer plugin through a pointer. I have implemented the possibility to send a "play", "pause" and "stop" command to the HTTP server which then (of course) either tells the mediaplayer to start playing, pause playing or stop playing. On my desktop Linux everthing seems to work like a charm, but I want to run it on an arm processor (in my case an ODROID-U3), and here I get problems when I try using the "stop" command, as I get the error

    @QObject::killTimer: timers cannot be stopped from another thread@

    and after a while I usually get a segmentation fault, which I suspect is related to the above, as it only seems to happen if I have sent the "stop" command.
    I am, however, a little clueless why I get the above error. In order to have fading between songs, my mediaplayer is constructed in such a way that XX seconds before a song ends, the mediaplayer do a request for the next song to be played, checks if it exists and do another request if it doesn't. Otherwise it just wait for the current song to end. For these operations I use a couple of QTimer::singleShot() and that is the only kind of timers I use, My mediaplayer just uses instances of QMediaPlayer and when I call the stop() function of the mediaplayer, it just calls the QMediaPlayer::stop() function.

    Can anyone give me a hint why I get the above error?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Does your code use multi-threading at all?

      1 Reply Last reply
      0
      • H Offline
        H Offline
        helthans
        wrote on last edited by
        #3

        From gdb I can see it starts up several threads, I am not QThread or likewise explicit though. The application is made from a number of Qt plugins,

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          How do you load those plugins? Do they each have their own Qt event loop?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • H Offline
            H Offline
            helthans
            wrote on last edited by
            #5

            The plugins follows the approach as described here:
            "plugins-howto.html":http://qt-project.org/doc/qt-5/plugins-howto.html
            and here:
            "plugin example":http://qt-project.org/doc/qt-4.8/tools-echoplugin.html

            To my knowledge they don't have their own event loop. I can only find ".exec()" in the main file.

            1 Reply Last reply
            0
            • H Offline
              H Offline
              helthans
              wrote on last edited by
              #6

              Hmm... Properly caused partly by a poor design. I changed the code a bit and got rid of 1 of 2 QTimer::singleShot()'s and that also got rid of my error.

              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