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

Commit fa377bff authored by Deeraj Soman's avatar Deeraj Soman Committed by Gerrit - the friendly Code Review server
Browse files

hal: Add support for FAST FLAG in compress path

Add support for FAST FLAG in capture path.
Clients may request to open the compress session
in perf mode by passing the FAST FLAG.

Change-Id: I2b6cc50b0dd45aa6d6d78362392e4ee39dddd967
parent 65358ab2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1096,6 +1096,7 @@ int audio_extn_utils_compress_get_dsp_presentation_pos(struct stream_out *out,
int audio_extn_utils_pcm_get_dsp_presentation_pos(struct stream_out *out,
            uint64_t *frames, struct timespec *timestamp, int32_t clock_id);
size_t audio_extn_utils_get_input_buffer_size(uint32_t, audio_format_t, int, int64_t, bool);
int audio_extn_utils_get_perf_mode_flag(void);
#ifdef AUDIO_HW_LOOPBACK_ENABLED
/* API to create audio patch */
int audio_extn_hw_loopback_create_audio_patch(struct audio_hw_device *dev,
+5 −0
Original line number Diff line number Diff line
@@ -332,6 +332,11 @@ int cin_configure_input_stream(struct stream_in *in, struct audio_config *in_con
    else
        cin_data->compr_config.codec->compr_passthr = PASSTHROUGH_GEN;

    if (in->flags & AUDIO_INPUT_FLAG_FAST) {
        ALOGD("%s: Setting latency mode to true", __func__);
        cin_data->compr_config.codec->flags |= audio_extn_utils_get_perf_mode_flag();
    }

    if ((in->flags & AUDIO_INPUT_FLAG_TIMESTAMP) ||
        (in->flags & AUDIO_INPUT_FLAG_PASSTHROUGH)) {
        compress_config_set_timstamp_flag(&cin_data->compr_config);
+9 −0
Original line number Diff line number Diff line
@@ -2949,6 +2949,15 @@ int audio_extn_utils_is_vendor_enhanced_fwk()
    return is_running_with_enhanced_fwk;
}

int audio_extn_utils_get_perf_mode_flag(void)
{
#ifdef COMPRESSED_PERF_MODE_FLAG
    return COMPRESSED_PERF_MODE_FLAG;
#else
    return 0;
#endif
}

size_t audio_extn_utils_get_input_buffer_size(uint32_t sample_rate,
                                            audio_format_t format,
                                            int channel_count,
+7 −0
Original line number Diff line number Diff line
@@ -7380,6 +7380,11 @@ int adev_open_output_stream(struct audio_hw_device *dev,
            ALOGV("non-offload DIRECT_usecase ... usecase selected %d ", out->usecase);
        }

        if (out->flags & AUDIO_OUTPUT_FLAG_FAST) {
            ALOGD("%s: Setting latency mode to true", __func__);
            out->compr_config.codec->flags |= audio_extn_utils_get_perf_mode_flag();
        }

        if (out->usecase == USECASE_INVALID) {
            if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL &&
                    config->format == 0 && config->sample_rate == 0 &&
@@ -8713,6 +8718,8 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
    }

    if (config->sample_rate == LOW_LATENCY_CAPTURE_SAMPLE_RATE &&
            (flags & AUDIO_INPUT_FLAG_TIMESTAMP) == 0 &&
            (flags & AUDIO_INPUT_FLAG_COMPRESS) == 0 &&
            (flags & AUDIO_INPUT_FLAG_FAST) != 0) {
        is_low_latency = true;
#if LOW_LATENCY_CAPTURE_USE_CASE