Search Issue Tracker
Third Party Issue
Votes
0
Found in
6000.0.52f1
6000.2.0b7
6000.3.0a5
6000.4.0a1
6000.5.0a1
Issue ID
UUM-110410
Regression
Yes
[Android] Extremely poor sound quality when recording using a low (22 kHz or lower) sampling rate
Reproduction steps:
1. Open the attached “IN-99857“ project
2. Build and Run the Android Player
3. In the Player, make a recording with a sampling rate of 8, 16 or 22.05 kHz
4. Listen to the recording
Expected result: The recording is understandable, distinguishable
Actual result: The recording is of extremely poor quality
Reproducible with: 2023.3.0b4, 6000.0.52f1, 6000.1.9f1, 6000.2.0b7
Not reproducible with: 2022.3.64f1, 2023.3.0b3
Reproducible environments: macOS 15.5
Not reproducible environments: No other environments tested
Reproducible with these devices:
VLNQA00521 - Galaxy S22 Ultra USA (SM-S908U), CPU: Snapdragon 8 Gen 1 (SM8450), GPU: Adreno 730, OS: 14
Reporter’s info - Galaxy Z Flip5(SM-F731N)
Reporter’s info - Galaxy Fold4(SM-F936N)
Not reproducible with these devices:
VLNQA00372 - Galaxy S21 5G (SM-G991U), CPU: Snapdragon 888, GPU: Adreno 660, OS: 12
VLNQA00403 - Galaxy Z Flip3 5G (SM-F711B), CPU: Snapdragon 888, GPU: Adreno 660, OS: 11
VLNQA00618 - samsung Galaxy Z Fold6 (SM-F956B), CPU: Qualcomm SM8650-AB Snapdragon 8 Gen 3, GPU: Adreno 750, OS: 14
VLNQA00460 - Google Pixel 6 (Pixel 6), CPU: Google Tensor (Whitechapel), GPU: Mali-G78, OS: 14
VLNQA00593 - Google Pixel Fold (Pixel Fold), CPU: Google Tensor G2 (GS201), GPU: Mali-G710, OS: 15
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- URP Realtime reflection probes do not update when RenderProbe() is being called once per second
- Addressable terrain shader variants are stripped from the Player
- [iOS] Debug.Log() appears as <private> in Console app
- UI stays in the background when it is disabled in simulator
- A wrong log file is attached when project is launched with a "-logFile" command line argument
Resolution Note:
Following an exhaustive log trail, it is clear that we are correctly requesting a supported input sampling rate to AAudio on the device causing the issue. Analyzing the recorded file, we're clearly getting 33% of the samples that should be recorded over the time period requested to the Microphone API, which aligns exactly with the 16000/48000 ratio. A similar theory was tried with a 8000Hz recording, still aligning with the theory that the device is providing samples recorded at 48000Hz, but labeling the file as a recorded at 16000Hz.
Following the Android logs, we can observe the following entries when we're opening the stream in `OutputAAudio::recordStart` with the expected values, so far so good!
```
03-11 06:15:53.039 28554 28637 I AAudio : AAudioStreamBuilder_openStream() called ----------------------------------------
03-11 06:15:53.039 28554 28637 I AudioStreamBuilder: rate = 16000, channels = 1, channelMask = 0x80000001, format = 5, sharing = SH, dir = INPUT
```
These next log entries following the AAudio stream start call are very close, revealing the sequence of operations at a low level. Since I did only one recording during this log and nothing else, I am very confident that this reflects the chain of events of our recording session.
```
03-11 06:15:53.058 28554 28637 D AAudio : AAudioStream_requestStart(s#2) called --------------
...
03-11 06:15:53.062 1563 28722 V APM_AudioPolicyManager: getInputForAttr() source 6, sampling rate 16000, format 0x1, channel mask 0x10, session 2929, flags 0x10 attributes={ Content type: AUDIO_CONTENT_TYPE_MUSIC Usage: AUDIO_USAGE_UNKNOWN Source: AUDIO_SOURCE_VOICE_RECOGNITION Flags: 0x100 Tags: } requested device ID 23
...
03-11 06:15:53.069 1453 2413 D AHAL: AudioStream: Start: 4505: Enter
...
03-11 06:15:53.069 1489 17165 D AGM: graph_module: configure_hw_ep_media_config: 659 rate 48000 bw 16 ch 1, data_fmt 1 <---- !!!
```
We can see that we're requesting to start the stream we configured earlier, then the middlemen `APM_AudioPolicyManager` and `AHAL` finally forward it to the last layer: `AGM` (Qualcomm's Audio Graph Manager). At that level, the stream is created with a 48000Hz rate.
This is beyond our reach, and very specific to this device OEM integration. The issue was also present when using a bluetooth device supporting the same range of sampling rates, and similar investigations on a Google Pixel 6 not exhibiting this issue revealed that `AGM` was not used in the audio pipeline, rather a process called `audio_hw`. This is likely a bug in the integration of `AGM` by `AHAL` or `APM_AudioPolicyManager`.