Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99273aa5 authored by Sharad Sangle's avatar Sharad Sangle Committed by Gerrit - the friendly Code Review server
Browse files

hal: add support for aptx adaptive encoder mode

 The change add support for sending APTx Adaptive
 encoder mode, High Quality or Low Latency to LPASS.

 Update latency for APTx Adaptive format, BT IPC
 will return the latency according to current mode
 the encoder is working in.

CRs-Fixed: 2272312
Change-Id: Iab4e5b43ac7a0385444aa22c88f01ee72e45055d
parent 1921622b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -418,6 +418,7 @@ struct aptx_ad_enc_cfg_ext_t
    uint32_t  max_sink_modeB;
    uint32_t  min_sink_modeC;
    uint32_t  max_sink_modeC;
    uint32_t  mode;
} __attribute__ ((packed));

struct aptx_ad_enc_cfg_t
@@ -491,6 +492,7 @@ typedef struct {
    uint8_t  TTP_modeB_low;
    uint8_t  TTP_modeB_high;
    uint32_t bits_per_sample;
    uint16_t  encoder_mode;
} audio_aptx_ad_config;

typedef struct {
@@ -1151,6 +1153,7 @@ static int update_aptx_ad_dsp_config(struct aptx_ad_enc_cfg_t *aptx_dsp_cfg,
    aptx_dsp_cfg->aptx_ad_cfg.max_sink_modeB = aptx_bt_cfg->ad_cfg->max_sink_modeB;
    aptx_dsp_cfg->aptx_ad_cfg.min_sink_modeC = aptx_bt_cfg->ad_cfg->min_sink_modeC;
    aptx_dsp_cfg->aptx_ad_cfg.max_sink_modeC = aptx_bt_cfg->ad_cfg->max_sink_modeC;
    aptx_dsp_cfg->aptx_ad_cfg.mode = aptx_bt_cfg->ad_cfg->encoder_mode;
    aptx_dsp_cfg->abr_cfg.imc_info.direction = IMC_RECEIVE;
    aptx_dsp_cfg->abr_cfg.imc_info.enable = IMC_ENABLE;
    aptx_dsp_cfg->abr_cfg.imc_info.purpose = IMC_PURPOSE_ID_BT_INFO;
@@ -2049,6 +2052,8 @@ uint32_t audio_extn_a2dp_get_encoder_latency()
            latency = (avsync_runtime_prop > 0) ? ldac_offset : ENCODER_LATENCY_LDAC;
            latency += (slatency <= 0) ? DEFAULT_SINK_LATENCY_LDAC : slatency;
            break;
        case ENC_CODEC_TYPE_APTX_AD: // for aptx adaptive the latency depends on the mode (HQ/LL) and
            latency = slatency;      // BT IPC will take care of accomodating the mode factor and return latency
        default:
            latency = 200;
            break;