Merge "configs: msm8953: Add speaker and headphones paths"
diff --git a/configs/msm8953/msm8953.mk b/configs/msm8953/msm8953.mk
index 83baae5..e9ed7f7 100644
--- a/configs/msm8953/msm8953.mk
+++ b/configs/msm8953/msm8953.mk
@@ -10,7 +10,7 @@
AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true
-AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true
+AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := false
AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index c7186d9..db04b5a 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -90,7 +90,6 @@
#define DIRECT_PCM_NUM_FRAGMENTS 2
#define COMPRESS_PLAYBACK_VOLUME_MAX 0x2000
#define VOIP_PLAYBACK_VOLUME_MAX 0x2000
-#define PCM_PLAYBACK_VOLUME_MAX 0x2000
#define DSD_VOLUME_MIN_DB (-110)
#define PROXY_OPEN_RETRY_COUNT 100
@@ -444,7 +443,6 @@
static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool restore);
static int out_set_compr_volume(struct audio_stream_out *stream, float left, float right);
static int out_set_voip_volume(struct audio_stream_out *stream, float left, float right);
-static int out_set_pcm_volume(struct audio_stream_out *stream, float left, float right);
static bool may_use_noirq_mode(struct audio_device *adev, audio_usecase_t uc_id,
int flags __unused)
@@ -3101,8 +3099,6 @@
// apply volume for voip playback after path is set up
if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP)
out_set_voip_volume(&out->stream, out->volume_l, out->volume_r);
- else if ((out->usecase == USECASE_AUDIO_PLAYBACK_LOW_LATENCY || out->usecase == USECASE_AUDIO_PLAYBACK_DEEP_BUFFER))
- out_set_pcm_volume(&out->stream, out->volume_l, out->volume_r);
} else {
platform_set_stream_channel_map(adev->platform, out->channel_mask,
out->pcm_device_id, &out->channel_map_param.channel_map[0]);
@@ -4159,33 +4155,6 @@
return 0;
}
-static int out_set_pcm_volume(struct audio_stream_out *stream, float left,
- float right)
-{
- struct stream_out *out = (struct stream_out *)stream;
- /* Volume control for pcm playback */
- if (left != right) {
- return -EINVAL;
- } else {
- char mixer_ctl_name [128];
- struct audio_device *adev = out->dev;
- struct mixer_ctl *ctl;
- int pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK);
- snprintf(mixer_ctl_name, sizeof(mixer_ctl_name), "Playback %d Volume", pcm_device_id);
- ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
- if (!ctl) {
- ALOGE("%s : Could not get ctl for mixer cmd - %s", __func__, mixer_ctl_name);
- return -EINVAL;
- }
- int volume = (int) (left * PCM_PLAYBACK_VOLUME_MAX);
- mixer_ctl_set_value(ctl, 0, volume);
-
- ALOGV("%s : Pcm set volume value %d", __func__, volume);
-
- return 0;
- }
-}
-
static int out_set_volume(struct audio_stream_out *stream, float left,
float right)
{
@@ -4235,13 +4204,6 @@
out->volume_l = left;
out->volume_r = right;
return ret;
- } else {
- /* Volume control for pcm playback */
- if (!out->standby)
- ret = out_set_pcm_volume(stream, left, right);
- out->volume_l = left;
- out->volume_r = right;
- return ret;
}
return -ENOSYS;
@@ -4563,7 +4525,7 @@
out_get_sample_rate(&out->stream.common));
if (audio_extn_passthru_is_passthrough_stream(out)) {
- ALOGE("%s: write error, ret = %ld", __func__, ret);
+ ALOGE("%s: write error, ret = %zd", __func__, ret);
ATRACE_END();
return ret;
}
diff --git a/qahw_api/test/qahw_multi_record_test.c b/qahw_api/test/qahw_multi_record_test.c
index e00ef7b..2d9ee6a 100644
--- a/qahw_api/test/qahw_multi_record_test.c
+++ b/qahw_api/test/qahw_multi_record_test.c
@@ -363,15 +363,17 @@
}
FILE *fd_in_ts;
- if (*(params->timestamp_file_in))
- fd_in_ts = fopen(params->timestamp_file_in, "w+");
- if (fd_in_ts == NULL) {
- fprintf(log_file, "playback timestamps file open failed \n");
- if (log_file != stdout)
- fprintf(stdout, "playback timestamps file open failed \n");
- test_end();
- pthread_exit(0);
- }
+ if (params->timestamp_mode) {
+ if (*(params->timestamp_file_in))
+ fd_in_ts = fopen(params->timestamp_file_in, "w+");
+ if (fd_in_ts == NULL) {
+ fprintf(log_file, "playback timestamps file open failed \n");
+ if (log_file != stdout)
+ fprintf(stdout, "playback timestamps file open failed \n");
+ test_end();
+ pthread_exit(0);
+ }
+ }
int bps = 16;
switch(params->config.format) {
@@ -455,7 +457,9 @@
}
data_sz += buffer_size;
}
- fclose(fd_in_ts);
+ if (params->timestamp_mode)
+ fclose(fd_in_ts);
+
/*Stopping sourcetracking thread*/
sourcetrack_done = 1;