diff options
author | Archit Bhutani <abhuta@codeaurora.org> | 2014-09-15 11:25:26 -0700 |
---|---|---|
committer | Archit Bhutani <abhuta@codeaurora.org> | 2014-09-15 14:21:13 -0700 |
commit | 3423c739d33b08447e8b99e5d077d9acb584b0f2 (patch) | |
tree | c906fb251bb062b6b089d0cada43258527641d31 | |
parent | 5a7092aa0d22d1d135869dbc57ab0b05a7f91897 (diff) | |
parent | e86be2a4aa8ddb043cd66f4becd1398759451da1 (diff) | |
download | android_hardware_qcom_audio-3423c739d33b08447e8b99e5d077d9acb584b0f2.tar.gz android_hardware_qcom_audio-3423c739d33b08447e8b99e5d077d9acb584b0f2.tar.bz2 android_hardware_qcom_audio-3423c739d33b08447e8b99e5d077d9acb584b0f2.zip |
Merge tag 'AU_LINUX_ANDROID_LNX.LA.3.6.04.04.04.062.207' into HEAD
AU_LINUX_ANDROID_LNX.LA.3.6.04.04.04.062.207 based on quic/aosp/LNX.LA.3.6
Change-Id: I1c5e883f258ae1a9209ed76e22e54548713aa8cf
-rw-r--r-- | hal/msm8974/platform.c | 12 | ||||
-rw-r--r-- | policy_hal/AudioPolicyManager.cpp | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c index 653a7682..010002b5 100644 --- a/hal/msm8974/platform.c +++ b/hal/msm8974/platform.c @@ -67,6 +67,7 @@ */ #define MAX_PCM_OFFLOAD_FRAGMENT_SIZE (240 * 1024) #define MIN_PCM_OFFLOAD_FRAGMENT_SIZE (4 * 1024) +#define PCM_OFFLOAD_SMALL_BUFFER_DURATION 20 /* 20 msec */ /* * Offload buffer size for compress passthrough @@ -2027,6 +2028,17 @@ uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info) atoi(value)) { ALOGV("Track offload Fragment size set by property to %dkb", atoi(value)); fragment_size = atoi(value) * 1024; + } else if (info->use_small_bufs) { + fragment_size = (PCM_OFFLOAD_SMALL_BUFFER_DURATION + * info->sample_rate + * audio_bytes_per_sample(info->format) + * popcount(info->channel_mask))/1000; + ALOGV("%s: fragment size for small buffer mode = %d" + "sample_rate=%d bytes_per_sample=%d channel_count=%d\n", + __func__, fragment_size, + info->sample_rate, + audio_bytes_per_sample(info->format), + popcount(info->channel_mask)); } else { fragment_size = MIN_PCM_OFFLOAD_FRAGMENT_SIZE; } diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp index 03599960..983a7307 100644 --- a/policy_hal/AudioPolicyManager.cpp +++ b/policy_hal/AudioPolicyManager.cpp @@ -2350,14 +2350,14 @@ audio_io_handle_t AudioPolicyManager::getPassthroughOutput( // output. This is required if client sets passthrough flag directly. bool shouldReturnError = false; + if (flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH) + shouldReturnError = true; + if (!isHDMIPassthroughEnabled()) { ALOGV("getPassthroughOutput: passthrough not enabled"); goto noPassthrough; } - if (flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH) - shouldReturnError = true; - // Passthrough used for dolby formats and if device is HDMI if ((format == AUDIO_FORMAT_EAC3 || format == AUDIO_FORMAT_AC3 || format == AUDIO_FORMAT_E_AC3_JOC) && |