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. QMediaPlayer::ServiceMissingError
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer::ServiceMissingError

Scheduled Pinned Locked Moved Solved Mobile and Embedded
15 Posts 2 Posters 5.1k 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.
  • canellasC Offline
    canellasC Offline
    canellas
    wrote on last edited by canellas
    #1

    Hi!

    I wrote a very simple program to test QMediaPlayer, which consists of a single window with a button, and the following code is executed when I click the button:

    void MainWindow::on_pushButton_clicked()
{
    
        QString _file ("/var/tmp/28_94_1.wav");
    
        qDebug() << "file = '" << _file << "'\n";


    
        QUrl _url(QUrl::fromLocalFile(_file));
    
        qDebug() << "url = '" << _url << "' \n";

    
        m_player.setMedia(_url);
    
        qDebug() << "media = '" << m_player.media().canonicalUrl() << "'\n";

    
        m_player.setVolume(80);
    
        m_player.play();


    }
    

    'm_player' is an attribute of 'MainWindow', and is created using the default constructor.

    I connected a slot to the 'error' signal of QMediaPlayer:

    void MainWindow::on_play_error(QMediaPlayer::Error error) {
        qDebug() << "error = '" << error << "'\n";
    }
    

    No sound is played, and the debug prints:

    file = ' "/var/tmp/28_94_1.wav" '
    
    url = ' QUrl("file:///var/tmp/28_94_1.wav") ' 
    
    media = ' QUrl("file:///var/tmp/28_94_1.wav") '
    
    error = ' QMediaPlayer::ServiceMissingError '
    

    The explanation in QtCreator help for QMediaPlayer::ServiceMissingError did not help at all, and I still could not find any good hint on the internet. Does anyone know what can cause this error?

    I also tried to use 'QSound', like this:

    void MainWindow::on_pushButton_2_clicked()
    {
        QString _file ("/var/tmp/28_94_1.wav");
        qDebug() << "file = '" << _file << "'\n";
    
        QSound::play(_file);
    }
    

    And again no sound is played.

    In the 'Application Output' window, it is written:

    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    

    And also:

    ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
    ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
    ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
    ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
    ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
    

    In time, I can listen to music files using VLC or from any web site.

    Does anyone have any idea that could help me?

    Thanks!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which version of GStreamer do you have installed on your computer ? And which version of Qt are you using ?

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

      1 Reply Last reply
      0
      • canellasC Offline
        canellasC Offline
        canellas
        wrote on last edited by
        #3

        Hi,

        Qt 5.5, as Qt 5.7 is not packaged for Linux on 32 bits Intel.

        There is a Ubuntu package called 'gir1.2-gstreamer-1.0', which says 'Description: GObject introspection data for the GStreamer library', and its version is '1.8.1-1~ubuntu1'.

        Thanks!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          AFAIK, Qt 5.5 uses GStreamer 0.10. So you can either install that version (plus plugins) or rebuild the QtMultimedia plugins against your installed GStreamer version.

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

          1 Reply Last reply
          0
          • canellasC Offline
            canellasC Offline
            canellas
            wrote on last edited by canellas
            #5

            So, the 'gstreamer' I have installed is newer than the Qt 5.5 requires, right? If so, shouldn't it work?

            Do you think it will work on Qt 5.7?

            Thanks!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              In this case not because it's a new major release (1.0 vs 0.1). That's why the plugin doesn't load.

              Since you'll be building Qt 5.7 by hand, it will pickup the your installed GStreamer and build the plugin accordingly.

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

              1 Reply Last reply
              0
              • canellasC Offline
                canellasC Offline
                canellas
                wrote on last edited by
                #7

                Changing the subject to 5.7, I run 'configure', 'make' and 'sudo make install', but I did not find 'qtcreator' anywhere in the directory tree, and it is not in the $PATH. Does 'qtcreator' come in the tar.gz Qt 5.7 package?

                Thanks!

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  No, Qt Creator is a younger and independent project. However you don't have to build it yourself (unless your current Qt Creator is really old).

                  Qt Creator can handle older as well as newer version of Qt.

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

                  1 Reply Last reply
                  0
                  • canellasC Offline
                    canellasC Offline
                    canellas
                    wrote on last edited by
                    #9

                    Just checking, I need to change 'Tools/Options/Build & Run/Qt Versions', to use Qt 5.7 libs, right?

                    Thanks!

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Add your self built 5.7 to the Qt Versions and then create a new Kit using it. Then you'll be able to configure and build your project with that Kit.

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

                      1 Reply Last reply
                      0
                      • canellasC Offline
                        canellasC Offline
                        canellas
                        wrote on last edited by
                        #11

                        'make -j4' run for about an hour now, and finished with

                        'Makefile:77: recipe for target 'module-qtbase-make_first' failed
                        

                        Before running 'make', I run './configure -help' and I did not see anything related to module 'qtbase'. Any ideia on what I missed?

                        Thanks

                        1 Reply Last reply
                        0
                        • canellasC Offline
                          canellasC Offline
                          canellas
                          wrote on last edited by
                          #12

                          I think I found the answer at https://bbs.archlinux.org/viewtopic.php?id=191765. Well, if it works, it'll take about an hour for 'make' to run again. It's 9:30 p.m. here, so maybe I'll only have news tomorrow.

                          Thanks again!

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Did you add the -developer-build option ? If so you should drop it unless you plan to hack on Qt itself.

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

                            1 Reply Last reply
                            0
                            • canellasC Offline
                              canellasC Offline
                              canellas
                              wrote on last edited by
                              #14

                              In my first attempt, I used it, but then I tried

                              ./configure -no-warnings-are-errors -gstreamer 1.0 -prefix /usr/local/Qt-5.7 -debug
                              

                              and I got the same error...

                              I saw somewhere someone tried with '-release -force-debug-info'. I'll try that, and let you know later.

                              Thanks

                              1 Reply Last reply
                              0
                              • canellasC Offline
                                canellasC Offline
                                canellas
                                wrote on last edited by
                                #15

                                SGaist,

                                Thanks a lot for your help, but due to time restrictions, I gave up on installing 5.7 on a Linux on a 32 bits CPU.

                                I am using a Mac OS 64 bits at work now.

                                Thanks a lot for your help.

                                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