oboe icon indicating copy to clipboard operation
oboe copied to clipboard

LiveEffect cannot select builtin mic on Android P on Huawei P30

Open miqouser opened this issue 6 years ago • 9 comments

I have an issue on latest Huawei P30 Pro (Android P). It hasn't 3.5mm Jack, but has USB Type-C headset, of course with microphone on it. The problem is I can't choose none of 2 "built in microphones" on device, it seems that library ignores that call, and headset's microphone continue it's work. The question is how to force my app to use "built in" microphone instead of headset's microphone. I even removed "AudioDeviceCallback" after all devices added, so headset isn't even listed, but it's working somehow.

Here is the list of devices (including USB headset too)

2019-08-27 17:51:09.591 9763-9763/? D/____all: built-in earphone speaker 2019-08-27 17:51:09.591 9763-9763/? D/____all: built-in speaker 2019-08-27 17:51:09.591 9763-9763/? D/____all: DOCK 2019-08-27 17:51:09.591 9763-9763/? D/____all: telephony 2019-08-27 17:51:09.591 9763-9763/? D/____all: built-in microphone 2019-08-27 17:51:09.591 9763-9763/? D/____what_I_need: built-in microphone (I want to use this one) 2019-08-27 17:51:09.591 9763-9763/? D/____all: USB device 2019-08-27 17:51:09.591 9763-9763/? D/____all: USB device

miqouser avatar Aug 27 '19 14:08 miqouser

I tried to reproduce this on a Pixel 3a and it worked fine. The built-in mic was used for both listed mics.

It may be specific to the Huawei device.

@dturner - do you have a P30 Pro?

philburk avatar Aug 29 '19 22:08 philburk

Yes, on Pixel 3 it's fine, I've checked too. But here is a fact, with Google's Sound Amplifier I am able to choose microphone on mentioned device. Does it use AAudio engine too ? Maybe there is something with Huawei's headset ? Because with USB Type-C to 3.5mm Jack adapter I am able to choose microphone.

miqouser avatar Sep 03 '19 12:09 miqouser

@dturner - do you have a P30 Pro?

I'm afraid I don't.

But here is a fact, with Google's Sound Amplifier I am able to choose microphone on mentioned device.

Sound Amplifier actually uses Oboe I wonder how there is any difference in behaviour with LiveEffect.

@miqouser Please could you submit a more detailed bug report with the following fields:

Phone make and model and any other hardware used in the test Android build Steps to reproduce Expected result Actual result

It sounds like this might be a headset compatibility issue.

dturner avatar Sep 26 '19 09:09 dturner

@dturner yes of course.

I have 3 Huawei devices:

Mate 20 Pro (don't have 3.5mm Jack) P30 Pro (don't have 3.5mm Jack) P30 Lite (has 3.5mm Jack)

Also have multiple headsets and headphones, including original Huawei headsets.

Build is 9.1

Reproducing is simple, connect headphones with microphone (headset) and just try to change recording device.

Expected result is that recording device must be changed to AudioDeviceInfo.TYPE_BUILTIN_MIC for example (so works fine on any Pixel, Samsung, One Plus, Xiaomi etc).

Actual result is that recording device stays the same, i.e. headphone's microphone, seems app ignores setDeviceId function.

I have found 2 ways how to use Huawei built in microphones. One is to connect headphones without onboard microphone, then built in will be chosen, and the second way is to connect 3.5mm Jack headset (with microphone) via USB-TypeC adapter.

Very very stranger things.

miqouser avatar Sep 26 '19 10:09 miqouser

app ignores setDeviceId function.

Are you selecting the OpenSL ES API? That is a known issue with OpenSL ES. AAudio should honor the deviceID.

philburk avatar Sep 27 '19 00:09 philburk

No, I have completely removed OpenSL ES from my project. I am using only AAudio and minSdk version is above 27. So I must be able to choose recording device. On other devices that works fine.

miqouser avatar Sep 27 '19 10:09 miqouser

@miqouser - OK, thanks for the detailed report.

Looks like a Huawei specific issue. I can get access to a Mate 20. Don and I will investigate and file a bug with Huawei.

philburk avatar Sep 27 '19 14:09 philburk

@philburk thank you too. Will wait for news. But as Don said:

"Sound Amplifier actually uses Oboe I wonder how there is any difference in behaviour with LiveEffect."

Sound Amplifier works fine with Huawei and it's headset. I am sure the problem will be solved.

miqouser avatar Sep 27 '19 14:09 miqouser

@philburk sorry, have you any updates on this ?

miqouser avatar Oct 04 '19 10:10 miqouser