Moto G 5S+: Input is silent if stream is OpenSL with preset `Unprocessed`
- Dominant language
- C++
- Stars
- 4.1k
- Forks
- 639
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 8
Description
Android version: 8.1.0
Android device: Moto G 5S+ (Board: msm8953 Hardware: qcom Build: OPS28.65-36-14 Fingerprint: motorola/sanders_n/sanders_n:8.1.0/OPS28.65-36-14/63857:user/release-keys)
Oboe version: ee39453cb1637460f7c4321f9d4d7c4f63d544c0
App name used for testing: Shruti Carnatic Tuner and Our internal audio tests
**Short description**
Moto G 5S+ gives digital silence for OpenSL input stream with preset `Unprocessed`.
We get signal if we use AAudio with any input preset. We also get signal if we use OpenSL with other input presets such as `VoiceRecognition`, `Generic`, and `Camcorder`.
**Steps to reproduce**
As this issue is based on the report by our user, we couldn't ask her to run OboeTester. We were able to run our internal audio tests and arrived at the above conclusions. We are sure similar behavior can be observed through OboeTester.
Though OpenSL with `Unprocessed` gives digital silence, we were able to confirm that the callbacks happen correctly and in the timely manner.
**Expected behavior**
OpenSL input stream with `Unprocessed` input preset should provide signal.
**Actual behavior**
No signal (digital silence) in case of OpenSL input stream with `Unprocessed`.
**Device**
As mentioned above, the device is Moto G 5S+. It does not have MMap support. More details about the configuration we used:
```
DEVICE PROPERTIES
Native samplerate: 48000 Hz
Native Buffer size: 240 samples
ACTUAL VALUES
Current samplerate: 48000 Hz
Input audioApi: OpenSLES
Input bufferCapacityInFrames: 2048
Input bufferSizeInFrames: 2048
Input framesPerBurst: 1024
Input framesPerCallback: 1024
Input deviceId: 0
Input inputPreset: Unprocessed
```
**Additional Context**
Log for our internal audio test suite run is [here](https://gist.githubusercontent.com/rpattabi/7e2c035dc3fee2ea261e4572fb5ae652/raw/d9502e4eff29e0d00175364006002cd0020fd0bb/moto_g_5s_plus_audio_input.log). Please look for `preset=Unprocessed api=OpenSL channels=1` to locate the problem entries.
If you look for `NativeTest` tag, they point to the different tests that we ran. For example, the following is where the particular test for this issue, `InputStreamTest.inputShouldNotBeSilence` for `OpenSL_Unprocessed`, starts here:
```
2021-01-03 10:46:11.000 2012 D/NativeTest: [ RUN ] Input/InputStreamTe
2021-01-03 10:46:11.000 2012 D/NativeTest: st.inputShouldNotBeSilence/OpenSL_Unprocessed
```
*log entry was broken due to the hack we had to use to log from gtest to logcat*
Another test of this issue's interest, `InputStreamTest.capturesPlayedFreq` for `OpenSL_Unprocessed`, starts here:
```
2021-01-03 10:47:14.000 2012 D/NativeTest: [ RUN ] Input/InputStreamTest.capturesPlayedFreq/OpenSL_Unprocessed
```
Contributor guide
Assessment
This issue has not been assessed yet.