Skip to content
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

No voice instruction, top banner not update #2240

Closed
luugiathuy opened this issue Sep 19, 2019 · 23 comments
Closed

No voice instruction, top banner not update #2240

luugiathuy opened this issue Sep 19, 2019 · 23 comments
Labels
needs more information Can't proceed without more data. question Need advice or clarification. topic: voice

Comments

@luugiathuy
Copy link

luugiathuy commented Sep 19, 2019

Mapbox Navigation SDK version: 0.37
Device: iPads

We encountered an issue with voice instruction and top banner for our apps, there is no voice instruction even though we turned on the volume in app and the device. The top banner is not updated as well.

I have downloaded the Example app and run on simulators (iOS 12.4) and it also has the same issue with simulated locations. Do I need to configure anything to turn on the voice instruction?

@luugiathuy
Copy link
Author

Update: If we change the the RouteController in NavigationService to LegacyRouteController like below

index 47d8132..bc44ed7 100644
--- a/ios/Pods/MapboxCoreNavigation/MapboxCoreNavigation/NavigationService.swift
+++ b/ios/Pods/MapboxCoreNavigation/MapboxCoreNavigation/NavigationService.swift
@@ -127,7 +127,7 @@ public protocol NavigationService: CLLocationManagerDelegate, RouterDataSo
 @objc(MBNavigationService)
 public class MapboxNavigationService: NSObject, NavigationService, DefaultInterfaceFlag {

-    typealias DefaultRouter = RouteController
+    typealias DefaultRouter = LegacyRouteController

     /**
      The default time interval before beginning simulation when the `.onPoorGPS` simulation

Then it will work, is there any issue with this change?

@PriyeshMohan
Copy link

Any update on this issue?
I'm using the same version. Not getting the sound in both simulators and also in the real devices.

let navigationService = MapboxNavigationService(route: route, simulating: simulationEnabled ? .always : .onPoorGPS)
let navigationOptions = NavigationOptions(styles: nil, navigationService: navigationService)
self.navigationViewController = NavigationViewController(for: route, options: navigationOptions)
self.navigationViewController!.modalPresentationStyle = .fullScreen

No voice update is getting.

@andrlee
Copy link

andrlee commented Oct 3, 2019

are you using RouteOptions or NavigationRouteOptions to request a route from directions api?

@PriyeshMohan
Copy link

Hi @andrlee , I'm using let options = NavigationRouteOptions(coordinates: coordinates) for direction api and
NavigationMatchOptions(coordinates:routeCoordinates) for map matching APIs.

But I'm able to get the voice instruction in pod version pod 'MapboxNavigation', '0.27.0'
using

let navigationService = MapboxNavigationService(route: route, simulating: simulationEnabled ? .always : .onPoorGPS)
//Setup Navigation View w.r.t the map type selection
 if mapViewType == .Default {
      self.navigationViewController = NavigationViewController(for: route, styles: nil, navigationService: navigationService, voiceController: nil)
 } else {
      self.navigationViewController = NavigationViewController(for: route, styles: [CustomDayStyle(), CustomNightStyle()], navigationService: navigationService, voiceController: nil)
 }
self.navigationViewController!.modalPresentationStyle = .fullScreen

@PriyeshMohan
Copy link

PriyeshMohan commented Oct 9, 2019

Hi @andrlee ,
any update on this? I have MapBoxDirections.SpokenInstructuions array in my route object , but its not giving any sound output.
Tried out initialising nav object in pod version.

//Called direction API using
let options = NavigationRouteOptions(coordinates: coordinates) 
pod 'Mapbox-iOS-SDK', '~> 5.3'
pod 'MapboxNavigation', '~> 0.37.0'
//Set navigation view controller
let navigationService = MapboxNavigationService(route: route, simulating: simulationEnabled ? .always : .onPoorGPS)
let navigationOptions = NavigationOptions(styles: nil, navigationService: navigationService, voiceController: nil, topBanner: nil, bottomBanner: nil)
self.navigationViewController = NavigationViewController(for: route, options: navigationOptions)

@JThramer
Copy link
Contributor

JThramer commented Oct 9, 2019

👋 @PriyeshMohan,

I am unable to reproduce this in the example app. It's interesting that the MapboxVoiceController is failing for you. Since you set NavigationOptions.voiceController to nil, a default one is created for you and should work out of the box.

How are you configuring your access token? Are you setting MGLMapboxAccessToken directly in your app's Info.plist? or are you using one of these methods?

@luugiathuy
Copy link
Author

@JThramer for me, I'm setting MGLMapboxAccessToken directly in the app's info.plist.

@luugiathuy
Copy link
Author

We've checked with v0.38, the issue is still there.

@vahidlazio
Copy link

vahidlazio commented Nov 4, 2019

Same here with version 0.38. no instruction update and no voice command but the LegacyRouteController works which is not ideal solution.

@soheilnikbin
Copy link

Thank you @luugiathuy modifying that part of the code saved me. Just need to mention beside fixing voice and banner, also fixed rerouting problem.

Mapbox please fix this since this rerouting issue has a direct connection to our pocket. No one wants to finish 100,000 free limit in 1 navigation trip.

@avi-c
Copy link
Contributor

avi-c commented Nov 18, 2019

@PriyeshMohan Are you seeing this occurring in the SDK example project? If not, are you able to share more of the code that is reproducing the issue?

Can you share a starting/ending coordinate for the original route that is being calculated?

@soheilnikbin
Copy link

soheilnikbin commented Nov 21, 2019

Just copy/past the method mentioned in this issue and most probably your instruction update and voice command will work as expected and no need to modify SDK as @luugiathuy mentioned here

@luugiathuy
Copy link
Author

@soheilnikbin you meant this block of code?

func navigationViewController(_ navigationViewController: NavigationViewController, shouldRerouteFrom location: CLLocation) -> Bool {
        return navigationViewController.navigationService.router.userIsOnRoute(location)
}

I tried but it did not work. Also I think this should be default behavior when we not implement this delegate function.

@soheilnikbin
Copy link

@luugiathuy Just now I was testing navigation after pod update to make sure is working fine but voice command and routing instruction stop working, so then I added back LegacyRouteController and removed delegate function and it start working again. I'm so confused right now to just leave it like this and wait for stable version. 🤷‍♂️

@1ec5
Copy link
Contributor

1ec5 commented Jan 7, 2020

When you create the RouteOptions or NavigationRouteOptions object, are you setting the shapeFormat property to polyline or geoJSON by any chance? Unfortunately, only LegacyRouteController currently supports these shape formats; RouteController does not (#2125). We’ve seen other reports of missing voice instructions and stuck banner instructions when customizing the shape format. The shape format is actually something of an implementation detail, so I don’t think you would need to customize it.

By the way, if you do need to use LegacyRouteController, you can enable it without forking this repository or monkey-patching the SDK:

let navigationService = MapboxNavigationService(route: route, routerType: LegacyRouteController.self)
let navigationOptions = NavigationOptions(navigationService: navigationService)
let navigationViewController = NavigationViewController(for: route, options: navigationOptions)

@luugiathuy
Copy link
Author

@1ec5 we set the shapeFormat to polyline6 though.

Thanks for the workaround of setting LegacyRouteController, it's better than monkey-patching the SDK.

@1ec5
Copy link
Contributor

1ec5 commented Jan 8, 2020

Can you provide example origin and destination coordinates for a route where this issue occurs when you don’t use the LegacyRouteController workaround? I’m curious whether there’s something in the Directions API response in a specific area that’s causing MapboxNavigationNative to silently consider the route invalid.

@luugiathuy
Copy link
Author

@1ec5 I was testing in Singapore area.

@1ec5
Copy link
Contributor

1ec5 commented Jan 15, 2020

Unfortunately, I’m unable to reproduce the issue simulating routes around Singapore with the default RouteController. Could you share a reduced test case of the problem, including the origin and destination coordinates and any other settings you specified on NavigationRouteOptions? (If you prefer to share this information privately, please contact the Mapbox Support team and let them know you’re following up on this ticket.) Thank you!

@1ec5
Copy link
Contributor

1ec5 commented Feb 16, 2020

Were any of you seeing this issue in an application that was running in Arabic, Burmese, Chinese, Esperanto, Finnish, Hebrew, Hungarian, Indonesian, Slovenian, Ukrainian, or Vietnamese? Per #2336 (comment), the underlying navigator component can get stuck after requesting directions in a language that the Mapbox Voice API doesn’t support (requiring the navigation SDK to fall back to VoiceOver or a third-party text-to-speech engine).

To confirm that this is the root cause, set a breakpoint here and check whether status.routeState is invalid and print out the status.stateMessage:

let offRoute = status.routeState == .offRoute

If this is the case for you, there are two workarounds: you can either switch to LegacyRouteController, as explained in #2240 (comment), or you can upgrade to v1.0.0-alpha.1, which happens to avoid the bug in MapboxNavigationNative that causes it to get stuck on these languages.

@luugiathuy
Copy link
Author

@1ec5 I was trying the example in the 0.38.3 release and master branch yesterday and it was ok for me now, tried to use back 0.38.1 version but I could not run it anymore (see log below). I guess it has been fixed, we will update our app to use v0.38.3 and change back the new RouteController for our app today to see.

2020-02-17 07:48:23.533668+0800 Example[39946:1259641] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
2020-02-17 07:48:23.557485+0800 Example[39946:1259641] +[NSUserDefaults mme_configuration]: unrecognized selector sent to class 0x1130f42f0
2020-02-17 07:48:23.564014+0800 Example[39946:1259641] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSUserDefaults mme_configuration]: unrecognized selector sent to class 0x1130f42f0'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000112e4129b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x00000001123dd735 objc_exception_throw + 48
	2   CoreFoundation                      0x0000000112e5fea4 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x0000000112e45fb6 ___forwarding___ + 1446
	4   CoreFoundation                      0x0000000112e47e88 _CF_forwarding_prep_0 + 120
	5   Mapbox                              0x000000011171db82 -[MGLMapboxEvents init] + 262
	6   Mapbox                              0x000000011171ee1a __33+[MGLMapboxEvents sharedInstance]_block_invoke + 38
	7   libdispatch.dylib                   0x0000000116f8c63e _dispatch_client_callout + 8
	8   libdispatch.dylib                   0x0000000116f8e100 _dispatch_once_callout + 66
	9   Mapbox                              0x000000011171e66e +[MGLMapboxEvents sharedInstance] + 97
	10  Mapbox                              0x000000011171e6ac +[MGLMapboxEvents setupWithAccessToken:] + 60
	11  libdispatch.dylib                   0x0000000116f8b5d1 _dispatch_call_block_and_release + 12
	12  libdispatch.dylib                   0x0000000116f8c63e _dispatch_client_callout + 8
	13  libdispatch.dylib                   0x0000000116f999d6 _dispatch_main_queue_callback_4CF + 1541
	14  CoreFoundation                      0x0000000112da47f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	15  CoreFoundation                      0x0000000112d9ee86 __CFRunLoopRun + 2342
	16  CoreFoundation                      0x0000000112d9e221 CFRunLoopRunSpecific + 625
	17  GraphicsServices                    0x00000001166351dd GSEventRunModal + 62
	18  UIKitCore                           0x000000011e675115 UIApplicationMain + 140
	19  Example                             0x000000010f9a721b main + 75
	20  libdyld.dylib                       0x0000000117002551 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

@1ec5
Copy link
Contributor

1ec5 commented Feb 17, 2020

That crash is #2299, which is unrelated to the issue you reported originally. v0.38.1 and v0.38.3 should be equivalent when it comes to location tracking and spoken instructions.

master and v1.0.0-alpha.1 are also unaffected by #2336, so if you can reproduce the original issue in v0.x but not master, that would also corroborate that theory to some extent.

@truburt truburt added question Need advice or clarification. and removed user: support labels Sep 29, 2021
@1ec5
Copy link
Contributor

1ec5 commented Oct 4, 2021

Please open a new issue if you continue to experience this issue. There have been enough significant changes to the navigation SDK and its dependencies since the original report that a similar set of symptoms might well be a coincidence at this point.

@1ec5 1ec5 closed this as completed Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more information Can't proceed without more data. question Need advice or clarification. topic: voice
Projects
None yet
Development

No branches or pull requests

9 participants