summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexy Joseph <alexyj@codeaurora.org>2015-03-03 19:01:03 -0800
committerSteve Kondik <steve@cyngn.com>2015-03-25 22:37:55 -0700
commit9b812d7621284975edf22aabf583e286ad09d696 (patch)
tree1f1a5d7547aec3e3b8193d9281ea81b0790ba802
parentd29667b205f2c5497a60ebda209ec84648d797da (diff)
downloadandroid_hardware_qcom_audio-stable/cm-12.1-caf-8916-YOG3C.tar.gz
android_hardware_qcom_audio-stable/cm-12.1-caf-8916-YOG3C.tar.bz2
android_hardware_qcom_audio-stable/cm-12.1-caf-8916-YOG3C.zip
hal: Reduce offload latency and log spamstable/cm-12.1-caf-8916-YOG3C
Offload latency is set to 96. Change it to 50 to reflect the rendering latency more correctly Modify pcm offload latency to return offload latency rather than the latency based on buffering since volume is applied immediately for offload use cases. Also reduce log spam in offload use cases Change-Id: If28d49d66e8f989074c4c7eaec523855e9f4290a CRs-Fixed: 787448
-rw-r--r--hal/audio_hw.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 281d9d74..f9fc7105 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -58,7 +58,7 @@
#define COMPRESS_OFFLOAD_NUM_FRAGMENTS 4
/* ToDo: Check and update a proper value in msec */
-#define COMPRESS_OFFLOAD_PLAYBACK_LATENCY 96
+#define COMPRESS_OFFLOAD_PLAYBACK_LATENCY 50
#define COMPRESS_PLAYBACK_VOLUME_MAX 0x2000
#define PROXY_OPEN_RETRY_COUNT 100
@@ -1901,13 +1901,7 @@ static uint32_t out_get_latency(const struct audio_stream_out *stream)
uint32_t latency = 0;
if (is_offload_usecase(out->usecase)) {
- if (out->use_small_bufs == true)
- latency = ((out->compr_config.fragments *
- out->compr_config.fragment_size * 1000) /
- (out->sample_rate * out->compr_config.codec->ch_in *
- audio_bytes_per_sample(out->format)));
- else
- latency = COMPRESS_OFFLOAD_PLAYBACK_LATENCY;
+ latency = COMPRESS_OFFLOAD_PLAYBACK_LATENCY;
} else {
latency = (out->config.period_count * out->config.period_size * 1000) /
(out->config.rate);
@@ -1990,7 +1984,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
}
if (is_offload_usecase(out->usecase)) {
- ALOGD("copl(%p): writing buffer (%zu bytes) to compress device", out, bytes);
+ ALOGVV("copl(%p): writing buffer (%zu bytes) to compress device", out, bytes);
if (out->send_new_metadata) {
ALOGD("copl(%p):send new gapless metadata", out);
compress_set_gapless_metadata(out->compr, &out->gapless_mdata);