merge in jb-mr2-release history after reset to jb-mr2-dev
diff --git a/Android.mk b/Android.mk
index 25e34d1..5230e2c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,4 +1,4 @@
-ifneq ($(filter msm8960,$(TARGET_BOARD_PLATFORM)),)
+ifneq ($(filter msm8960 msm8x26 msm8x74,$(TARGET_BOARD_PLATFORM)),)
LOCAL_PATH := $(call my-dir)
diff --git a/hal/Android.mk b/hal/Android.mk
index b9b5e1c..148e66c 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -21,7 +21,7 @@
external/tinyalsa/include \
$(call include-path-for, audio-route)
-LOCAL_MODULE := audio.primary.msm8960
+LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 3782c32..55ab055 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1380,6 +1380,12 @@
static int out_set_volume(struct audio_stream_out *stream, float left,
float right)
{
+ struct stream_out *out = (struct stream_out *)stream;
+ if (out->usecase == USECASE_AUDIO_PLAYBACK_MULTI_CH) {
+ /* only take left channel into account: the API is for stereo anyway */
+ out->muted = (left == 0.0f);
+ return 0;
+ }
return -ENOSYS;
}
@@ -1402,6 +1408,8 @@
}
if (out->pcm) {
+ if (out->muted)
+ memset((void *)buffer, 0, bytes);
//ALOGV("%s: writing buffer (%d bytes) to pcm device", __func__, bytes);
ret = pcm_write(out->pcm, (void *)buffer, bytes);
}
@@ -1712,6 +1720,7 @@
out->dev = adev;
out->standby = 1;
+ /* out->muted = false; by calloc() */
config->format = out->stream.common.get_format(&out->stream.common);
config->channel_mask = out->stream.common.get_channels(&out->stream.common);
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 7bc2ecb..0ac03fa 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -158,6 +158,7 @@
audio_usecase_t usecase;
/* Array of supported channel mask configurations. +1 so that the last entry is always 0 */
audio_channel_mask_t supported_channel_masks[MAX_SUPPORTED_CHANNEL_MASKS + 1];
+ bool muted;
struct audio_device *dev;
};