Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

msm7x27a: Add support for call-mode-specific speaker endpoint

If it exists, use it, else keep using the normal DEVICE_SPEAKER
Change-Id: I62b44a27e6ba92c78fa28217ad58d065cb19ed57
  • Loading branch information...
commit 5759e9607fd6c95ef79152ccee80bf5d17741bbd 1 parent 92e8b9e
@rmcc rmcc authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 msm7627a/AudioHardware.cpp
View
15 msm7627a/AudioHardware.cpp
@@ -125,6 +125,7 @@ static int snd_device = -1;
static uint32_t SND_DEVICE_CURRENT=-1;
static uint32_t SND_DEVICE_HANDSET=-1;
static uint32_t SND_DEVICE_SPEAKER=-1;
+static uint32_t SND_DEVICE_SPEAKER_IN_CALL=-1;
static uint32_t SND_DEVICE_BT=-1;
static uint32_t SND_DEVICE_BT_EC_OFF=-1;
static uint32_t SND_DEVICE_HEADSET=-1;
@@ -175,6 +176,7 @@ AudioHardware::AudioHardware() :
CHECK_FOR(CURRENT);
CHECK_FOR(HANDSET);
CHECK_FOR(SPEAKER);
+ CHECK_FOR(SPEAKER_IN_CALL);
CHECK_FOR(BT);
CHECK_FOR(BT_EC_OFF);
CHECK_FOR(HEADSET);
@@ -1205,6 +1207,11 @@ static int msm72xx_enable_postproc(bool state)
device_id = 2;
ALOGI("set device to SND_DEVICE_HEADSET device_id=2");
}
+ if(snd_device == SND_DEVICE_SPEAKER_IN_CALL)
+ {
+ device_id = 7;
+ ALOGI("set device to SND_DEVICE_SPEAKER_IN_CALL device_id=7");
+ }
fd = open(PCM_CTL_DEVICE, O_RDWR);
if (fd < 0) {
@@ -1451,6 +1458,7 @@ status_t AudioHardware::setMasterVolume(float v)
ALOGI("Set master volume to %d.\n", vol);
set_volume_rpc(SND_DEVICE_HANDSET, SND_METHOD_VOICE, vol, m7xsnddriverfd);
set_volume_rpc(SND_DEVICE_SPEAKER, SND_METHOD_VOICE, vol, m7xsnddriverfd);
+ set_volume_rpc(SND_DEVICE_SPEAKER_IN_CALL, SND_METHOD_VOICE, vol, m7xsnddriverfd);
set_volume_rpc(SND_DEVICE_BT, SND_METHOD_VOICE, vol, m7xsnddriverfd);
set_volume_rpc(SND_DEVICE_HEADSET, SND_METHOD_VOICE, vol, m7xsnddriverfd);
set_volume_rpc(SND_DEVICE_IN_S_SADC_OUT_HANDSET, SND_METHOD_VOICE, vol, m7xsnddriverfd);
@@ -1702,7 +1710,12 @@ status_t AudioHardware::doRouting(AudioStreamInMSM72xx *input)
new_post_proc_feature_mask = (ADRC_ENABLE | EQ_ENABLE | RX_IIR_ENABLE | MBADRC_ENABLE);
} else if (outputDevices & AudioSystem::DEVICE_OUT_SPEAKER) {
ALOGI("Routing audio to Speakerphone\n");
- new_snd_device = SND_DEVICE_SPEAKER;
+ if (mMode == AudioSystem::MODE_IN_CALL && SND_DEVICE_SPEAKER_IN_CALL >= 0) {
+ ALOGI("Call-mode speaker exists, using it\n");
+ new_snd_device = SND_DEVICE_SPEAKER_IN_CALL;
+ } else {
+ new_snd_device = SND_DEVICE_SPEAKER;
+ }
new_post_proc_feature_mask = (ADRC_ENABLE | EQ_ENABLE | RX_IIR_ENABLE | MBADRC_ENABLE);
} else if (outputDevices & AudioSystem::DEVICE_OUT_EARPIECE) {
ALOGI("Routing audio to Handset\n");
Please sign in to comment.
Something went wrong with that request. Please try again.