[SND_DEVICE_IN_EARPIECE_MIC_AEC] = "earpiece-mic",
[SND_DEVICE_IN_SPEAKER_MIC_AEC] = "voice-speaker-mic",
[SND_DEVICE_IN_HEADSET_MIC_AEC] = "headset-mic",
+ [SND_DEVICE_IN_VOICE_MIC] = "voice-mic",
+ [SND_DEVICE_IN_VOICE_EARPIECE_MIC] = "voice-earpiece-mic",
[SND_DEVICE_IN_VOICE_SPEAKER_MIC] = "voice-speaker-mic",
[SND_DEVICE_IN_VOICE_HEADSET_MIC] = "voice-headset-mic",
[SND_DEVICE_IN_HDMI_MIC] = "hdmi-mic",
goto exit;
}
- if (out_device & AUDIO_DEVICE_OUT_EARPIECE ||
- out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
- snd_device = SND_DEVICE_IN_EARPIECE_MIC;
- } else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) {
+ snd_device = SND_DEVICE_IN_VOICE_MIC;
+ if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) {
snd_device = SND_DEVICE_IN_VOICE_HEADSET_MIC;
} else if (out_device & AUDIO_DEVICE_OUT_ALL_SCO) {
- snd_device = SND_DEVICE_IN_BT_SCO_MIC ;
- } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) {
- snd_device = SND_DEVICE_IN_VOICE_SPEAKER_MIC;
+ snd_device = SND_DEVICE_IN_BT_SCO_MIC;
+ }
+
+ if (voice_session_uses_twomic(adev->voice.session)) {
+ if (out_device & AUDIO_DEVICE_OUT_EARPIECE ||
+ out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
+ snd_device = SND_DEVICE_IN_VOICE_EARPIECE_MIC;
+ } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) {
+ snd_device = SND_DEVICE_IN_VOICE_SPEAKER_MIC;
+ }
}
} else if (source == AUDIO_SOURCE_CAMCORDER) {
if (in_device & AUDIO_DEVICE_IN_BUILTIN_MIC ||
SND_DEVICE_IN_EARPIECE_MIC_AEC,
SND_DEVICE_IN_SPEAKER_MIC_AEC,
SND_DEVICE_IN_HEADSET_MIC_AEC,
+ SND_DEVICE_IN_VOICE_MIC,
+ SND_DEVICE_IN_VOICE_EARPIECE_MIC,
SND_DEVICE_IN_VOICE_SPEAKER_MIC,
SND_DEVICE_IN_VOICE_HEADSET_MIC,
SND_DEVICE_IN_HDMI_MIC,
ril_set_call_volume(&session->ril, sound_type, volume);
}
+bool voice_session_uses_twomic(struct voice_session *session)
+{
+ if (session->two_mic_disabled) {
+ return false;
+ }
+
+ return session->two_mic_control;
+}
+
static void voice_session_wb_amr_callback(void *data, int enable)
{
struct audio_device *adev = (struct audio_device *)data;
void set_voice_session_volume(struct voice_session *session, float volume);
void set_voice_session_audio_path(struct voice_session *session);
+bool voice_session_uses_twomic(struct voice_session *session);
+
struct voice_session *voice_session_init(struct audio_device *adev);
void voice_session_deinit(struct voice_session *s);