Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiveEffect demo corrupt audio with internal mic and speakers on Samsung S20 Ultra 5G #892

Closed
chrbsg opened this issue Jun 12, 2020 · 7 comments · Fixed by #1172
Closed
Assignees
Labels

Comments

@chrbsg
Copy link

chrbsg commented Jun 12, 2020

Android version(s): 10
Android device(s): Samsung S20 Ultra 5G
Oboe version: master
App name used for testing: LiveEffect
(Please try to reproduce the issue using the OboeTester or an Oboe sample.)

Short description
Select built-in microphone and built-in earphone speaker. Audio sounds corrupted, like a deep rumbling. On Pixel 2 XL, the same test (built-in microphone and built-in earphone speaker) sounds crystal clear.

Steps to reproduce
Load LiveEffect, select bult-in microphone, built-in earphone speaker
Select aaudio or OpenSL ES (happens on both)
Hold phone to ear and talk

Expected behavior
audio should be clear

Actual behavior
audio is not clear

Any additional context

@philburk
Copy link
Collaborator

Thanks for reporting this. We don't have an S20 so this is hard for us to test.

Select aaudio or OpenSL ES (happens on both)

OK, then this is NOT related to MMAP because OpenSL ES does not use MMAP.
And it is not related to #824 "broken mono" because LiveEffect uses stereo input and output.

@chrbsg - can you hear your voice behind the rumbling or do you only hear the rumbling?
Is your voice distorted, chopped up, raised or lowered in pitch?
Is there rumbling when you don't speak?

Could you please try some tests in OboeTester, like RECORD AND PLAY?
https://github.com/google/oboe/tree/master/apps/OboeTester/docs

After you make a recording, you can click SHARE to send it to GDrive or GMail.
Then you could attach a short recording to this bug. That will tell us a lot.

Can you please enter:

adb shell getprop ro.hardware.chipname
adb shell getprop ro.build.description

and paste the results?

@chrbsg
Copy link
Author

chrbsg commented Jun 15, 2020

I can hear my voice - if I whisper it sounds clearer, if I' speak louder then it's more distorted. There is a rumbling when not speaking, and this seems to be louder when speaking. It sounds from the recording like the played back audio is slowed down?

I tried OboeTester "Record and Play". Results:

(OpenSL, 48kHz, 2ch, perf=LOW_LATENCY) = ok
(AAudio, 48kHz, 2ch, perf=LOW_LATENCY) = bad
(AAudio, 48kHz, 2ch, perf=NONE) = ok
(AAudio, 48kHz, 2ch, perf=POWER_SAVING) = ok
(AAudio, 44100Hz, 2ch, perf=LOW_LATENCY) = ok
(AAudio, 16kHz, 2ch, perf=LOW_LATENCY) = ok
(AAudio, 16kHz, 2ch, perf=NONE) = ok
(AAudio, 8kHz, 2ch, perf=LOW_LATENCY) = ok
(AAudio, 8kHz, 1ch, perf=LOW_LATENCY) = ok
(AAudio, 16kHz, 1ch, perf=LOW_LATENCY) = ok
(AAudio, 24kHz, 1ch, perf=LOW_LATENCY) = ok
(AAudio, 44100Hz, 1ch, perf=LOW_LATENCY) = ok
(AAudio, 48kHz, 1ch, perf=LOW_LATENCY) = bad

So it looks like this is caused by using AAudio 48kHz with LOW_LATENCY.
What seems odd is that I couldn't reproduce this with OpenSL ES in "Record and Play" but it happens with OpenSL ES selected in the LiveEffect demo.

Recording with perf=NONE: oboe_recording-none.wav.gz
Recording with perf=LOW_LATENCY: oboe_recording-lowlatency.wav.gz

@chrbsg
Copy link
Author

chrbsg commented Jun 15, 2020

$ adb shell getprop ro.hardware.chipname
exynos990
$ adb shell getprop ro.build.description
z3sxxx-user 10 QP1A.190711.020 G988BXXU1ATCD release-keys

@philburk
Copy link
Collaborator

@chrbsg - thank you so much for the info. That is super helpful.

I have passed this information along to Samsung at b/159066712

@taemincho
Copy link

taemincho commented Jul 21, 2020

Same here, heavy glitches on Samsung S20

Unlike @chrbsg 's result above, the problem happens for both OpenSLES and AAudio in all cases if they run in SL_ANDROID_PERFORMANCE_LATENCY or PerformanceMode::LowLatency modes, respectively.

If they run in SL_ANDROID_PERFORMANCE_NONE or PerformanceMode::None, all cases work fine.

This happens on the input only, the output is okay in all cases.

Device info:
adb shell getprop ro.hardware.chipname
exynos990

adb shell getprop ro.build.description
y2sxx-user 10 QP1A.190711.020 G985FXXU1ATB3 release-keys

@philburk
Copy link
Collaborator

philburk commented Sep 2, 2020

I have heard from Samsung that a fix for this has been released to the market.
One UI 2.5 update , G98xxXXU4BTH5
I think that works for Q.

I do not have an S20.

@chrbsg If you have that update, can you please try your test again?
@taemincho Can you also test this?

@chrbsg
Copy link
Author

chrbsg commented Sep 4, 2020

@philburk I no longer have the S20.

philburk added a commit that referenced this issue Jan 25, 2021
The S20 input had some glitches in an early version.
So we turn off MMAP in that case.

We also moved the AAudioExtensions class from OboeTester into Oboe.

Fixes #892
philburk added a commit that referenced this issue Feb 3, 2021
The S20 input had some glitches in an early version.
So we turn off MMAP in that case.

We also moved the AAudioExtensions class from OboeTester into Oboe.

Fixes #892
philburk added a commit that referenced this issue Feb 4, 2021
The S20 input had some glitches in an early version.
So we turn off MMAP in that case.

We also moved the AAudioExtensions class from OboeTester into Oboe.

Fixes #892
@philburk philburk reopened this Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants