summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Kumar Alamanda <ralama@codeaurora.org>2015-06-25 20:08:01 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-16 11:59:05 -0700
commit57f1042eaef497add4a78c3703653a88cd0a7f98 (patch)
tree9a652d0efe71d59a82aed3b2dbcad0a9ff702d61
parentcbd30414a123997a694d486a4b3cb5b3fc06e38f (diff)
downloadhardware_qcom_audio-57f1042eaef497add4a78c3703653a88cd0a7f98.tar.gz
hardware_qcom_audio-57f1042eaef497add4a78c3703653a88cd0a7f98.tar.bz2
hardware_qcom_audio-57f1042eaef497add4a78c3703653a88cd0a7f98.zip
hal: add support for ull audio playback
Add a new use case and mixer paths to support ultra low latency audio playback. This use case exercises the ULL mode in the DSP. CRs-Fixed: 892056 Change-Id: I6685dd0f346072029ca51e4ce92856a13e74ee76
-rw-r--r--hal/audio_hw.c8
-rw-r--r--hal/audio_hw.h1
-rw-r--r--hal/msm8974/platform.c5
-rw-r--r--hal/msm8974/platform.h1
4 files changed, 13 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 35d26618..86fe4a98 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -165,7 +165,8 @@ struct pcm_config pcm_config_afe_proxy_record = {
const char * const use_case_table[AUDIO_USECASE_MAX] = {
[USECASE_AUDIO_PLAYBACK_DEEP_BUFFER] = "deep-buffer-playback",
[USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = "low-latency-playback",
- [USECASE_AUDIO_PLAYBACK_MULTI_CH] = "multi-channel-playback",
+ [USECASE_AUDIO_PLAYBACK_ULL] = "audio-ull-playback",
+ [USECASE_AUDIO_PLAYBACK_MULTI_CH] = "multi-channel-playback",
[USECASE_AUDIO_PLAYBACK_OFFLOAD] = "compress-offload-playback",
#ifdef MULTIPLE_OFFLOAD_ENABLED
[USECASE_AUDIO_PLAYBACK_OFFLOAD2] = "compress-offload-playback2",
@@ -2980,6 +2981,10 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY;
out->config = pcm_config_afe_proxy_playback;
adev->voice_tx_output = out;
+ } else if (out->flags & AUDIO_OUTPUT_FLAG_RAW) {
+ out->usecase = USECASE_AUDIO_PLAYBACK_ULL;
+ out->config = pcm_config_low_latency;
+ out->sample_rate = out->config.rate;
} else if (out->flags & AUDIO_OUTPUT_FLAG_FAST) {
format = AUDIO_FORMAT_PCM_16_BIT;
out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY;
@@ -3611,6 +3616,7 @@ static int period_size_is_plausible_for_low_latency(int period_size)
{
switch (period_size) {
case 160:
+ case 192:
case 240:
case 320:
case 480:
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 4756c90e..20592622 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -94,6 +94,7 @@ enum {
USECASE_AUDIO_PLAYBACK_OFFLOAD8,
USECASE_AUDIO_PLAYBACK_OFFLOAD9,
#endif
+ USECASE_AUDIO_PLAYBACK_ULL,
USECASE_AUDIO_DIRECT_PCM_OFFLOAD,
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index cca4796a..b2fa577b 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -206,8 +206,10 @@ static int pcm_device_table[AUDIO_USECASE_MAX][2] = {
DEEP_BUFFER_PCM_DEVICE},
[USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = {LOWLATENCY_PCM_DEVICE,
LOWLATENCY_PCM_DEVICE},
+ [USECASE_AUDIO_PLAYBACK_ULL] = {MULTIMEDIA3_PCM_DEVICE,
+ MULTIMEDIA3_PCM_DEVICE},
[USECASE_AUDIO_PLAYBACK_MULTI_CH] = {MULTIMEDIA2_PCM_DEVICE,
- MULTIMEDIA2_PCM_DEVICE},
+ MULTIMEDIA2_PCM_DEVICE},
[USECASE_AUDIO_PLAYBACK_OFFLOAD] =
{PLAYBACK_OFFLOAD_DEVICE, PLAYBACK_OFFLOAD_DEVICE},
#ifdef MULTIPLE_OFFLOAD_ENABLED
@@ -568,6 +570,7 @@ static char * backend_table[SND_DEVICE_MAX] = {0};
static struct name_to_index usecase_name_index[AUDIO_USECASE_MAX] = {
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_DEEP_BUFFER)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_LOW_LATENCY)},
+ {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_ULL)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_MULTI_CH)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_OFFLOAD)},
#ifdef MULTIPLE_OFFLOAD_ENABLED
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index 006540ea..d6ba1ef1 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -205,6 +205,7 @@ enum {
#define AUDIO_RECORD_PCM_DEVICE 0
#define AUDIO_RECORD_3MIC_PCM_DEVICE 44
#define MULTIMEDIA2_PCM_DEVICE 1
+#define MULTIMEDIA3_PCM_DEVICE 4
#define FM_PLAYBACK_PCM_DEVICE 5
#define FM_CAPTURE_PCM_DEVICE 6
#define HFP_PCM_RX 5