google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.71k stars 569 forks source link

Low Latency Input on Galaxy Note 20 is silent #1229

Open philburk opened 3 years ago

philburk commented 3 years ago

See discussion at #1228

philburk commented 3 years ago

What are the other parameters for the stream?

Is it a US device (Qualcomm) or an Exynos device? What is the model number?

What is the Android version?

I tested with OboeTester application, In TEST INPUT, please try turning off MMAP.

Also try the DATA PATHS in OboeTester. It will check for dead inputs. it needs to be run in a quiet room with the volume up to about 80%.

ashfaq-opn commented 3 years ago

For me the other parameters are,

API: AAudio Format: I16 Sharing Mode: Exclusive Preset: oboe::InputPreset::VoicePerformance Device ID: kUnspecified Direction: Input Channel count: Stereo Sample rate: 48000

I didn't set any other option.

I tried turning MMAP on and off in Oboe Tester. It didn't help. Still getting a DC value.

The device details are below,

Android Version: 11 Model: SM-N981B/DS Chipset: Exynos 990

I tried the Data Paths in OboeTester, in a quiet room with full volume. Attaching the result below:

data_paths_test_samsung_note20_1229.txt

philburk commented 3 years ago

Thanks for running the Data Paths test! That is very helpful. I can see that every MMAP input test for DATA PATHS is failing. Also it is skipping all the MMAP output tests. I will contact Samsung about this.

This is probably related to #892 Both the S20 and the Note20 use the Exynos 990.

There was a quirk added to Oboe 1.5.1 for Exynos 990 in #1172 that would disable MMAP. Is your app running Oboe 1.5.1? This should have disabled MMAP on your device

The Oboe Workarounds and QuirkManager can be disabled from the main screen in OboeTester so that we can test either way.

Maybe the changelist is different for Note 20. What do you get for:

adb shell getprop ro.build.changelist

I tried turning MMAP on and off in Oboe Tester. It didn't help. Still getting a DC value.

I think the OboeTester UI misled you. The MMAP checkbox is only read at the OPEN. Toggling MMAP after opening has no effect. I will disable the checkbox after Open. #1233

ashfaq-opn commented 3 years ago

@philburk Thank you very much for your help in this. For now I decided to turn off LowLatency mode for recording. When this issue will be resolved I will turn back it On.

I am using the latest commit from master branch in Oboe. So yes, 1.5.1.

I basically unchecked the MMAP checkbox before OPEN. Today I tried again. From main screen I tried enabling "Oboe Workarounds" then went to "Test Input", unchecked the box "MMAP" and then I hit Open and then Start. Still it is capturing no sound.

I can see that every MMAP input test for DATA PATHS is failing.
Also it is skipping all the MMAP output tests.

As the problem is with MMAP, is there any way to turn that off before stream creation in Oboe?

The command you mentioned gives me the following output.

./adb shell getprop ro.build.changelist
20939149
philburk commented 3 years ago

unchecked the box "MMAP" and then I hit Open and then Start. Still it is capturing no sound.

That suggests the problem is not just with MMAP. But the data paths test indicate it is an MMAP problem.

is there any way to turn [MMAP] off before stream creation in Oboe?

The API is not exposed, but there is a class in the aaudio folder. https://github.com/google/oboe/blob/master/src/aaudio/AAudioExtensions.h Call:

    AAudioExtensions::getInstance().setMMapEnabled(false);

Please let me know if that solves the problem.