diff --git a/hal/audio_extn/passthru.c b/hal/audio_extn/passthru.c index 8acffda4..1ee0008d 100644 --- a/hal/audio_extn/passthru.c +++ b/hal/audio_extn/passthru.c @@ -69,6 +69,8 @@ static const int dts_transmission_sample_rates[] = { #define MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE (2 * 1024) +#define DDP_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE (10 * 1024) + static const audio_format_t audio_passthru_formats[] = { AUDIO_FORMAT_AC3, AUDIO_FORMAT_E_AC3, @@ -490,8 +492,14 @@ int audio_extn_passthru_get_buffer_size(audio_offload_info_t* info) (info->format == AUDIO_FORMAT_DTS_HD)) { fragment_size = MAX_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE; goto done; + } else if (info->format == AUDIO_FORMAT_E_AC3) { + fragment_size = DDP_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE; + if(property_get("audio.ddp.buffer.size.kb", value, "") && + atoi(value)) { + fragment_size = atoi(value) * 1024; + } + goto done; } - done: return fragment_size; diff --git a/hal/audio_extn/qaf.c b/hal/audio_extn/qaf.c index 9c57b2cb..ca83b1dd 100644 --- a/hal/audio_extn/qaf.c +++ b/hal/audio_extn/qaf.c @@ -2007,7 +2007,11 @@ static int qaf_stream_open(struct stream_out *out, input_config, devices, AUDIO_STREAM_SYSTEM_TONE); - qaf_mod->stream_in[QAF_IN_PCM] = out; + if (status == 0) { + qaf_mod->stream_in[QAF_IN_PCM] = out; + } else { + ERROR_MSG("System tone stream open failed with QAF module !!!"); + } } else if ((flags & AUDIO_OUTPUT_FLAG_MAIN) && (flags & AUDIO_OUTPUT_FLAG_ASSOCIATED)) { if (is_main_active(qaf_mod) || is_dual_main_active(qaf_mod)) { ERROR_MSG("Dual Main or Main already active. So, Cannot open main and associated stream");