Issue
When I'm starting my Android Emulator, I click on the three dots at right. Then, in "Extended controls" window, I set the Microphone options all active.
I must do it every time I start it, and it's very annoying. It is possible to make these settings active by default? And how?
Solution
Edit: I was wrong saying there is no other way to allow microphone input. Looked again and found another commit later that introduced allow-host-audio
option. So this is the way to start the emulator with host audio enabled:
emulator -avd YourAvdName -qemu -allow-host-audio
adb emu avd hostmicon
It seems like it's not enabling the switch in the settings, but that's a pure UI issue, the mic works fine.
Previous answer:
I don't believe there is currently a way for this particular setting. Normally emulator setting are saved into AVD.conf
. Here are all the constants for the persistent settings and microphone settings are not among them. Looking further at the Virtual microphone uses host audio input
setting I found the commit which introduced this setting and as you can see when you toggle this setting it sets allow_real_audio
in audio subsystem and that's it. No other code is setting this flag. As you can see here this option is being reset on restart intentionally and hopefully it will be fixed when the described bug is fixed.
Edit: here is a bit more on how exactly the flag is set:
UI switch toggle is handled in this line. It calls this function, which in its turn calls qemu_allow_real_audio, which sets allow_real_audio
flag. This flag is used in the AUD_read
function
if (!allow_real_audio) {
// TODO: Also a potential way to pipe fake audio input
// that is not just all zeroes.
memset(buf, 0x0, size);
}
Answered By - esentsov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.