From 996da01c08a2d168f13d63032de91f9ac21e4cd0 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 15 Jun 2012 14:49:21 -0700 Subject: audio: acquire lock in adev_set_voice_volume() Acquire the audio device mutex before calling into ril library in adev_set_voice_volume() to avoid concurrency with other calls to ril from select_mode() or set_incall_device(). Bug 6626532. Change-Id: I2347477b39ce46137a654047266b70dd691c021c --- audio/audio_hw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 74f2383..d377f2b 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -1142,7 +1142,7 @@ static void select_mode(struct tuna_audio_device *adev) adev->devices &= ~AUDIO_DEVICE_OUT_SPEAKER; select_output_device(adev); start_call(adev); - adev_set_voice_volume(&adev->hw_device, adev->voice_volume); + ril_set_call_volume(&adev->ril, SOUND_TYPE_VOICE, adev->voice_volume); adev->in_call = 1; } } else { @@ -3408,11 +3408,13 @@ static int adev_set_voice_volume(struct audio_hw_device *dev, float volume) { struct tuna_audio_device *adev = (struct tuna_audio_device *)dev; + pthread_mutex_lock(&adev->lock); adev->voice_volume = volume; if (adev->mode == AUDIO_MODE_IN_CALL) ril_set_call_volume(&adev->ril, SOUND_TYPE_VOICE, volume); + pthread_mutex_unlock(&adev->lock); return 0; } -- cgit v1.1 From 8eb734e945dd3b55d9fabacfebc02fd25989fa9a Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 14 Mar 2012 12:50:51 -0700 Subject: Use audio_channel_mask_t consistently Change-Id: I90a50b58dd23fe522724df53f08b4f9687150da6 --- audio/audio_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index d377f2b..8ae519c 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -1681,7 +1681,7 @@ static size_t out_get_buffer_size_hdmi(const struct audio_stream *stream) return HDMI_MULTI_PERIOD_SIZE * audio_stream_frame_size((struct audio_stream *)stream); } -static uint32_t out_get_channels(const struct audio_stream *stream) +static audio_channel_mask_t out_get_channels(const struct audio_stream *stream) { struct tuna_stream_out *out = (struct tuna_stream_out *)stream; @@ -2240,7 +2240,7 @@ static size_t in_get_buffer_size(const struct audio_stream *stream) popcount(in->main_channels)); } -static uint32_t in_get_channels(const struct audio_stream *stream) +static audio_channel_mask_t in_get_channels(const struct audio_stream *stream) { struct tuna_stream_in *in = (struct tuna_stream_in *)stream; -- cgit v1.1 From 8bf9bea8cb1867e227a640f98b084a4330602d70 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 7 Aug 2012 14:10:40 -0700 Subject: Triple buffer if SRC enabled Bug: 6881638 Change-Id: I76255c2cd5845671c2342e22932c692342257208 --- audio/audio_hw.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 8ae519c..b841c57 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -180,6 +180,11 @@ */ #ifdef PLAYBACK_MMAP #define PLAYBACK_SHORT_PERIOD_COUNT 4 +/* If sample rate converter is required, then use triple-buffering to + * help mask the variance in cycle times. Otherwise use double-buffering. + */ +#elif DEFAULT_OUT_SAMPLING_RATE != MM_FULL_POWER_SAMPLING_RATE +#define PLAYBACK_SHORT_PERIOD_COUNT 3 #else #define PLAYBACK_SHORT_PERIOD_COUNT 2 #endif @@ -297,6 +302,7 @@ enum tty_modes { TTY_MODE_FULL }; +/* deep buffer */ struct pcm_config pcm_config_mm = { .channels = 2, .rate = MM_FULL_POWER_SAMPLING_RATE, @@ -307,6 +313,7 @@ struct pcm_config pcm_config_mm = { .avail_min = DEEP_BUFFER_LONG_PERIOD_SIZE, }; +/* low latency */ struct pcm_config pcm_config_tones = { .channels = 2, .rate = MM_FULL_POWER_SAMPLING_RATE, -- cgit v1.1 From 559a942e6efe21b5beb83c7db50f0986bacfabe2 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 7 Aug 2012 15:31:20 -0700 Subject: Use 3 ms buffers for low latency path Change-Id: Icf113e2e863a79cb3d870fac5781539702cdbfa8 --- audio/audio_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index b841c57..f2fda76 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -127,7 +127,7 @@ /* #define to use mmap no-irq mode for playback, #undef for non-mmap irq mode */ #undef PLAYBACK_MMAP // was #define /* short period (aka low latency) in milliseconds */ -#define SHORT_PERIOD_MS 4 // was 22 +#define SHORT_PERIOD_MS 3 // was 22 /* deep buffer short period (screen on) in milliseconds */ #define DEEP_BUFFER_SHORT_PERIOD_MS 22 /* deep buffer long period (screen off) in milliseconds */ -- cgit v1.1 From 69645ac722fd3eda7b96cac149166fa7ab502fc5 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 30 Aug 2012 11:20:32 -0700 Subject: audio: fix echo reference channels configuration When an auxiliary mic channel is used, the echo reference should use only the main channels to be consistent with the way the reverse effect processing is configured. Change-Id: I28ee1e2a9852fdd0e904fb01bedf90f3372683c9 --- audio/audio_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index f2fda76..2caba05 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -2202,7 +2202,7 @@ static int start_input_stream(struct tuna_stream_in *in) if (in->need_echo_reference && in->echo_reference == NULL) in->echo_reference = get_echo_reference(adev, AUDIO_FORMAT_PCM_16_BIT, - in->config.channels, + popcount(in->main_channels), in->requested_rate); /* this assumes routing is done previously */ -- cgit v1.1 From 7530b97de5f19737e895e9069792940ad8ce66a5 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 28 Aug 2012 14:24:38 -0700 Subject: audio: changes for new audio device enums Modifications for new audio device enums: - Separated input and output device fields as output and input device values are now on 32 bits. - Changed audio device API version to 2.0 Also removed get_supported_devices() function not needed if audio_policy.conf file is present. Change-Id: I41b782e7450b4664048cc484a681b9327d8395da --- audio/audio_hw.c | 112 +++++++++++++++++++++---------------------------------- 1 file changed, 43 insertions(+), 69 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 2caba05..5b5e03e 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -645,7 +645,8 @@ struct tuna_audio_device { struct mixer *mixer; struct mixer_ctls mixer_ctls; audio_mode_t mode; - int devices; + int out_device; + int in_device; struct pcm *pcm_modem_dl; struct pcm *pcm_modem_ul; int in_call; @@ -875,7 +876,7 @@ static void end_call(struct tuna_audio_device *adev) static void set_eq_filter(struct tuna_audio_device *adev) { /* DL1_EQ can't be used for bt */ - int dl1_eq_applicable = adev->devices & (AUDIO_DEVICE_OUT_WIRED_HEADSET | + int dl1_eq_applicable = adev->out_device & (AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE | AUDIO_DEVICE_OUT_EARPIECE); /* 4Khz LPF is used only in NB-AMR voicecall */ @@ -908,7 +909,7 @@ static void set_incall_device(struct tuna_audio_device *adev) { int device_type; - switch(adev->devices & AUDIO_DEVICE_OUT_ALL) { + switch(adev->out_device) { case AUDIO_DEVICE_OUT_EARPIECE: device_type = SOUND_AUDIO_PATH_HANDSET; break; @@ -997,8 +998,8 @@ static void set_output_volumes(struct tuna_audio_device *adev, bool tty_volume) int headset_volume; int earpiece_volume; bool toro = adev->device_is_toro; - int headphone_on = adev->devices & AUDIO_DEVICE_OUT_WIRED_HEADPHONE; - int speaker_on = adev->devices & AUDIO_DEVICE_OUT_SPEAKER; + int headphone_on = adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE; + int speaker_on = adev->out_device & AUDIO_DEVICE_OUT_SPEAKER; int speaker_volume_overrange = MIXER_ABE_GAIN_0DB; int speaker_max_db = DB_FROM_SPEAKER_VOLUME(mixer_ctl_get_range_max(adev->mixer_ctls.speaker_volume)); @@ -1049,7 +1050,7 @@ static void set_output_volumes(struct tuna_audio_device *adev, bool tty_volume) */ if (headphone_on) dl1_volume_correction = normal_headphone_volume - headset_volume; - else if (adev->devices & AUDIO_DEVICE_OUT_WIRED_HEADSET) + else if (adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) dl1_volume_correction = normal_headset_volume - headset_volume; else dl1_volume_correction = normal_earpiece_volume - earpiece_volume; @@ -1138,15 +1139,15 @@ static void select_mode(struct tuna_audio_device *adev) after the ringtone is played, but doesn't cause a route change if a headset or bt device is already connected. If speaker is not the only thing active, just remove it from - the route. We'll assume it'll never be used initally during + the route. We'll assume it'll never be used initially during a call. This works because we're sure that the audio policy manager will update the output device after the audio mode change, even if the device selection did not change. */ - if ((adev->devices & AUDIO_DEVICE_OUT_ALL) == AUDIO_DEVICE_OUT_SPEAKER) - adev->devices = AUDIO_DEVICE_OUT_EARPIECE | - AUDIO_DEVICE_IN_BUILTIN_MIC; - else - adev->devices &= ~AUDIO_DEVICE_OUT_SPEAKER; + if (adev->out_device == AUDIO_DEVICE_OUT_SPEAKER) { + adev->out_device = AUDIO_DEVICE_OUT_EARPIECE; + adev->in_device = AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN; + } else + adev->out_device &= ~AUDIO_DEVICE_OUT_SPEAKER; select_output_device(adev); start_call(adev); ril_set_call_volume(&adev->ril, SOUND_TYPE_VOICE, adev->voice_volume); @@ -1186,11 +1187,11 @@ static void select_output_device(struct tuna_audio_device *adev) channel, 0); } - headset_on = adev->devices & AUDIO_DEVICE_OUT_WIRED_HEADSET; - headphone_on = adev->devices & AUDIO_DEVICE_OUT_WIRED_HEADPHONE; - speaker_on = adev->devices & AUDIO_DEVICE_OUT_SPEAKER; - earpiece_on = adev->devices & AUDIO_DEVICE_OUT_EARPIECE; - bt_on = adev->devices & AUDIO_DEVICE_OUT_ALL_SCO; + headset_on = adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET; + headphone_on = adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE; + speaker_on = adev->out_device & AUDIO_DEVICE_OUT_SPEAKER; + earpiece_on = adev->out_device & AUDIO_DEVICE_OUT_EARPIECE; + bt_on = adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO; /* force rx path according to TTY mode when in call */ if (adev->mode == AUDIO_MODE_IN_CALL && !bt_on) { @@ -1215,7 +1216,7 @@ static void select_output_device(struct tuna_audio_device *adev) default: /* force speaker on when in call and HDMI or S/PDIF is selected * as voice DL audio cannot be routed there by ABE */ - if (adev->devices & + if (adev->out_device & (AUDIO_DEVICE_OUT_AUX_DIGITAL | AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) speaker_on = 1; @@ -1315,18 +1316,18 @@ static void select_input_device(struct tuna_audio_device *adev) int headset_on = 0; int main_mic_on = 0; int sub_mic_on = 0; - int bt_on = adev->devices & AUDIO_DEVICE_IN_ALL_SCO; + int bt_on = adev->in_device & AUDIO_DEVICE_IN_ALL_SCO; if (!bt_on) { if ((adev->mode != AUDIO_MODE_IN_CALL) && (adev->active_input != 0)) { /* sub mic is used for camcorder or VoIP on speaker phone */ sub_mic_on = (adev->active_input->source == AUDIO_SOURCE_CAMCORDER) || - ((adev->devices & AUDIO_DEVICE_OUT_SPEAKER) && + ((adev->out_device & AUDIO_DEVICE_OUT_SPEAKER) && (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION)); } if (!sub_mic_on) { - headset_on = adev->devices & AUDIO_DEVICE_IN_WIRED_HEADSET; - main_mic_on = adev->devices & AUDIO_DEVICE_IN_BUILTIN_MIC; + headset_on = adev->in_device & AUDIO_DEVICE_IN_WIRED_HEADSET; + main_mic_on = adev->in_device & AUDIO_DEVICE_IN_BUILTIN_MIC; } } @@ -1395,8 +1396,7 @@ static int start_output_stream_low_latency(struct tuna_stream_out *out) * tinyalsa. */ - if (adev->devices & (AUDIO_DEVICE_OUT_ALL & - ~(AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | AUDIO_DEVICE_OUT_AUX_DIGITAL))) { + if (adev->out_device & ~(AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | AUDIO_DEVICE_OUT_AUX_DIGITAL)) { /* Something not a dock in use */ out->config[PCM_NORMAL] = pcm_config_tones; out->config[PCM_NORMAL].rate = MM_FULL_POWER_SAMPLING_RATE; @@ -1404,7 +1404,7 @@ static int start_output_stream_low_latency(struct tuna_stream_out *out) flags, &out->config[PCM_NORMAL]); } - if (adev->devices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) { + if (adev->out_device & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) { /* SPDIF output in use */ out->config[PCM_SPDIF] = pcm_config_tones; out->config[PCM_SPDIF].rate = MM_FULL_POWER_SAMPLING_RATE; @@ -1413,7 +1413,7 @@ static int start_output_stream_low_latency(struct tuna_stream_out *out) } /* priority is given to multichannel HDMI output */ - if ((adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) && + if ((adev->out_device & AUDIO_DEVICE_OUT_AUX_DIGITAL) && (adev->outputs[OUTPUT_HDMI] == NULL || adev->outputs[OUTPUT_HDMI]->standby)) { /* HDMI output in use */ out->config[PCM_HDMI] = pcm_config_tones; @@ -1792,7 +1792,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) val = atoi(value); pthread_mutex_lock(&adev->lock); pthread_mutex_lock(&out->lock); - if (((adev->devices & AUDIO_DEVICE_OUT_ALL) != val) && (val != 0)) { + if ((adev->out_device != val) && (val != 0)) { /* this is needed only when changing device on low latency output * as other output streams are not used for voice use cases nor * handle duplication to HDMI or SPDIF */ @@ -1811,26 +1811,25 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) * (several hundred ms of audio can be lost: e.g beginning of a ringtone. We must understand * the root cause in audio HAL, driver or ABE. if (((val & AUDIO_DEVICE_OUT_AUX_DIGITAL) ^ - (adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)) || + (adev->out_device & AUDIO_DEVICE_OUT_AUX_DIGITAL)) || ((val & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) ^ - (adev->devices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) || - (adev->devices & (AUDIO_DEVICE_OUT_AUX_DIGITAL | + (adev->out_device & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) || + (adev->out_device & (AUDIO_DEVICE_OUT_AUX_DIGITAL | AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET))) */ if (((val & AUDIO_DEVICE_OUT_AUX_DIGITAL) ^ - (adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)) || + (adev->out_device & AUDIO_DEVICE_OUT_AUX_DIGITAL)) || ((val & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) ^ - (adev->devices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) || - (adev->devices & (AUDIO_DEVICE_OUT_AUX_DIGITAL | + (adev->out_device & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) || + (adev->out_device & (AUDIO_DEVICE_OUT_AUX_DIGITAL | AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) || ((val & AUDIO_DEVICE_OUT_SPEAKER) ^ - (adev->devices & AUDIO_DEVICE_OUT_SPEAKER)) || + (adev->out_device & AUDIO_DEVICE_OUT_SPEAKER)) || (adev->mode == AUDIO_MODE_IN_CALL)) do_output_standby(out); } if (out != adev->outputs[OUTPUT_HDMI]) { - adev->devices &= ~AUDIO_DEVICE_OUT_ALL; - adev->devices |= val; + adev->out_device = val; select_output_device(adev); } } @@ -2173,8 +2172,7 @@ static int start_input_stream(struct tuna_stream_in *in) adev->active_input = in; if (adev->mode != AUDIO_MODE_IN_CALL) { - adev->devices &= ~AUDIO_DEVICE_IN_ALL; - adev->devices |= in->device; + adev->in_device = in->device; select_input_device(adev); } @@ -2275,7 +2273,7 @@ static int do_input_standby(struct tuna_stream_in *in) adev->active_input = 0; if (adev->mode != AUDIO_MODE_IN_CALL) { - adev->devices &= ~AUDIO_DEVICE_IN_ALL; + adev->in_device = AUDIO_DEVICE_NONE; select_input_device(adev); } @@ -2336,7 +2334,7 @@ static int in_set_parameters(struct audio_stream *stream, const char *kvpairs) ret = str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)); if (ret >= 0) { - val = atoi(value); + val = atoi(value) & ~AUDIO_DEVICE_BIT_IN; if ((in->device != val) && (val != 0)) { in->device = val; do_standby = true; @@ -3305,8 +3303,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev, /* FIXME: when we support multiple output devices, we will want to * do the following: - * adev->devices &= ~AUDIO_DEVICE_OUT_ALL; - * adev->devices |= out->device; + * adev->out_device = out->device; * select_output_device(adev); * This is because out_set_parameters() with a route is not * guaranteed to be called after an output stream is opened. */ @@ -3537,7 +3534,7 @@ static int adev_open_input_stream(struct audio_hw_device *dev, in->dev = ladev; in->standby = 1; - in->device = devices; + in->device = devices & ~AUDIO_DEVICE_BIT_IN; *stream_in = &in->stream; return 0; @@ -3594,29 +3591,6 @@ static int adev_close(hw_device_t *device) return 0; } -static uint32_t adev_get_supported_devices(const struct audio_hw_device *dev) -{ - return (/* OUT */ - AUDIO_DEVICE_OUT_EARPIECE | - AUDIO_DEVICE_OUT_SPEAKER | - AUDIO_DEVICE_OUT_WIRED_HEADSET | - AUDIO_DEVICE_OUT_WIRED_HEADPHONE | - AUDIO_DEVICE_OUT_AUX_DIGITAL | - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET | - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | - AUDIO_DEVICE_OUT_ALL_SCO | - AUDIO_DEVICE_OUT_DEFAULT | - /* IN */ - AUDIO_DEVICE_IN_COMMUNICATION | - AUDIO_DEVICE_IN_AMBIENT | - AUDIO_DEVICE_IN_BUILTIN_MIC | - AUDIO_DEVICE_IN_WIRED_HEADSET | - AUDIO_DEVICE_IN_AUX_DIGITAL | - AUDIO_DEVICE_IN_BACK_MIC | - AUDIO_DEVICE_IN_ALL_SCO | - AUDIO_DEVICE_IN_DEFAULT); -} - static int adev_open(const hw_module_t* module, const char* name, hw_device_t** device) { @@ -3631,11 +3605,10 @@ static int adev_open(const hw_module_t* module, const char* name, return -ENOMEM; adev->hw_device.common.tag = HARDWARE_DEVICE_TAG; - adev->hw_device.common.version = AUDIO_DEVICE_API_VERSION_1_0; + adev->hw_device.common.version = AUDIO_DEVICE_API_VERSION_2_0; adev->hw_device.common.module = (struct hw_module_t *) module; adev->hw_device.common.close = adev_close; - adev->hw_device.get_supported_devices = adev_get_supported_devices; adev->hw_device.init_check = adev_init_check; adev->hw_device.set_voice_volume = adev_set_voice_volume; adev->hw_device.set_master_volume = adev_set_master_volume; @@ -3741,7 +3714,8 @@ static int adev_open(const hw_module_t* module, const char* name, pthread_mutex_lock(&adev->lock); set_route_by_array(adev->mixer, defaults, 1); adev->mode = AUDIO_MODE_NORMAL; - adev->devices = AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_IN_BUILTIN_MIC; + adev->out_device = AUDIO_DEVICE_OUT_SPEAKER; + adev->in_device = AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN; select_output_device(adev); adev->pcm_modem_dl = NULL; -- cgit v1.1 From e71d570bb84a80c9543e0797c0a9bf2082ac88f5 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 7 Sep 2012 11:56:12 -0700 Subject: audio: fix string leakage in out_get_parameters() out_get_parameters() was calling strdup() on the string returned by str_parms_to_str() before returning it to the caller. This creates a new string which is never freed as str_parms_to_str() already allocates a new string. Change-Id: I4bcc4aa17ab55e830d7a0569151f717422f6459b --- audio/audio_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 5b5e03e..4206893 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -1877,7 +1877,7 @@ static char * out_get_parameters(const struct audio_stream *stream, const char * i++; } str_parms_add_str(reply, AUDIO_PARAMETER_STREAM_SUP_CHANNELS, value); - str = strdup(str_parms_to_str(reply)); + str = str_parms_to_str(reply); } else { str = strdup(keys); } -- cgit v1.1 From a33a8e11ac5ba1ca4b3fde29704bc78434e889e9 Mon Sep 17 00:00:00 2001 From: Simon Wilson Date: Tue, 18 Sep 2012 14:32:01 -0700 Subject: audio: increase toro media speaker volume +2dB Bug: 6878923 Change-Id: Id49d6489e5a99dee088246d146ee38151ba9499c --- audio/audio_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 4206893..46b8d9b 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -261,7 +261,7 @@ #define VOICE_CALL_HEADSET_MIC_VOLUME 8 /* use-case specific output volumes */ -#define NORMAL_SPEAKER_VOLUME_TORO 4 +#define NORMAL_SPEAKER_VOLUME_TORO 6 #define NORMAL_SPEAKER_VOLUME_MAGURO 2 #define NORMAL_HEADSET_VOLUME_TORO -12 #define NORMAL_HEADSET_VOLUME_MAGURO -12 -- cgit v1.1 From ee72ef4556336cde5d68a44bdbc479286134d1f0 Mon Sep 17 00:00:00 2001 From: leemin Date: Mon, 24 Sep 2012 10:05:34 +0900 Subject: audio: changes ringtone volume when call is comming the ringtone offset has to be setted to analog side. Buganizer : 6920555 According to Samsung's spec, the earphone ringtone volume level should be 14dB lowere than the media playback volume. On ICS, this behavior was working properly, but on JB this behavior is not working properly. Below is the analog and digital volume change from ICS to JB: ICS : Digital Volume = Normal / Analog volume = lowered 14dB JB : Digital Volume = increased 14dB (in comparison to ICS) / Analog volume = lowered 14dB (same as ICS) Hence the volume in JB has increased by 14dB when compared to ICS. Bug 6920555. Change-Id: Ibc248612db378b5b991221468d8f801257ba4103 --- audio/audio_hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 46b8d9b..66a6da7 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -1083,7 +1083,8 @@ static void set_output_volumes(struct tuna_audio_device *adev, bool tty_volume) speaker_volume_overrange); mixer_ctl_set_value(adev->mixer_ctls.tones_dl2_volume, 0, speaker_volume_overrange + dl2_volume_correction); - } else if (adev->mode == AUDIO_MODE_IN_COMMUNICATION) { + } else if ((adev->mode == AUDIO_MODE_IN_COMMUNICATION) || + (adev->mode == AUDIO_MODE_RINGTONE)) { mixer_ctl_set_value(adev->mixer_ctls.tones_dl1_volume, 0, MIXER_ABE_GAIN_0DB); mixer_ctl_set_value(adev->mixer_ctls.tones_dl2_volume, 0, -- cgit v1.1