summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorUK KIM <w0806.kim@samsung.com>2011-08-26 22:09:22 -0700
committerSimon Wilson <simonwilson@google.com>2011-09-08 14:44:27 -0700
commitb48dbbdeab6f28cf99dc25da67e696ac1399c659 (patch)
treeeb0b16befdded6f6d904190594f9dce571899089 /audio
parent8d77cdfe1bc7c34ccdcfe8e5b5cf81c125411a77 (diff)
downloaddevice_samsung_tuna-b48dbbdeab6f28cf99dc25da67e696ac1399c659.zip
device_samsung_tuna-b48dbbdeab6f28cf99dc25da67e696ac1399c659.tar.gz
device_samsung_tuna-b48dbbdeab6f28cf99dc25da67e696ac1399c659.tar.bz2
audio : add to support bluetooth with NR & EC functionality
EC & NR function can be duplicated in modem and bluetooth device. If BT device want to use own function, modem has to turn off own functions. This can be related with clicking sound and sound quality in some case of somde bluetooth device or modem's configuration. Change-Id: Ifebc824e04afc06cd861a67138a1e06ce3f462f1
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 4e82d50..1ecf92a 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -416,7 +416,7 @@ struct tuna_audio_device {
int tty_mode;
int sidetone_capture;
struct echo_reference_itfe *echo_reference;
-
+ bool bluetooth_nrec;
/* RIL */
struct ril_handle ril;
};
@@ -596,7 +596,10 @@ static void set_incall_device(struct tuna_audio_device *adev)
case AUDIO_DEVICE_OUT_BLUETOOTH_SCO:
case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET:
case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT:
- device_type = SOUND_AUDIO_PATH_BLUETOOTH;
+ if (adev->bluetooth_nrec)
+ device_type = SOUND_AUDIO_PATH_BLUETOOTH;
+ else
+ device_type = SOUND_AUDIO_PATH_BLUETOOTH_NO_NR;
break;
default:
device_type = SOUND_AUDIO_PATH_HANDSET;
@@ -2012,6 +2015,14 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
pthread_mutex_unlock(&adev->lock);
}
+ ret = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_BT_NREC, value, sizeof(value));
+ if (ret >= 0) {
+ if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0)
+ adev->bluetooth_nrec = true;
+ else
+ adev->bluetooth_nrec = false;
+ }
+
str_parms_destroy(parms);
return ret;
}
@@ -2311,6 +2322,7 @@ static int adev_open(const hw_module_t* module, const char* name,
adev->voice_volume = 1.0f;
adev->tty_mode = TTY_MODE_OFF;
adev->sidetone_capture = needs_sidetone_capture();
+ adev->bluetooth_nrec = true;
/* RIL */
ril_open(&adev->ril);