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 7.0k 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 @stefwe
        last edited by

        @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 Reply Quote 0
        • W Offline
          wdehoog
          last edited by

          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

            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

              @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

                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 Reply Quote 1
                • W Offline
                  wdehoog @wdehoog
                  last edited by

                  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 Reply Quote 1
                  • S Offline
                    stefwe @wdehoog
                    last edited by

                    @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 Reply Quote 0
                    • W Offline
                      wdehoog @stefwe
                      last edited by

                      @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 Reply Quote 0
                      • S Offline
                        stefwe @wdehoog
                        last edited by

                        @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 Reply Quote 0
                        • W Offline
                          wdehoog @stefwe
                          last edited by

                          @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 Reply Quote 0
                          • S Offline
                            stefwe @wdehoog
                            last edited by

                            @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
                            • First post
                              Last post