-
Notifications
You must be signed in to change notification settings - Fork 582
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: Problem while using AAudio on Huawei Mate 20 Pro #525
Comments
On Fri, May 24, 2019, 9:37 AM miqouser ***@***.***> wrote:
The problem is on Huawei Mate 20 Pro device, Have you ever tested oboe on
that device ? What can be the problem ?
What problem are you seeing?
What did you expect to happen?
What actually happened?
Did it crash, make noise, crackle, sound too quiet or what?
The mate 20 may be using the mmap data path which is a different data path
than the normal audio flinger data path. There was a problem with the mono
mode. This was recently corrected by Huawei. It would cause corruption of
the mono signal.
Can you reproduce the problem using the OboeTester app in the github
repository?
|
Just tested with OboeTester. I hear my voice like I am a monster, that's the problem. On Pixel 2 voice is distorted with one of built in mics, the other one is ok. But as I know we can't choose microphone using OpenSL ES, right ? We can do it only with AAudio which works only on Pie, right ? |
Please try OboeTester "RECORD AND PLAY" Do they all sound the same? You can use the SHARE button to email yourself a WAV file of the recording.
I tried to reproduce that with OboeTester by recording in 2 channel and 3 channel mode. In 2 channel mode I get the same signal on both channels. In 3 channels mode I get 3 distinct signals. They all sound clear on my Pixel 2 XL.
You can record 3 channels to get 3 mics and then only keep the one you want. |
Good, will test today. What 3 microphones do you mean ? Do you mean I should change this param to 3 ? int32_t mInputChannelCount = oboe::ChannelCount::Mono; I see the enum has only 2 types mono and stereo. enum ChannelCount : int32_t {
|
Hi again. Tested 1 vs 2 channels on Pixel 2. There is all right with one channel. With 2 or 3 channels it sounds like monotonic signal. It's strange. If wired headphones with microphone are plugged (USB Type-C or 3.5 Jack), is there any way to switch to one of built in microphones instead of using headphones microphone on devices under API level 26 ? With API level 26,27 and 28 it is ok (I guess AAudio does the trick). Google has "Sound Amplifier" accessibility application which is available on Play Store only for devices with API 28 (Android P). And I guess it's because the same thing I said above. Thanks in advance, I will be happy if you clearly answer if it is possible or not, so I will not try different ways on devices under API 26. |
The channel count parameter is just an int32_t so you can pass 3.
"Monotonic" or "Monophonic"? On some devices you will get the same signal on every channel.
Unfortunately no. Oboe builder.setDeviceId() does not work with OpenSL ES. oboe/include/oboe/AudioStreamBuilder.h Line 283 in f8ab39a
|
Thank you for help, closing |
I had made some changes in recording/playback mechanism. I am doing some audio processing between record and playback. I am using callbacks for both input and playback audio, then the input data is being written into ring buffer. Then it is being processed by a dedicated thread and passed to another ring buffer which is being read by playback callback.
Everything is good on Samsung (S7, S9+, S10+), Google Pixel 2, One Plus 5T. The problem is on Huawei Mate 20 Pro device, Have you ever tested oboe on that device ? What can be the problem ? With AAudio the sound is broken, with OpenSL ES there is huge latency.
Here is the code of LiveEffectEngine.cpp:
`//other code I didn't touch
void LiveEffectEngine::adjustVolume(void *audioSamples, int sampleCount) {
short *shortSamples = (short *) audioSamples;
float data;
for (int i = 0; i < sampleCount; i++) {
data = static_cast(shortSamples[i]) * mVolumeLevel;
shortSamples[i] = std::min(32767.,std::max(-32768., data));
}
}
oboe::DataCallbackResult
LiveEffectEngine::onAudioReady(oboe::AudioStream *oboeStream, void *audioData, int32_t numFrames){
static bool skip_read = false;
}
void LiveEffectEngine::NC_processing() {
static int16_t temp_buf[960], temp_buf1[960];
std::this_thread::sleep_for(ms(1000));
The text was updated successfully, but these errors were encountered: