From 04b38f91ee08c518d61f02fdf6704e0a654e0eec Mon Sep 17 00:00:00 2001 From: Simon Wilson Date: Fri, 22 Jul 2011 16:42:17 -0700 Subject: Revert "audio: disable output stage when going into standby" The audio output is put into standby during a call so this causes the earpiece and other output routes not to function in that state. Reverting until a better fix is ready. This reverts commit b1695f85e6d4a0baaf8bd3d190d02fe20d537824. --- audio/audio_hw.c | 59 +++++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index f223a33..a9a5be7 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -152,37 +152,31 @@ struct route_setting defaults[] = { .intval = MIXER_ABE_GAIN_0DB, }, { - .ctl_name = MIXER_AUDUL_VOICE_UL_VOLUME, - .intval = MIXER_ABE_GAIN_0DB, + .ctl_name = MIXER_HEADSET_PLAYBACK_VOLUME, + .intval = 13, }, { - .ctl_name = MIXER_CAPTURE_PREAMPLIFIER_VOLUME, - .intval = 1, + .ctl_name = MIXER_EARPHONE_PLAYBACK_VOLUME, + .intval = 15, }, { - .ctl_name = MIXER_CAPTURE_VOLUME, - .intval = 4, + .ctl_name = MIXER_HANDSFREE_PLAYBACK_VOLUME, + .intval = 26, /* max for no distortion */ }, { - .ctl_name = MIXER_SIDETONE_MIXER_PLAYBACK, - .intval = 1, + .ctl_name = MIXER_AUDUL_VOICE_UL_VOLUME, + .intval = MIXER_ABE_GAIN_0DB, }, { - .ctl_name = MIXER_DL1_PDM_SWITCH, + .ctl_name = MIXER_CAPTURE_PREAMPLIFIER_VOLUME, .intval = 1, }, - - /* bt */ { - .ctl_name = MIXER_BT_UL_VOLUME, - .intval = MIXER_ABE_GAIN_MINUS1DB, - }, - { - .ctl_name = NULL, + .ctl_name = MIXER_CAPTURE_VOLUME, + .intval = 4, }, -}; -struct route_setting output_stage[] = { + /* speaker */ { .ctl_name = MIXER_HF_LEFT_PLAYBACK, .strval = MIXER_PLAYBACK_HF_DAC, @@ -191,25 +185,29 @@ struct route_setting output_stage[] = { .ctl_name = MIXER_HF_RIGHT_PLAYBACK, .strval = MIXER_PLAYBACK_HF_DAC, }, + + /* headset */ { - .ctl_name = MIXER_HS_LEFT_PLAYBACK, - .strval = MIXER_PLAYBACK_HS_DAC, + .ctl_name = MIXER_SIDETONE_MIXER_PLAYBACK, + .intval = 1, }, { - .ctl_name = MIXER_HS_RIGHT_PLAYBACK, - .strval = MIXER_PLAYBACK_HS_DAC, + .ctl_name = MIXER_DL1_PDM_SWITCH, + .intval = 1, }, { - .ctl_name = MIXER_HEADSET_PLAYBACK_VOLUME, - .intval = 13, + .ctl_name = MIXER_HS_LEFT_PLAYBACK, + .strval = MIXER_PLAYBACK_HS_DAC, }, { - .ctl_name = MIXER_EARPHONE_PLAYBACK_VOLUME, - .intval = 15, + .ctl_name = MIXER_HS_RIGHT_PLAYBACK, + .strval = MIXER_PLAYBACK_HS_DAC, }, + + /* bt */ { - .ctl_name = MIXER_HANDSFREE_PLAYBACK_VOLUME, - .intval = 26, /* max for no distortion */ + .ctl_name = MIXER_BT_UL_VOLUME, + .intval = MIXER_ABE_GAIN_MINUS1DB, }, { .ctl_name = NULL, @@ -485,9 +483,6 @@ static void select_output_device(struct tuna_audio_device *adev) static int start_output_stream(struct tuna_stream_out *out) { - struct tuna_audio_device *adev = out->dev; - - set_route_by_array(adev->mixer, output_stage, 1); out->pcm = pcm_open(0, PORT_MM, PCM_OUT, &out->config); if (!pcm_is_ready(out->pcm)) { LOGE("cannot open pcm_out driver: %s", pcm_get_error(out->pcm)); @@ -602,10 +597,8 @@ static int out_set_format(struct audio_stream *stream, int format) static int out_standby(struct audio_stream *stream) { struct tuna_stream_out *out = (struct tuna_stream_out *)stream; - struct tuna_audio_device *adev = out->dev; pthread_mutex_lock(&out->lock); - set_route_by_array(adev->mixer, output_stage, 0); if (!out->standby) { pcm_close(out->pcm); out->pcm = NULL; -- cgit v1.1