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

Commit d5144f14 authored by Mingming Yin's avatar Mingming Yin
Browse files

hal: compilation fix for extended feature flags

- Fix compilation error for offload, Dolby,
  HDMI pass through, FLAC decoder, and hardware
  accelerated effects when extended feature
  flags are disabled.

Change-Id: If64d5fa5d124b42d40d7e123b887db8e0a5d7426
parent 3c159b1d
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,9 @@
#define AUDIO_FORMAT_PCM_24_BIT_OFFLOAD (AUDIO_FORMAT_PCM_OFFLOAD | AUDIO_FORMAT_PCM_SUB_8_24_BIT)
#define AUDIO_FORMAT_PCM_24_BIT_OFFLOAD (AUDIO_FORMAT_PCM_OFFLOAD | AUDIO_FORMAT_PCM_SUB_8_24_BIT)
#define AUDIO_OFFLOAD_CODEC_FORMAT  "music_offload_codec_format"
#define AUDIO_OFFLOAD_CODEC_FORMAT  "music_offload_codec_format"
#define audio_is_offload_pcm(format) (0)
#define audio_is_offload_pcm(format) (0)
#define OFFLOAD_USE_SMALL_BUFFER false
#else
#define OFFLOAD_USE_SMALL_BUFFER (info->use_small_bufs)
#endif
#endif


#ifndef AFE_PROXY_ENABLED
#ifndef AFE_PROXY_ENABLED
@@ -298,6 +301,9 @@ void audio_extn_check_and_set_dts_hpx_state(const struct audio_device *adev);
void audio_extn_dolby_set_dmid(struct audio_device *adev);
void audio_extn_dolby_set_dmid(struct audio_device *adev);
#else
#else
#define audio_extn_dolby_set_dmid(adev)                 (0)
#define audio_extn_dolby_set_dmid(adev)                 (0)
#define AUDIO_CHANNEL_OUT_PENTA (AUDIO_CHANNEL_OUT_QUAD | AUDIO_CHANNEL_OUT_FRONT_CENTER)
#define AUDIO_CHANNEL_OUT_SURROUND (AUDIO_CHANNEL_OUT_FRONT_LEFT | AUDIO_CHANNEL_OUT_FRONT_RIGHT | \
                                    AUDIO_CHANNEL_OUT_FRONT_CENTER | AUDIO_CHANNEL_OUT_BACK_CENTER)
#endif
#endif




+7 −2
Original line number Original line Diff line number Diff line
@@ -71,7 +71,9 @@ const struct string_to_enum s_flag_name_to_enum_table[] = {
#ifdef COMPRESS_VOIP_ENABLED
#ifdef COMPRESS_VOIP_ENABLED
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_VOIP_RX),
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_VOIP_RX),
#endif
#endif
#ifdef HDMI_PASSTHROUGH_ENABLED
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH),
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH),
#endif
};
};


const struct string_to_enum s_format_name_to_enum_table[] = {
const struct string_to_enum s_format_name_to_enum_table[] = {
@@ -565,8 +567,11 @@ int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase)
    app_type_cfg[len++] = out->app_type_cfg.app_type;
    app_type_cfg[len++] = out->app_type_cfg.app_type;
    app_type_cfg[len++] = acdb_dev_id;
    app_type_cfg[len++] = acdb_dev_id;
    if (((out->format == AUDIO_FORMAT_E_AC3) ||
    if (((out->format == AUDIO_FORMAT_E_AC3) ||
        (out->format == AUDIO_FORMAT_E_AC3_JOC)) &&
        (out->format == AUDIO_FORMAT_E_AC3_JOC))
        (out->flags  & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH))
#ifdef HDMI_PASSTHROUGH_ENABLED
        &&(out->flags  & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)
#endif
        )
        app_type_cfg[len++] = sample_rate * 4;
        app_type_cfg[len++] = sample_rate * 4;
    else
    else
        app_type_cfg[len++] = sample_rate;
        app_type_cfg[len++] = sample_rate;
+8 −2
Original line number Original line Diff line number Diff line
@@ -1742,8 +1742,10 @@ static int parse_compress_metadata(struct stream_out *out, struct str_parms *par
    struct compr_gapless_mdata tmp_mdata;
    struct compr_gapless_mdata tmp_mdata;
    tmp_mdata.encoder_delay = 0;
    tmp_mdata.encoder_delay = 0;
    tmp_mdata.encoder_padding = 0;
    tmp_mdata.encoder_padding = 0;
#ifdef QTI_FLAC_DECODER
    tmp_mdata.min_blk_size = 0;
    tmp_mdata.min_blk_size = 0;
    tmp_mdata.max_blk_size = 0;
    tmp_mdata.max_blk_size = 0;
#endif


    if (!out || !parms) {
    if (!out || !parms) {
        ALOGE("%s: return invalid ",__func__);
        ALOGE("%s: return invalid ",__func__);
@@ -1762,13 +1764,17 @@ static int parse_compress_metadata(struct stream_out *out, struct str_parms *par
    if (out->format == AUDIO_FORMAT_FLAC) {
    if (out->format == AUDIO_FORMAT_FLAC) {
        ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_FLAC_MIN_BLK_SIZE, value, sizeof(value));
        ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_FLAC_MIN_BLK_SIZE, value, sizeof(value));
        if (ret >= 0) {
        if (ret >= 0) {
#ifdef QTI_FLAC_DECODER
            tmp_mdata.min_blk_size =
            tmp_mdata.min_blk_size =
#endif
            out->compr_config.codec->options.flac_dec.min_blk_size = atoi(value);
            out->compr_config.codec->options.flac_dec.min_blk_size = atoi(value);
            out->send_new_metadata = 1;
            out->send_new_metadata = 1;
        }
        }
        ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_FLAC_MAX_BLK_SIZE, value, sizeof(value));
        ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_FLAC_MAX_BLK_SIZE, value, sizeof(value));
        if (ret >= 0) {
        if (ret >= 0) {
#ifdef QTI_FLAC_DECODER
            tmp_mdata.max_blk_size =
            tmp_mdata.max_blk_size =
#endif
            out->compr_config.codec->options.flac_dec.max_blk_size = atoi(value);
            out->compr_config.codec->options.flac_dec.max_blk_size = atoi(value);
            out->send_new_metadata = 1;
            out->send_new_metadata = 1;
        }
        }
@@ -2867,7 +2873,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        if (flags & AUDIO_OUTPUT_FLAG_NON_BLOCKING)
        if (flags & AUDIO_OUTPUT_FLAG_NON_BLOCKING)
            out->non_blocking = 1;
            out->non_blocking = 1;


        if (config->offload_info.use_small_bufs) {
        if (platform_use_small_buffer(&config->offload_info)) {
            //this flag is set from framework only if its for PCM formats
            //this flag is set from framework only if its for PCM formats
            //no need to check for PCM format again
            //no need to check for PCM format again
            out->non_blocking = 0;
            out->non_blocking = 0;
+5 −0
Original line number Original line Diff line number Diff line
@@ -2583,6 +2583,11 @@ uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info)
    return fragment_size;
    return fragment_size;
}
}


bool platform_use_small_buffer(audio_offload_info_t* info)
{
    return OFFLOAD_USE_SMALL_BUFFER;
}

void platform_get_device_to_be_id_map(int **device_to_be_id, int *length)
void platform_get_device_to_be_id_map(int **device_to_be_id, int *length)
{
{
     *device_to_be_id = msm_device_to_be_id;
     *device_to_be_id = msm_device_to_be_id;
+5 −0
Original line number Original line Diff line number Diff line
@@ -1090,6 +1090,11 @@ uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info __unuse
    return 0;
    return 0;
}
}


bool platform_use_small_buffer(audio_offload_info_t* info)
{
    return false;
}

int platform_get_edid_info(void *platform __unused)
int platform_get_edid_info(void *platform __unused)
{
{
   return -ENOSYS;
   return -ENOSYS;
Loading