google / oboe

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

aaudio capture on some vivo devices glitch #1380

Closed Jimmy198901 closed 4 months ago

Jimmy198901 commented 3 years ago

Android version(s): android10 Android device(s): vivo Oboe version:1.6 App name used for testing: Oboe Tester

Short description (Please only report one bug per Issue. Do not combine multiple bugs.)

aaudio capture glitch when performance is AAUDIO_PERFORMANCE_MODE_LOW_LATENCY

the wav file is following

oboe_recording_20210810-205703.wav.zip

Steps to reproduce

start oboe tester recorder with the following settings Screenshot_2021_0810_210314

Device Screenshot_2021_0810_211345

Screenshot_2021_0810_211404

philburk commented 3 years ago

@Jimmy198901 - Thanks for the report and for including the WAV file. That was extremely helpful. The distortion does not sound like buffer underruns dropout. It sounds like the recording has a high frequency amplitude modulation. This could be caused by tuning configuration files, or bad state in the low level audio path.

Can you please try some experiments? Please try with MMAP disabled to see if it is MMAP specific. Please try with Input Margin set to "2" to detect DSP position errors. Please try with PerfMode: NONE

Then reboot the device and try these tests again.

You say it happens on "some Vivo devices". Does that mean it happens on some Vivo models and not others. Or some units of the same model?

How does it sound if you use a different voice recording app?

Jimmy198901 commented 3 years ago

I took the following test, and the results are

1、try with MMAP disabled The recorded sound has the same problem 2、try with AAUDIO_PERFORMANCE_MODE_NONE The recorded sound is normal 3、try with Input Margin set to "2" The first recorded sound has the following problems,The second time and after the recorded sound is normal

oboe_recording_20210813-183857.wav.zip

When reboot the device and try these tests again,the problems is the same

When I use the aaudio api with the same parameters on our app,the problems is the same

We have received reports of the following models:

vivo

I only tested V2020A because I don't have any other models on hand

philburk commented 3 years ago

@Jimmy198901 - Thanks for the extra details! I have enough information to report this to Vivo.

I have one last request. The latest OboeTester V2.2.2 has an improved "DATA PATHS" test. It is designed to automatically detect these sorts of problems before the device ships.

OboeTester V2.2.2 source is on GitHub and the App is on the Play Store.

Could you please run the DATA PATHS test on your Vivo 2020A? Put phone in a quiet room Press DATA PATHS Turn up volume to about 80% Press START It will play tones over various data paths and record over various data paths. After about 3-5 minutes it will finish. You can then SHARE the report in an email to yourself and then attach it as a file on this Issue. I will share that report with Vivo.

I know I am asking a lot. But this will automatically run a bunch of tests that would take you an hour to run manually.

Jimmy198901 commented 3 years ago

@philburk , Thanks for help solve this problem, the DATA PATHS test report file is following

vivo_data_paths_test_report.log

I forgot to mention an important point,The problem is obvious only when plugging in headphones,so I'm not sure the DATA PATHS test without headphones is going to help

philburk commented 3 years ago

Both MMAP and Legacy have the same problem. Those data paths are completely different above the DSP. So the problem seems to be in the DSP code for the LowLatency path. Probably a bad tuning file. It works fine when NOT in LowLatency mode so we know it is not a hardware problem.

The problem is obvious only when plugging in headphones

OK, that is an important clue. According to https://www.gsmarena.com/vivo_s7-10347.php The Vivo S7 does not have a 3.5mm jack. So this appears to be related to the USB jack.

philburk commented 1 year ago

@xhan96 - I think the problem you are seeing may be different than what @ Jimmy198901 reported. Jimmy is seeing problems with Legacy paths so it is not an MMAP problem. Your problem is specific to MMAP. So I will move our conversation about the InputMargin to #1686.

philburk commented 1 year ago

Tracking internally at: b/267546393 | P2 | aaudio capture on some vivo devices glitch, Vivo S7, USB headset

philburk commented 4 months ago

Vivo never responded. Closing as not actionable.