Search Issue Tracker

Fixed

Fixed in 2021.3.3f1, 2022.1.1f1, 2022.2.0a13, 2023.1.0a13

Votes

7

Found in

2021.3.3f1

2022.1.3f1

2023.1.0a1

Issue ID

UUM-3727

Regression

No

[Android] The Microphone recording is faulty when the Bluetooth headset is connected to the phone before opening the application

Platform Audio

-

How to reproduce:
1. Open the user's attached project "UnityAndroidMicrophone_20190416.zip"
2. Build and run the project to an Android device
3. On the device click "ALLOW" when asked for record audio permissions
4. Make sure to click on the right side debugging window to expand the debugging Console (on the white circle, yellow triangle, red circle - icons)
5. Click "Start-2" and say something to record it
6. End the recording by clicking "End-2"
7. Play the recording by clicking "Play"

Actual result: The quality of the recording is unbalanced, has random cut-offs and in rare cases it seems to record from the phone's microphone instead
Expected result: The recording has no issues

Reproducible with: 2019.4.20f1, 2020.2.3f1, 2021.1.0b6, 2021.2.0a4
Could not test with: 2018.4.31f1 (multiple Console errors during the build after downgrading)

Reproducible on:
VLNQA00333, Hmd Global Nokia 7 plus, Android 10, CPU: Snapdragon 660, GPU: Adreno (TM) 512
VLNQA00099, Google Pixel XL, Android 9, CPU: Snapdragon 821 MSM8996 Pro, GPU: Adreno (TM) 530

Could not test on:
iPhone 12 mini:
1. The button that lists all audio input devices does not see the Bluetooth headset (on macOS it does)
2. As soon as you click any of the start buttons, it crashes due to not requesting permission to use a microphone

Notes:
- This issue reproduces when the Bluetooth headset is connected before starting the application. The in-app list will display: - 0. name:Android audio input, - 1. name:BluetoothHFP
- The issue will not reproduce when the Bluetooth headset is connected after starting the application. The in-app list will display: - 0. name:Android audio input, - 1. name:Android camcorder input, - 2. name:Android voice recognition input
- Start-2 uses the last listed Microphone device(either - 1. name:BluetoothHFP or - 2. name:Android voice recognition input)
- To test this properly steps 6-8 should be repeated ~10 times
- Step 2 record audio prompt should pop-up instantly after starting the application
- To know how it sounds when it is recorded by the phone I would advise repeating 6-7 steps with "Start-1" and "End-1" respectively
- The recording should play through the Bluetooth headset
- On different versions I tested this only using Hmd Global Nokia 7 plus as the tests were too time-consuming
- Panasonic RP-NJ300B headset was used during testing

  1. Resolution Note (fix version 2023.1.0a13):

    Added support for Android's AAudio engine, so on Android 8.1 and later, Unity Audio is now layered over AAudio. This fixes 4 audio bugs, related to built-in stereo speaker output, built-in vs. Bluetooth microphone selection, Microphone.Start and Microphone.Stop CPU spikes, and low-latency audio output.

  2. Resolution Note (fix version 2022.2.0a13):

    On Android, fixed a few Unity Audio bugs related to Bluetooth audio. While Bluetooth audio output is generally reliable and stable across all Android devices, Bluetooth microphone input still does not work reliably on a small percentage of Android devices.

    In addition to these bug fixes, in Unity 2023.1, we've added support for Android AAudio. AAudio appears to have more reliable Bluetooth microphone support, in our testing so far, than Android AudioTrack, which is used in previous versions of Unity when Bluetooth is being used.

    If still running into Bluetooth microphone issues, it is recommended that you use the built-in microphone instead, as it is more reliable in our testing across the wide range of Android devices.

  3. Resolution Note (fix version 2022.1.1f1):

    On Android, fixed a few Unity Audio bugs related to Bluetooth audio. While Bluetooth audio output is generally reliable and stable across all Android devices, Bluetooth microphone input still does not work reliably on a small percentage of Android devices.

    In addition to these bug fixes, in Unity 2023.1, we've added support for Android AAudio. AAudio appears to have more reliable Bluetooth microphone support, in our testing so far, than Android AudioTrack, which is used in previous versions of Unity when Bluetooth is being used.

    If still running into Bluetooth microphone issues, it is recommended that you use the built-in microphone instead, as it is more reliable in our testing across the wide range of Android devices.

  4. Resolution Note (fix version 2021.3.3f1):

    On Android, fixed a few Unity Audio bugs related to Bluetooth audio. While Bluetooth audio output is generally reliable and stable across all Android devices, Bluetooth microphone input still does not work reliably on a small percentage of Android devices.

    In addition to these bug fixes, in Unity 2023.1, we've added support for Android AAudio. AAudio appears to have more reliable Bluetooth microphone support, in our testing so far, than Android AudioTrack, which is used in previous versions of Unity when Bluetooth is being used.

    If still running into Bluetooth microphone issues, it is recommended that you use the built-in microphone instead, as it is more reliable in our testing across the wide range of Android devices.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.