From 9dce5048342869b93d17b9fefc1641e2844f0c9f Mon Sep 17 00:00:00 2001 From: Aniket Kumar Lata Date: Thu, 16 Aug 2018 16:23:46 -0700 Subject: [PATCH] dsp: Do not send ABR parameters if bitrate is fixed ABR encoder config parameters should be sent to DSP only when ABR is enabled. Do not send these parameters for fixed bitrate. Change-Id: Icf7e4feef65d01c8ae3f6c6123d490cadef46c97 Signed-off-by: Aniket Kumar Lata --- dsp/q6afe.c | 4 +++- include/dsp/apr_audio-v2.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dsp/q6afe.c b/dsp/q6afe.c index 9eb8599c3e49..353df6a904c4 100644 --- a/dsp/q6afe.c +++ b/dsp/q6afe.c @@ -3735,7 +3735,9 @@ static int q6afe_send_enc_config(u16 port_id, goto exit; } - if (format == ASM_MEDIA_FMT_LDAC || format == ASM_MEDIA_FMT_APTX_ADAPTIVE) { + if ((format == ASM_MEDIA_FMT_LDAC && + cfg->ldac_config.abr_config.is_abr_enabled) || + format == ASM_MEDIA_FMT_APTX_ADAPTIVE) { pr_debug("%s:sending AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP to DSP payload", __func__); param_hdr.param_id = AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP; diff --git a/include/dsp/apr_audio-v2.h b/include/dsp/apr_audio-v2.h index e4f0c3bf7943..134281936992 100644 --- a/include/dsp/apr_audio-v2.h +++ b/include/dsp/apr_audio-v2.h @@ -3522,6 +3522,10 @@ struct afe_abr_enc_cfg_t { * Information to set up IMC between decoder and encoder. */ struct afe_imc_dec_enc_info imc_info; + /* + * Flag to indicate whether ABR is enabled. + */ + bool is_abr_enabled; } __packed; #define AFE_PARAM_ID_APTX_SYNC_MODE 0x00013205