-
Notifications
You must be signed in to change notification settings - Fork 31
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
Android TextToSpeech Repeated Voice Instruction Queue Bug - Infinite Loop #452
Comments
Out of curiosity, did you encounter this around an off route recalculation? I actually just thought of a few ways we can probably improve that and ensure users don't accidentally get in a loop making a bunch of useless reroute requests. I should be able to open a PR for that tomorrow. cc @ben-burwood since you may have hit one of those cases inadvertently too. |
Some notes after a look at this on the call today... It seems that it is indeed happening around recalculation events anecdotally per both @Archdoog and @bjtrounson. We looked at the code and think there are possible race conditions in Additionally, we should probably store the Finally, we noted that while we haven't yet seen this on iOS, there is definitely a possibility that the same bug exist, especially given that both implementations are as structurally similar as the platform APIs allow. |
As mentioned in our call today here is the recording of the behavior I got while mocking location updates down a route. TextToSpeech_Repeating_Voice_Instruction_Bug.mp4I know when mocking the route that the mock location app can give is quite simplified version of the route which I think might have caused the initial re-route here during the bend. My route deviation distance is also quite high at 250 at the time of this recording I've increased this since. There seems to be once the initial re-route happens it fires off continuously after each other, which I think #453 would have solved. I will look at getting the route information for this recording I did. |
@bjtrounson even though you're correct that the gating bug fix should dramatically reduce or entirely avoid this bug. We should still try to reproduce the orphaned coroutine/race condition. Would it be reasonable to post a branch with this reproduced in the demo app? E.g. a hard coded route request and simulated locations? Happy to help get it set up. |
Yeah I've create a branch here that loads that same route https://github.com/bjtrounson/ferrostar/tree/text-to-speech-bug-reprod-route I've hijacked the AutocompleteOverlay for this and that will load the route needed, I haven't done the simulated locations yet might need a little help with that haven't messed with the simulated mode before. All the data needed are JSON files in the assets directory I've created in the demo app. The simulated locations should be the same as the one I created in my mock location app, it creates a very simplified version of the route so it's pretty inaccurate GPS wise but I think that what makes it good to reproduce this issue. It should be emulating a 120km/h speed or about 3333 centimeters a second as I think that's the speed I used in that video. I've also set the NavigationControllerConfig to be the same as the one I used in that video. I'm free if you want to jump on a call for this stuff if need be. |
I've added the simulated locations to that branch. The speed/resample rate probably needs increased for that route. Might also think about making this route shorter currently it's the full route that takes about an hour to go across. A few things I have noticed while setting up the SimulatedLocationProvider, is the SimulatedLocationProvider meant to override the CourseFiltering.SNAP_TO_ROUTE option in the NavigationControllerConfig. It also seems the SimulatedLocationProvider doesn't stop once the navigation has stopped. |
Sweet. I'll give it a play this weekend and we can plan to debug on the Monday call depending on how it goes. Thanks for the branch! |
@bjtrounson this was super helpful to reproduce. Albeit a little amusing (I had to up the warp speed to like 150X). Turns out the issue was: #460 😅 |
When navigating on android, there are certain cases where the Android TextToSpeech wrapper starts reciting the same instruction after a re-route. Given the timing after re-route, this tends to be the initial "Depart" or "Continue on Something Rd." instruction. Notes about what happens:
After this happens, even if you un-mute the next recitation will kick off a new cascade of repeated voice instructions. Given that we've taken some passes at this bugs, I'm starting to wonder if something's leaking, there's a thread safety issue. This guess is driven by the fact that initially it will self resolve, but later in the same session it often cascades out of control to an infinite-ish loop. Theory is if we're leaking something, we may have a listener that's running voice 1x per cycle, then 2x, 4x, 8x, and so on as more callers leak.
The text was updated successfully, but these errors were encountered: