Skip to content
Browse files

Revert "alsa_sound: fix for SIP call mute issue."

This reverts commit f859d3e.

bug: 7250052
reopens-bug: 7213748
Change-Id: I33312c0be196b327887edc93c0b766bcf86a94bc
Signed-off-by: Iliyan Malchev <malchev@google.com>
  • Loading branch information...
1 parent 5481e76 commit 604ccc983c49e360ab60427a65d507fbc7672300 Iliyan Malchev committed with The Android Automerger Sep 27, 2012
View
2 alsa_sound/ALSAStreamOps.cpp
@@ -61,6 +61,7 @@ ALSAStreamOps::~ALSAStreamOps()
}
}
mParent->mVoipStreamCount = 0;
+ mParent->mVoipMicMute = 0;
mParent->mVoipBitRate = 0;
}
close();
@@ -347,6 +348,7 @@ void ALSAStreamOps::close()
ALOGD("close");
if((!strncmp(mHandle->useCase, SND_USE_CASE_VERB_IP_VOICECALL, strlen(SND_USE_CASE_VERB_IP_VOICECALL))) ||
(!strncmp(mHandle->useCase, SND_USE_CASE_MOD_PLAY_VOIP, strlen(SND_USE_CASE_MOD_PLAY_VOIP)))) {
+ mParent->mVoipMicMute = false;
mParent->mVoipBitRate = 0;
mParent->mVoipStreamCount = 0;
}
View
36 alsa_sound/AudioHardwareALSA.cpp
@@ -71,7 +71,7 @@ AudioHardwareInterface *AudioHardwareALSA::create() {
}
AudioHardwareALSA::AudioHardwareALSA() :
- mALSADevice(0),mVoipStreamCount(0),mVoipBitRate(0)
+ mALSADevice(0),mVoipStreamCount(0),mVoipMicMute(false),mVoipBitRate(0)
,mCallState(0),mAcdbHandle(NULL),mCsdHandle(NULL)
{
FILE *fp;
@@ -737,6 +737,7 @@ AudioHardwareALSA::openOutputStream(uint32_t devices,
}
if(voipstream_active == false) {
mVoipStreamCount = 0;
+ mVoipMicMute = false;
alsa_handle_t alsa_handle;
unsigned long bufferSize;
if(*sampleRate == VOIP_SAMPLING_RATE_8K) {
@@ -1031,6 +1032,7 @@ AudioHardwareALSA::openInputStream(uint32_t devices,
}
if(voipstream_active == false) {
mVoipStreamCount = 0;
+ mVoipMicMute = false;
alsa_handle_t alsa_handle;
unsigned long bufferSize;
if(*sampleRate == VOIP_SAMPLING_RATE_8K) {
@@ -1289,19 +1291,39 @@ AudioHardwareALSA::closeInputStream(AudioStreamIn* in)
status_t AudioHardwareALSA::setMicMute(bool state)
{
- if (mMicMute != state) {
- mMicMute = state;
- ALOGD("setMicMute: mMicMute %d", mMicMute);
- if(mALSADevice) {
- mALSADevice->setMicMute(state);
+ int newMode = mode();
+ ALOGD("setMicMute newMode %d",newMode);
+ if(newMode == AudioSystem::MODE_IN_COMMUNICATION) {
+ if (mVoipMicMute != state) {
+ mVoipMicMute = state;
+ ALOGD("setMicMute: mVoipMicMute %d", mVoipMicMute);
+ if(mALSADevice) {
+ mALSADevice->setVoipMicMute(state);
+ }
+ }
+ } else {
+ if (mMicMute != state) {
+ mMicMute = state;
+ ALOGD("setMicMute: mMicMute %d", mMicMute);
+ if(mALSADevice) {
+ if(mCSCallActive == CS_ACTIVE)
+ mALSADevice->setMicMute(state);
+ if(mVolteCallActive == IMS_ACTIVE)
+ mALSADevice->setVoLTEMicMute(state);
+ }
}
}
return NO_ERROR;
}
status_t AudioHardwareALSA::getMicMute(bool *state)
{
- *state = mMicMute;
+ int newMode = mode();
+ if(newMode == AudioSystem::MODE_IN_COMMUNICATION) {
+ *state = mVoipMicMute;
+ } else {
+ *state = mMicMute;
+ }
return NO_ERROR;
}
View
1 alsa_sound/AudioHardwareALSA.h
@@ -566,6 +566,7 @@ class AudioHardwareALSA : public AudioHardwareBase
* Settings and Qualcomm Settings applications */
uint32_t mDevSettingsFlag;
uint32_t mVoipStreamCount;
+ bool mVoipMicMute;
uint32_t mVoipBitRate;
uint32_t mIncallMode;
View
5 alsa_sound/AudioStreamInALSA.cpp
@@ -445,10 +445,6 @@ ssize_t AudioStreamInALSA::read(void *buffer, ssize_t bytes)
else {
read += static_cast<ssize_t>((period_size));
read_pending -= period_size;
- //Set mute by cleanning buffers read
- if (mParent->mMicMute) {
- memset(buffer, 0, period_size);
- }
buffer = ((uint8_t *)buffer) + period_size;
}
@@ -495,6 +491,7 @@ status_t AudioStreamInALSA::close()
return NO_ERROR;
}
mParent->mVoipStreamCount = 0;
+ mParent->mVoipMicMute = 0;
#ifdef QCOM_USBAUDIO_ENABLED
} else {
ALOGD("Deregistering REC bit, musbRecordingState:%d", mParent->musbRecordingState);
View
1 alsa_sound/AudioStreamOutALSA.cpp
@@ -299,6 +299,7 @@ status_t AudioStreamOutALSA::close()
return NO_ERROR;
}
mParent->mVoipStreamCount = 0;
+ mParent->mVoipMicMute = 0;
}
#ifdef QCOM_USBAUDIO_ENABLED
else if((!strcmp(mHandle->useCase, SND_USE_CASE_VERB_HIFI_LOW_POWER)) ||

0 comments on commit 604ccc9

Please sign in to comment.
Something went wrong with that request. Please try again.