summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorvenkappa mala <venkappa.m@samsung.com>2011-10-06 21:16:42 -0700
committerSimon Wilson <simonwilson@google.com>2011-10-20 14:32:43 -0700
commita3799ffeed6f4a9cefbc6e51de0dfa295aa84f13 (patch)
tree6913584222a06b1a90289b6fcdf1bd23b911eb8f /audio
parent620f68674b0fed66487797665eb1351b3d1f1dba (diff)
downloaddevice_samsung_tuna-a3799ffeed6f4a9cefbc6e51de0dfa295aa84f13.zip
device_samsung_tuna-a3799ffeed6f4a9cefbc6e51de0dfa295aa84f13.tar.gz
device_samsung_tuna-a3799ffeed6f4a9cefbc6e51de0dfa295aa84f13.tar.bz2
audio: Fix pop noises during call switch to the modem
Mute and unmute VX_UL gain to avoid pop noises in the tx path during call switch to the modem during the switch it means when audio path changes(Example: Analog path switches from EAR<->HS<->HF). Change-Id: I567d4156a5b9aa7b51d068fe279f942376a5a40c Signed-off-by: venkappa mala <venkappa.m@samsung.com>
Diffstat (limited to 'audio')
-rwxr-xr-xaudio/audio_hw.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 0c404df..db30fbf 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -467,6 +467,7 @@ struct mixer_ctls
struct mixer_ctl *left_capture;
struct mixer_ctl *right_capture;
struct mixer_ctl *amic_ul_volume;
+ struct mixer_ctl *voice_ul_volume;
struct mixer_ctl *sidetone_capture;
struct mixer_ctl *headset_volume;
struct mixer_ctl *speaker_volume;
@@ -909,6 +910,16 @@ static void select_output_device(struct tuna_audio_device *adev)
int dl1_on;
int sidetone_capture_on = 0;
bool tty_volume = false;
+ unsigned int channel;
+
+ /* Mute VX_UL to avoid pop noises in the tx path
+ * during call before switch changes.
+ */
+ if (adev->mode == AUDIO_MODE_IN_CALL) {
+ for (channel = 0; channel < 2; channel++)
+ mixer_ctl_set_value(adev->mixer_ctls.voice_ul_volume,
+ channel, 0);
+ }
headset_on = adev->devices & AUDIO_DEVICE_OUT_WIRED_HEADSET;
headphone_on = adev->devices & AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
@@ -1019,6 +1030,12 @@ static void select_output_device(struct tuna_audio_device *adev)
}
set_incall_device(adev);
+
+ /* Unmute VX_UL after the switch */
+ for (channel = 0; channel < 2; channel++) {
+ mixer_ctl_set_value(adev->mixer_ctls.voice_ul_volume,
+ channel, MIXER_ABE_GAIN_0DB);
+ }
}
mixer_ctl_set_value(adev->mixer_ctls.sidetone_capture, 0, sidetone_capture_on);
@@ -2548,6 +2565,8 @@ static int adev_open(const hw_module_t* module, const char* name,
MIXER_ANALOG_RIGHT_CAPTURE_ROUTE);
adev->mixer_ctls.amic_ul_volume = mixer_get_ctl_by_name(adev->mixer,
MIXER_AMIC_UL_VOLUME);
+ adev->mixer_ctls.voice_ul_volume = mixer_get_ctl_by_name(adev->mixer,
+ MIXER_AUDUL_VOICE_UL_VOLUME);
adev->mixer_ctls.sidetone_capture = mixer_get_ctl_by_name(adev->mixer,
MIXER_SIDETONE_MIXER_CAPTURE);
adev->mixer_ctls.headset_volume = mixer_get_ctl_by_name(adev->mixer,
@@ -2564,8 +2583,9 @@ static int adev_open(const hw_module_t* module, const char* name,
!adev->mixer_ctls.dl1_headset || !adev->mixer_ctls.dl1_bt ||
!adev->mixer_ctls.earpiece_enable || !adev->mixer_ctls.left_capture ||
!adev->mixer_ctls.right_capture || !adev->mixer_ctls.amic_ul_volume ||
- !adev->mixer_ctls.sidetone_capture || !adev->mixer_ctls.headset_volume ||
- !adev->mixer_ctls.speaker_volume || !adev->mixer_ctls.earpiece_volume) {
+ !adev->mixer_ctls.voice_ul_volume || !adev->mixer_ctls.sidetone_capture ||
+ !adev->mixer_ctls.headset_volume || !adev->mixer_ctls.speaker_volume ||
+ !adev->mixer_ctls.earpiece_volume) {
mixer_close(adev->mixer);
free(adev);
LOGE("Unable to locate all mixer controls, aborting.");