Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

audio: separate device for voice call

1. avoid to change gain as below scenarioes
- after call end, immediately music start with headset
- when device is changed from headset to speaker in voice call
  with touch effect sound, temporarily voice call gain is increased
  until changed to speaker

2. this commit set different configuration of voice and audio.

Change-Id: I89f1c1736d1ba56cb90a5e94f673b3f0439ab089
Signed-off-by: Iliyan Malchev <malchev@google.com>
  • Loading branch information...
commit 925596f513542570d660da7902e9d2219c9cfc69 1 parent 9858010
ty.lee authored Iliyan Malchev committed
Showing with 40 additions and 12 deletions.
  1. +32 −10 alsa_sound/alsa_default.cpp
  2. +8 −2 libalsa-intf/msm8960_use_cases.h
View
42 alsa_sound/alsa_default.cpp
@@ -1295,20 +1295,35 @@ char *getUCMDevice(uint32_t devices, int input, char *rxDevice)
return strdup(SND_USE_CASE_DEV_SPEAKER_FM_TX); /* COMBO SPEAKER+FM_TX RX */
#endif
} else if (devices & AudioSystem::DEVICE_OUT_EARPIECE) {
- return strdup(SND_USE_CASE_DEV_EARPIECE); /* HANDSET RX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_EARPIECE); /* Voice HANDSET RX */
+ } else
+ return strdup(SND_USE_CASE_DEV_EARPIECE); /* HANDSET RX */
} else if (devices & AudioSystem::DEVICE_OUT_SPEAKER) {
- return strdup(SND_USE_CASE_DEV_SPEAKER); /* SPEAKER RX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_SPEAKER); /* Voice SPEAKER RX */
+ } else
+ return strdup(SND_USE_CASE_DEV_SPEAKER); /* SPEAKER RX */
} else if ((devices & AudioSystem::DEVICE_OUT_WIRED_HEADSET) ||
(devices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE)) {
if (mDevSettingsFlag & ANC_FLAG) {
- return strdup(SND_USE_CASE_DEV_ANC_HEADSET); /* ANC HEADSET RX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_ANC_HEADSET); /* Voice ANC HEADSET RX */
+ } else
+ return strdup(SND_USE_CASE_DEV_ANC_HEADSET); /* ANC HEADSET RX */
} else {
- return strdup(SND_USE_CASE_DEV_HEADPHONES); /* HEADSET RX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_HEADPHONE); /* Voice HEADSET RX */
+ } else
+ return strdup(SND_USE_CASE_DEV_HEADPHONES); /* HEADSET RX */
}
#ifdef QCOM_ANC_HEADSET_ENABLED
} else if ((devices & AudioSystem::DEVICE_OUT_ANC_HEADSET) ||
(devices & AudioSystem::DEVICE_OUT_ANC_HEADPHONE)) {
- return strdup(SND_USE_CASE_DEV_ANC_HEADSET); /* ANC HEADSET RX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_ANC_HEADSET); /* Voice ANC HEADSET RX */
+ } else
+ return strdup(SND_USE_CASE_DEV_ANC_HEADSET); /* ANC HEADSET RX */
#endif
} else if ((devices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO) ||
(devices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_HEADSET) ||
@@ -1338,7 +1353,10 @@ char *getUCMDevice(uint32_t devices, int input, char *rxDevice)
return strdup(SND_USE_CASE_DEV_FM_TX); /* FM Tx */
#endif
} else if (devices & AudioSystem::DEVICE_OUT_DEFAULT) {
- return strdup(SND_USE_CASE_DEV_SPEAKER); /* SPEAKER RX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_SPEAKER); /* Voice SPEAKER RX */
+ } else
+ return strdup(SND_USE_CASE_DEV_SPEAKER); /* SPEAKER RX */
} else {
ALOGD("No valid output device: %u", devices);
}
@@ -1406,10 +1424,8 @@ char *getUCMDevice(uint32_t devices, int input, char *rxDevice)
#endif
#ifdef SEPERATED_AUDIO_INPUT
if(input_source == AUDIO_SOURCE_VOICE_RECOGNITION) {
- ALOGV("getUCMdevice returned the VOICE_RECOGNITION UCM by input source = %d", input_source);
return strdup(SND_USE_CASE_DEV_VOICE_RECOGNITION ); /* VOICE RECOGNITION TX */
} else if(input_source == AUDIO_SOURCE_CAMCORDER) {
- ALOGV("getUCMdevice returned the Camcorder Tx UCM by input source = %d", input_source);
return strdup(SND_USE_CASE_DEV_CAMCORDER_TX ); /* CAMCORDER TX */
}
#endif
@@ -1424,7 +1440,10 @@ char *getUCMDevice(uint32_t devices, int input, char *rxDevice)
return strdup(SND_USE_CASE_DEV_HEADSET); /* HEADSET TX */
#endif
} else if (devices & AudioSystem::DEVICE_IN_WIRED_HEADSET) {
- return strdup(SND_USE_CASE_DEV_HEADSET); /* HEADSET TX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_HEADSET); /* Voice HEADSET TX */
+ } else
+ return strdup(SND_USE_CASE_DEV_HEADSET); /* HEADSET TX */
} else if (devices & AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET) {
if (btsco_samplerate == BTSCO_RATE_16KHZ)
return strdup(SND_USE_CASE_DEV_BTSCO_WB_TX); /* BTSCO TX*/
@@ -1457,7 +1476,10 @@ char *getUCMDevice(uint32_t devices, int input, char *rxDevice)
if (!strncmp(mic_type, "analog", 6)) {
return strdup(SND_USE_CASE_DEV_HANDSET); /* HANDSET TX */
} else {
- return strdup(SND_USE_CASE_DEV_LINE); /* BUILTIN-MIC TX */
+ if (callMode == AudioSystem::MODE_IN_CALL) {
+ return strdup(SND_USE_CASE_DEV_VOC_LINE); /* Voice BUILTIN-MIC TX */
+ } else
+ return strdup(SND_USE_CASE_DEV_LINE); /* BUILTIN-MIC TX */
}
} else {
ALOGD("No valid input device: %u", devices);
View
10 libalsa-intf/msm8960_use_cases.h
@@ -250,8 +250,14 @@ static card_mapping_t card_mapping_list[] = {
#define SND_USE_CASE_DEV_PROXY_RX_ANC_HEADSET "PROXY Rx ANC Headset"
#define SND_USE_CASE_DEV_PROXY_RX_SPEAKER_HEADSET "PROXY Rx Speaker Headset"
#define SND_USE_CASE_DEV_PROXY_RX_SPEAKER_ANC_HEADSET "PROXY Rx Speaker ANC Headset"
-#define SND_USE_CASE_DEV_CAMCORDER_TX "Camcorder Tx"
-#define SND_USE_CASE_DEV_VOICE_RECOGNITION "Voice Recognition"
+#define SND_USE_CASE_DEV_CAMCORDER_TX "Camcorder Tx"
+#define SND_USE_CASE_DEV_VOICE_RECOGNITION "Voice Recognition"
+#define SND_USE_CASE_DEV_VOC_EARPIECE "Voice Earpiece"
+#define SND_USE_CASE_DEV_VOC_HEADPHONE "Voice Headphones"
+#define SND_USE_CASE_DEV_VOC_HEADSET "Voice Headset"
+#define SND_USE_CASE_DEV_VOC_ANC_HEADSET "Voice ANC Headset"
+#define SND_USE_CASE_DEV_VOC_SPEAKER "Voice Speaker"
+#define SND_USE_CASE_DEV_VOC_LINE "Voice Line"
#define SND_USE_CASE_MOD_PLAY_FM "Play FM"
#define SND_USE_CASE_MOD_CAPTURE_FM "Capture FM"
Please sign in to comment.
Something went wrong with that request. Please try again.