sound issue playing music and voice navigation
-
I can observe different behaviour between uNav and Pure Maps when doing voice navigation while playing music. While uNav mixes voice directions with existing audio stream from music app, Pure Maps is able to pause the title currently played, gives voice directions, but then fails to resume music app playing the title. In either case, the behaviour is unsatisfactory. I can observe the same behaviour when playing audio via phone speakers and with a headset connected via Bluetooth.
What I would prefer is
- Mix voice directions with current audio, like uNav does. But tune down existing audio volume for other apps for the time voice directions are played.
- Like Pure Maps, pause all other audio streams. Play voice directions. But finally, resume audio streams from other apps automatically.
Before making a bug report on uNav and Pure Maps, I'd like to ask if UT's app model is able to cover the outlined behaviour or if there is a reason both apps don't work that way?
tested with:
- OTA-12
- Nexus 5 (hammerhead)
- OnePlus One (bacon)
-
My guess is that uNav does not use media hub while PureMaps use it. I'm not sure how advanced media hub though in terms of features. My guess is that it's not yet capable of doing the ideal behaviors.
-
@kugiigi One more observation: When playing music and either taking a photo with camera app or making a screenshot (pressing vol up+down), music volume is reduced while playing the "click" sound. So it looks like UT apps can already control foreign app's audio volume.
Well, I could observe reduced volume with the OPO (bacon) only, but not with Nexus 5 (hammerhead). Don't know if that's device specific or if and how I disabled the "click" sound with the latter device (my daily driver).
Can anyone reproduce reduced music app volume when taking photos with any other device than bacon?
-
@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.
-
This is actually handled by Pulse directly. When an "alert" stream is playing, other streams "duck", or become quieter.
-
@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.
-
@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 -
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.
-
@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.
-
@padu , indeed! there are too few on mobile linux side - have to get hands dirty at some point. Good luck!
-
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.
-
@padu , can you change the volume of the instructions? this seems to be the second issue with this approach
-
@padu: forgot to reply - yes, you need mapbox api key. or use osm scout server offline for testing
-
@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
propertyvolume
has an effect with and without Bluetooth (tested with N5 and headset). Or do you mean changing volume with buttons? -
@padu: yes, with volume bottons
-
Discussion continued in GitHub issue Prevent voice navigation stopping other audio #120.
-
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!
-
That's thanks to you for finding it out