• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Audio Player:The QMediaPlayer object does not have a valid service

Scheduled Pinned Locked Moved App Development
17 Posts 4 Posters 6.9k Views 2 Watching
Loading More Posts
  • 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.
    • W Offline
      wdehoog
      last edited by 12 Nov 2017, 14:13

      After disabling apparmor (modified linux commandline in boot.img, apparmor=0 security="") these errprs are gone.

      Now the errors are:

      setMedia() media: QUrl( "http://144.217.49.251:80/stream1" )
      virtual QMediaPlayer::MediaStatus AalMediaPlayerControl::mediaStatus() const

      Setting media to: QUrl( "http://144.217.49.251:80/stream1" )
      Failed to set media QUrl( "http://144.217.49.251:80/stream1" ) : org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

      Can't the media thing behind the qml Audio item handle http url's? wget can handle this adres on the phone.

      1 Reply Last reply Reply Quote 0
      • W Offline
        wdehoog
        last edited by 12 Nov 2017, 19:01

        When completely disabling apparmor even the music app cannot play anmore. So back to apparmor.

        As explained here https://wiki.ubuntu.com/Touch/DeprecatedPorting one can disable it for click apps (application-click.conf). When I do that Audio works.

        Now I'd like to know how to detect which policy denies my app to play audio so I can add this to the apparmor file.

        1 Reply Last reply Reply Quote 0
        • S Offline
          stefwe
          last edited by 13 Nov 2017, 07:28

          I don't know anything about apparmor.

          Did it help you to check the apparmor file from other programms? How they handle this?

          https://open.uappexplorer.com/app/utmedia.nfsprodriver

          https://github.com/nfsprodriver/UTmedia/blob/master/UTmedia.apparmor

          Meizu MX4 16.04 | Nexus 5 16.04

          W 1 Reply Last reply 13 Nov 2017, 18:03 Reply Quote 0
          • W Offline
            wdehoog @stefwe
            last edited by 13 Nov 2017, 18:03

            @Einstein212 thanks. UTmedia does work on my phone but when I copy it's apparmor stuff it does not help. Maybe because UTmedia is a webapp and mine is qml.

            Even if I add all policies in the IDE still using Audio is DENIED.

            Could it be the way I install it?
            I use 'pkcon --allow-untrusted install-local'.

            D 1 Reply Last reply 15 Nov 2017, 19:17 Reply Quote 0
            • W Offline
              wdehoog
              last edited by 14 Nov 2017, 19:20

              It appears that when installing my click app there is a apparmor profile being made in /var/lib/apparmor/profiles/. It also appears none of the policies I added are being addressed in the generated profile.

              I edited the generated profile and added

              #include <abstractions/audio>
              #include <abstractions/dbus-strict>
              #include <abstractions/dbus-session-strict>

              reloaded the profile and now the Audio tag works.

              So how is this ever supposed to work?

              1 Reply Last reply Reply Quote 0
              • W Offline
                wdehoog
                last edited by wdehoog 14 Nov 2017, 19:23

                sorry that should have been:

                #include <abstractions/audio>
                #include <abstractions/dbus>
                #include <abstractions/dbus-session>

                the -strict ones did not help

                1 Reply Last reply Reply Quote 0
                • D Offline
                  doniks @wdehoog
                  last edited by 15 Nov 2017, 19:17

                  @wdehoog said in Audio Player:The QMediaPlayer object does not have a valid service:

                  @Einstein212 thanks. UTmedia does work on my phone but when I copy it's apparmor stuff it does not help. Maybe because UTmedia is a webapp and mine is qml.

                  Maybe you can find another open source, UT, audio app that is qml to check

                  1 Reply Last reply Reply Quote 0
                  • W Offline
                    wdehoog
                    last edited by wdehoog 15 Nov 2017, 20:47

                    Installing my click using 'pkcon...' generates a different profile file then when done manually (aa-clicktool & aa-easyprof see https://wiki.ubuntu.com/SecurityTeam/Specifications/ApplicationConfinement/Manifest). The manual way adds extra rules that allow the app to use the media-hub.

                    I noticed that uninstalling the app did not remove the profile. Manually removing the profile (from /var/lib/apparmor/profiles and from /var/cache/apparmor/) and then reinstalling the click resulted in a profile that could actually work.

                    After loading it (apparmor_parser -r) my app works!

                    So I think that after adding the policies in the IDE and installing the new click the previous profile (without the policies) was still being used. Question is why? Maybe because the profiles are cached and I did not increase the version number of my app.

                    W 1 Reply Last reply 20 Nov 2017, 21:10 Reply Quote 1
                    • W Offline
                      wdehoog @wdehoog
                      last edited by 20 Nov 2017, 21:10

                      First and maybe only release of the app is now available here: shoutcast-ubports.wdehoog_0.1_all.click

                      It is a shoutcast browser and player. Sources and screenshots are on github

                      Please give it a try. I only tested it on my moto g 2nd (thank you walidham) but like to know if it works on other devices before submitting it to the OpenStore.

                      S 1 Reply Last reply 20 Nov 2017, 21:28 Reply Quote 1
                      • S Offline
                        stefwe @wdehoog
                        last edited by 20 Nov 2017, 21:28

                        @wdehoog I download and install the click package. But i don't get an icon on my home screen to start your program

                        Do you think it is hard work to get a program made for soundcloud?

                        Meizu MX4 16.04 | Nexus 5 16.04

                        W 1 Reply Last reply 20 Nov 2017, 21:33 Reply Quote 0
                        • W Offline
                          wdehoog @stefwe
                          last edited by 20 Nov 2017, 21:33

                          @Einstein212 did the icon not appear after refreshing home (pull down to refresh)?

                          Does soundcloud have an API to browse/search and retrieve lists?

                          S 1 Reply Last reply 21 Nov 2017, 07:31 Reply Quote 0
                          • S Offline
                            stefwe @wdehoog
                            last edited by 21 Nov 2017, 07:31

                            @wdehoog now i did a refresh and it's there. Nice work. Rock Antenne is running 🙂

                            https://developers.soundcloud.com/ here are some infos for developer, but i don't have api experience to say this informations makes it possible to build a programm around this.

                            Meizu MX4 16.04 | Nexus 5 16.04

                            W 1 Reply Last reply 21 Nov 2017, 08:40 Reply Quote 0
                            • W Offline
                              wdehoog @stefwe
                              last edited by 21 Nov 2017, 08:40

                              @Einstein212 I did not know about soundcloud and now see that it supports a lot of features. It will be no small effort. As it is of no use to me I am not going to work on it. If you are a developer yourself and need help I might be of use.

                              There is a project on github that could be of interest to you https://github.com/lukedirtwalker/musikloud2 looks like a soundcloud client for sailfish maybe parts can be used for a ubports app.

                              S 1 Reply Last reply 21 Nov 2017, 11:12 Reply Quote 0
                              • S Offline
                                stefwe @wdehoog
                                last edited by 21 Nov 2017, 11:12

                                @wdehoog i'd love to develop stuff for ubports, but my skills not good enough. Also i have not so much free time at the moment to lern something 😞

                                Thanks for the link, i will take a look on the code.

                                Meizu MX4 16.04 | Nexus 5 16.04

                                1 Reply Last reply Reply Quote 0
                                13 out of 17
                                • First post
                                  13/17
                                  Last post