osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.64k stars 1.01k forks source link

No navigation audio with media or notification output and Bluetooth connected #19552

Open CommanderPrS opened 5 months ago

CommanderPrS commented 5 months ago

Description

When I am driving, my phone is connected via Bluetooth to my car so that I can make/receive phone calls via the hands-free system integrated into the car audio system. At same time, if I am using OsmAnd for navigation, I prefer to have its navigation audio to go though the phone speakers so that it does not interrupt the music the car system is playing.

To achieve this, the Bluetooth connection between my phone and the car is configured to send only the phone calls to the car. All other sources are turned off (e,g, media audio). In the navigation settings in OsmAnd I specifically configure its audio output to go either though the notification channel or the media channel (not the phone call channel). If the phone is NOT connected to Bluetooth, OsmAnd works correctly and makes all turn announcements through the phone. If the phone IS connected to Bluetooth, OsmAnd does not announce any turns either on the phone or on the car - total silence. As soon as I turn off Bluetooth, the phone starts announcing turns even without restarting the current navigation.

Side note: switching OsmAnd to use the phone call channel for the navigation audio works as expected - the phone announces all turns through the car system. Other applications using the notification channel for sounds (e.g. the calendar events) work correctly by making sounds on the phone even with the phone connected to Bluetooth.

Steps to reproduce

Actual result

Expected result

If Bluetooth is configured to send only phone calls to the car, OsmAnd should make all turn announcements through the phone (if the output is configured to use either the media channel or the notification channel).

Your Environment (required)

OsmAnd Version: OsmAnd~ (from F-Droid) 4.6.12 (older versions also had the same problem)
Android/iOS version: Android 9
Device model: BlackView BV9100
Crash-Logs: No crash observed, just the navigation audio not working correctly
yuriiurshuliak commented 4 months ago

Could you please confirm whether the issue you encountered still exists in the latest version of the app?

CommanderPrS commented 4 months ago

@yuriiurshuliak

Could you please confirm whether the issue you encountered still exists in the latest version of the app?

I installed the latest version from F-droid - 4.7.10. Also updated all the maps. After that I tried using OsmAnd to navigate somewhere. The behavior did not change - when Bluetooth is connected, no navigation audio is heard either on the phone or through the car speakers. As before, OsmAnd is configured to send the navigation audio through the notification channel and the only thing allowed to go to the car through Bluetooth is the call audio. As soon as I disconnect Bluetooth on the phone, OsmAnd starts making the announcements. The navigation itself is not interrupted and works as expected.

sonora commented 4 months ago

This is very device specific, and different versions of Android have different peculiarities. See e.g. also https://github.com/osmandapp/OsmAnd/issues/16204. It may be very hard to impossible to find a general solution. Perhaps you have some luck with a third party app to manipulate the audio stream behavior of your device.

DmitryAlexei commented 3 months ago

Entirely agree with Sonora. I cannot reproduce that issue on my setup I use Samsung Galaxy note 20 ultra with radio unit 281152186R OsmAnd~ 4.8.0#2660m, released: 2024-07-02

In that case, voice prompts are voiced by the phone and the radio can be used for phone calls only. @CommanderPrS why don't you use voice guidance output > Phone call audio if it is working for you as expected?

CommanderPrS commented 2 months ago

@DmitryAlexei

@CommanderPrS why don't you use voice guidance output > Phone call audio if it is working for you as expected?

If I change the navigation audio to go to the phone call output channel, it will go to the car speakers. This is the opposite of what I am trying to achieve - the car continues playing whatever music it is playing and the phone is announcing turns on its own speakers without interrupting the car.

sonora commented 2 months ago

Yes, some Android devices unconditionally forwarding all sound to BT whenever connected is a nuisance on some manufacturers' devices lately.

Some but not all at least leave the Notification channel on the device speakers, so try using that output for OsmAnd. If that gets routed to BT also, your only chance may be to try a hardware-specific sound routing app, there are some for certain device brands, but your mileage may vary.