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

    sound issue playing music and voice navigation

    Scheduled Pinned Locked Moved Support
    18 Posts 5 Posters 1.6k 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.
      • AppLeeA Offline
        AppLee @padu
        last edited by

        @padu said in sound issue playing music and voice navigation:

        So it looks like UT apps can already control foreign app's audio volume

        In fact that is good to know.
        This might help someone investigating this behavior.

        I'll test later on the N5 if I can have the same as with your OPO. IIRC there is an option to enable/disable the shutter sound.

        1 Reply Last reply Reply Quote 0
        • U Offline
          UniSuperBox
          last edited by

          This is actually handled by Pulse directly. When an "alert" stream is playing, other streams "duck", or become quieter.

          https://github.com/ubports/ubuntu-touch-session/blob/743214a6b0af70f719bec3c1b789ede316e75319/touch.pa#L134

          P 1 Reply Last reply Reply Quote 0
          • P Offline
            padu @UniSuperBox
            last edited by

            @UniSuperBox said:

            This is actually handled by Pulse directly. When an "alert" stream is playing, other streams "duck", or become quieter.

            Thank you! I can't help, but playing voice directions as "alert" stream sounds much more appropriate to me than the shutter sound. 😃 Will file bug reports.

            P 1 Reply Last reply Reply Quote 0
            • P Offline
              padu @padu
              last edited by

              @padu said in sound issue playing music and voice navigation:

              Will file bug reports.

              Done.

              uNav: Added GitHub issue use alert audio stream for voice directions #23
              Pure Maps: Added a comment to existing GitHub issue Prevent voice navigation stopping other audio #120

              1 Reply Last reply Reply Quote 0
              • R Offline
                rinigus
                last edited by

                Pure Maps is using QML Audio for sound. We tested SoundEffect as well on SFOS, but it had some issues with the bluetooth - will have to retest it. I don't know how to patch it to PA alert. You could see if SoundEffect will work for you (change it at https://github.com/rinigus/pure-maps/blob/master/qml/pure-maps.qml#L88) and whether it works better.

                P 1 Reply Last reply Reply Quote 0
                • P Offline
                  padu @rinigus
                  last edited by

                  @rinigus said in sound issue playing music and voice navigation:

                  You could see if SoundEffect will work for you (change it at https://github.com/rinigus/pure-maps/blob/master/qml/pure-maps.qml#L88) and whether it works better.

                  Never got anywhere with Qt/QML or clickable before. Good opportunity to change that. Will try my best. 😃 Might take a couple of days, though.

                  R 1 Reply Last reply Reply Quote 0
                  • R Offline
                    rinigus @padu
                    last edited by

                    @padu , indeed! there are too few on mobile linux side - have to get hands dirty at some point. Good luck!

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      padu
                      last edited by padu

                      Wow, that turned out to be quite easy (on Ubuntu 20.04). I have not been able to do production tests, yet, due to missing API keys.

                      Am I correct that I need one key for Mapbox for tiles rendering (Western Europe) and one key for MapQuest for the routing service?

                      I did test audio with the TTS test in the settings section. (Compiled the slim version with Pico TTS only.) After applying the following patch

                      -    Audio {
                      +    SoundEffect {
                               id: sound
                      -        autoLoad: true
                      -        loops: 1
                               }
                      

                      as per this GH issue comment, test voice was mixed with existing audio at the same volume level. No pausing and no damping of other audio streams. Tested with phone speakers and Bluetooth headset connected to N5 and OPO. No Bluetooth problems otherwise.

                      R 2 Replies Last reply Reply Quote 0
                      • R Offline
                        rinigus @padu
                        last edited by

                        @padu , can you change the volume of the instructions? this seems to be the second issue with this approach

                        P 1 Reply Last reply Reply Quote 0
                        • R Offline
                          rinigus @padu
                          last edited by

                          @padu: forgot to reply - yes, you need mapbox api key. or use osm scout server offline for testing

                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            padu @rinigus
                            last edited by padu

                            @rinigus said in sound issue playing music and voice navigation:

                            @padu , can you change the volume of the instructions? this seems to be the second issue with this approach

                            SoundEffect property volume has an effect with and without Bluetooth (tested with N5 and headset). Or do you mean changing volume with buttons?

                            R 1 Reply Last reply Reply Quote 0
                            • R Offline
                              rinigus @padu
                              last edited by

                              @padu: yes, with volume bottons

                              1 Reply Last reply Reply Quote 0
                              • P Offline
                                padu
                                last edited by

                                Discussion continued in GitHub issue Prevent voice navigation stopping other audio #120.

                                1 Reply Last reply Reply Quote 0
                                • P Offline
                                  padu
                                  last edited by

                                  New Pure Maps release 1.29.0 contains a patch that applies audio role notification to voice directions. Normal audio, e.g., music, is no more stopped, but damped now.

                                  VW carkits have an infamous bug, that auto-mute Bluetooth audio after music was paused/stopped. When the next voice direction came in, unmuting took some time, cutting-off part of directions. This problem does not happen any more with the new Pure Maps release.

                                  Using Ubuntu Touch as daily driver got a little more comfortable again. Thanks @rinigus and jonnius!

                                  1 Reply Last reply Reply Quote 2
                                  • R Offline
                                    rinigus
                                    last edited by

                                    That's thanks to you for finding it out 🙂

                                    1 Reply Last reply Reply Quote 2
                                    • First post
                                      Last post