Agora-Flutter-SDK icon indicating copy to clipboard operation
Agora-Flutter-SDK copied to clipboard

Android 4.0.7: Bluetooth Headset Mic doesn't work properly. While the audio plays on the headset correctly, the mic used is the Phone's mic, not the Bluetooth headset mic.

Open marcusvpais opened this issue 4 years ago • 16 comments

First of all, thank you for the updates. Keep 'em coming :)

BUG: Bluetooth Headset Mic doesn't work properly with LiveBroadcasting. While the audio plays on the headset correctly, the mic used is the Phone's mic, not the Bluetooth headset mic.

Happening on Android ONLY on 4.0.7, Version 4.0.5 works fine! I guess the code is correct cause on iOS using 4.0.7 it works perfectly, tried all combinations on Android, doesn't work. Down below what im using:

Android (doesn't work on 4.0.7, works on 4.0.5) AudioProfile.SpeechStandard, AudioScenario.Education); ChannelProfile.LiveBroadcasting); iOS (works on 4.0.7) AudioProfile.SpeechStandard, AudioScenario.Default); ChannelProfile.LiveBroadcasting);

Expected behavior when connects Bluetooth headset, both audio and mic should be from the headset.

Smartphone (please complete the following information): Tested on Android 9/10/11/12 on 8 devices different manufactures (Motorola, Samsung, Xiaomi etc...) iOS is working perfectly.

marcusvpais avatar Sep 21 '21 17:09 marcusvpais

is it working while using AudioScenario.Default on Android?

LichKing-2234 avatar Sep 22 '21 00:09 LichKing-2234

No. Tested all scenarios, different bluetooth headsets.

marcusvpais avatar Sep 22 '21 00:09 marcusvpais

It is a known bug that will be fixed next version.

you can use setParameters('{"che.audio.force.bluetooth.a2dp":0}') first.

LichKing-2234 avatar Sep 27 '21 08:09 LichKing-2234

Tried and didn't work. I'll wait for next release and hopefully is fixed. Thank you

marcusvpais avatar Sep 30 '21 18:09 marcusvpais

Any dates on when 4.0.8 with the fix will come out?

marcusvpais avatar Oct 28 '21 10:10 marcusvpais

It is a known bug that will be fixed next version.

you can use setParameters('{"che.audio.force.bluetooth.a2dp":0}') first.

Hi, is this going to be fixed on the Flutter level or on the Full SDK level? We are not using Flutter but are also having this issue!!!

I can confirm it happens on Full SDK 3.5.0.3 and 3.5.1.1

DaniloAlmeida-Dev avatar Nov 04 '21 22:11 DaniloAlmeida-Dev

@DaniloAlmeida-Dev native layer

LichKing-2234 avatar Nov 05 '21 01:11 LichKing-2234

@DaniloAlmeida-Dev native layer

Sorry the silly question, I'm still learning all different SDK and wrappers.

By native layer, do you mean the Full SDK? or each of the android wrappers (electron/react/flutter)?

We are developing for Android, but using the Full SDK.

DaniloAlmeida-Dev avatar Nov 05 '21 13:11 DaniloAlmeida-Dev

@DaniloAlmeida-Dev full SDK

LichKing-2234 avatar Nov 06 '21 00:11 LichKing-2234

Thank you.

I'd also like to reiterate Marcus question: Any dates on when the fix will come out?

Maven shows me a new full-sdk released as 3.5.1.2 from yesterday (Nov 11th), but I can't find any release notes to check if this fix is included in 3.5.1.2

DaniloAlmeida-Dev avatar Nov 12 '21 16:11 DaniloAlmeida-Dev

fixed on native 3.5.1.

LichKing-2234 avatar Nov 15 '21 09:11 LichKing-2234

Hi Lich,

After many days away, I checked and native 3.5.1 still had not fixed this yet.

I see there is a new Native 3.6.0.1 now, could you please confirm if this should be fixed in native 3.6.0.1?

DaniloAlmeida-Dev avatar Dec 14 '21 16:12 DaniloAlmeida-Dev

Hi Team, any update on this front for Native? 3.6.0.1 stil dows not fix this.

DaniloAlmeida-Dev avatar Jan 04 '22 20:01 DaniloAlmeida-Dev

Hello - is there anything we can do to help resolve this? This seems to be an issue on the latest versions as well.

fareesh avatar Mar 27 '22 09:03 fareesh

Hi, yes same here - had contacted Agora support but nothing helpful yet, we tried 4.0.7 and also have the same problem. Any ideas here?

sebklose avatar May 06 '22 16:05 sebklose

In my case the issue was on Android 12 device, needed to add this permission

 <!-- Add the following permission on devices running Android 12.0 or later -->
 <uses-permission android:name="android.permission.BLUETOOTH_CONNECT"  />

according to https://docs.agora.io/en/Voice/faq/ios_bluetooth?platform=Android

While trying to solve it I was able to use the bluetooth speaker by using FlutterAudioManager package and using it like this (the rest of the code is from suggestions that I've found on github and so, idk might help someone):

  _enableBluetooth() async {
    await _engine.setAudioProfile(
      AudioProfile.SpeechStandard,
      AudioScenario.ChatRoomEntertainment,
    );
    var res = await FlutterAudioManager.changeToBluetooth(); // <- THIS ONE WORKED FOR ME
    await _engine.setParameters('{"che.audio.force.bluetooth.a2dp":0}');
    // var devicesList = await FlutterAudioManager.getAvailableInputs();
    // print('devicesList: $devicesList');
    return res;
  }

codetowa avatar Jun 29 '22 10:06 codetowa

If you still face issues, please try upgrading to the new version to see if it works for you.

littleGnAl avatar Nov 14 '23 09:11 littleGnAl

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

github-actions[bot] avatar Nov 28 '23 10:11 github-actions[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

github-actions[bot] avatar Dec 05 '23 11:12 github-actions[bot]