-
Notifications
You must be signed in to change notification settings - Fork 320
NAVAND-1001: use immediate dispatcher to guarantee that language will change before voice instructions #6766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6766 +/- ##
============================================
+ Coverage 72.50% 72.52% +0.02%
+ Complexity 5550 5542 -8
============================================
Files 779 777 -2
Lines 30069 30042 -27
Branches 3547 3548 +1
============================================
- Hits 21801 21788 -13
+ Misses 6843 6830 -13
+ Partials 1425 1424 -1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in #6758 (comment)
Looking good to me, I've tested downstream in 1TAP with a
SNAPSHOT
from #6766 and it's working as expected - same first voice instruction is not played twice anymore.
The first commit is a duplicate of #6758. |
libnavui-voice/src/main/java/com/mapbox/navigation/ui/voice/api/MapboxAudioGuidance.kt
Outdated
Show resolved
Hide resolved
f01223e
to
8e48c2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the route language is ignored with this PR. I set my device language to Russian, but specified English language when requesting a route, listen to the result:
Screenrecorder-2022-12-21-15-06-54-86.mp4
It tries to speak most of the instructions (which are in English) using Russian voice. This doesn't happen in main
or in Tomasz's branch.
That must be because we start pronouncing the instruction in FreeDrive. Then the best way to go would be to guarantee the order. |
Sorry, wrong test case. It works, thanks! |
8e48c2b
to
ac96d87
Compare
Try rotating the device, you will see the last instruction is being repeated upon device rotation. This doesn't happen on the |
Are you sure you've tested this branch? I can't reproduce it neither with qa-test-app nor with 1TAP. |
e5fd924
to
3769e18
Compare
Yes. Video from this PR: PR.mp4Video from main: main.mp4 |
I see the same behavior. Looks like it only happens when replay is enabled. |
Yeah this was an issue I was bringing up here https://mapbox.atlassian.net/browse/NAVAND-958?focusedCommentId=71075. Essentially, during device rotation the TripSessionComponent will detach/attach the ReplayRouteSession. ReplayRouteSession stops/starts the trip session This is my opinion on the approach we should take https://mapbox.atlassian.net/browse/NAVAND-652. Essentially, we should have a service that controls the trip session state (if it is replay, or not). It should have a lifecycle similar to MapboxAudioGuidance, that does not get destroyed during configuration changes. There are other approaches, but that is out of scope of this change. The issue is specific to drop in ui and the TripSessionComponent/ReplayRouteSession (here is another idea for handling these issues) EDIT: Here is another solution to the problem I'm discussing here. Right now, replay requires a trip session restart. I wonder if voice instructions would be fixed if we did not have to restart the trip session for replay. There is a public and internal tracker for that idea #6056 https://mapbox.atlassian.net/browse/NAVAND-320. I still think TripSessionComponent should have a longer lifecycle, but trip session issue may improve the experience. |
@abhishek1508 I see the issue with replay enabled. However, I see the same issue on main. Idk why you didn't see it. The video below is from fresh main. main_duplicate_instruction.mp4 |
3769e18
to
6674259
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering this comment and that issue observed is out of scope of this PR, the changes LGTM.
We considered changing the constructor because the language is not needed, but changing it is not backwards compatible #4686. So the approaches are limited at the moment. |
@kmadsen It all depends on how we introduce those changes. For example, removing the argument for the public constructors will be a breaking change. However, we won't break compatibility if we introduce new primary constructors and refactor (and deprecate) old to secondary. |
Yeah maybe we should do that to remove the language from the constructor. Another option could be to make new objects and deprecate the old ones. Thinking about this more, wasn't this issue solved with the introduction of "updateLanguage" functions #6491? We don't need to construct new objects to update the language anymore. |
It fixes the issue for non Drop-In users. While for Drop-In users it only avoids recreating some of the objects. Other ones are still being recreated and I think that's what Tomasz means. |
…ls to both MapboxSpeechApi and MapboxVoiceInstructionsPlayer. As a result, MapboxAudioGuidanceVoice will wait until the player finishes playing the previous announcement before attempting to play the next one. Using coroutines also allows for API and Player cancellation alongside the parent Job.
… change before voice instructions
6674259
to
22804e6
Compare
… change before voice instructions (#6766)
… change before voice instructions (#6766)
No description provided.