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

Commit 7972d618 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: add timestamp mode support for offload playback streams"

parents 9ce576b2 ee3499a4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@
        <ctl name="MADONOFF Switch" value="1" />
        <ctl name="TX13 INP MUX" value="CPE_TX_PP" />
        <ctl name="AIF4_MAD Mixer SLIM TX13" value="1" />
        <ctl name="MAD Input" value="DMIC0" />
        <ctl name="MAD Input" value="DMIC2" />
        <ctl name="CPE AFE MAD Enable" value="1"/>
    </path>

@@ -111,14 +111,14 @@
        <ctl name="CLK MODE" value="INTERNAL" />
        <ctl name="EC BUF MUX INP" value="DEC1" />
        <ctl name="ADC MUX1" value="DMIC" />
        <ctl name="DMIC MUX1" value="DMIC0" />
        <ctl name="DMIC MUX1" value="DMIC2" />
    </path>

    <!-- path name used for low bandwidth FTRT codec interface -->
    <path name="listen-cpe-handset-mic low-speed-intf">
        <ctl name="MADONOFF Switch" value="1" />
        <ctl name="AIF4_MAD Mixer SLIM TX12" value="1" />
        <ctl name="MAD Input" value="DMIC0" />
        <ctl name="MAD Input" value="DMIC2" />
        <ctl name="CPE AFE MAD Enable" value="1"/>
    </path>

@@ -126,7 +126,7 @@
        <ctl name="MAD_BROADCAST Switch" value="1" />
        <ctl name="TX13 INP MUX" value="MAD_BRDCST" />
        <ctl name="AIF4_MAD Mixer SLIM TX13" value="1" />
        <ctl name="MAD Input" value="DMIC0" />
        <ctl name="MAD Input" value="DMIC2" />
    </path>

</mixer>
+4 −4
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@
    </path>

    <path name="listen-cpe-handset-mic">
        <ctl name="MAD Input" value="DMIC0" />
        <ctl name="MAD Input" value="DMIC2" />
        <ctl name="MAD_SEL MUX" value="SPE" />
        <ctl name="MAD_INP MUX" value="MAD" />
        <ctl name="MAD_CPE1 Switch" value="1" />
@@ -181,19 +181,19 @@
        <ctl name="CLK MODE" value="INTERNAL" />
        <ctl name="EC BUF MUX INP" value="DEC1" />
        <ctl name="ADC MUX1" value="DMIC" />
        <ctl name="DMIC MUX1" value="DMIC0" />
        <ctl name="DMIC MUX1" value="DMIC2" />
    </path>

    <!-- path name used for low bandwidth FTRT codec interface -->
    <path name="listen-cpe-handset-mic low-speed-intf">
        <ctl name="MADONOFF Switch" value="1" />
        <ctl name="AIF4_MAD Mixer SLIM TX12" value="1" />
        <ctl name="MAD Input" value="DMIC0" />
        <ctl name="MAD Input" value="DMIC2" />
        <ctl name="CPE AFE MAD Enable" value="1"/>
    </path>

    <path name="listen-ape-handset-mic">
        <ctl name="MAD Input" value="DMIC0" />
        <ctl name="MAD Input" value="DMIC2" />
        <ctl name="MAD_SEL MUX" value="MSM" />
        <ctl name="MAD_INP MUX" value="MAD" />
        <ctl name="MAD_BROADCAST Switch" value="1" />
+1 −0
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ const struct string_to_enum s_flag_name_to_enum_table[] = {
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_INCALL_MUSIC),
#endif
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH),
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_TIMESTAMP),
    STRING_TO_ENUM(AUDIO_INPUT_FLAG_NONE),
    STRING_TO_ENUM(AUDIO_INPUT_FLAG_FAST),
    STRING_TO_ENUM(AUDIO_INPUT_FLAG_HW_HOTWORD),
+14 −3
Original line number Diff line number Diff line
@@ -2579,9 +2579,12 @@ static size_t out_get_buffer_size(const struct audio_stream *stream)
{
    struct stream_out *out = (struct stream_out *)stream;

    if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)
    if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
        if (out->flags & AUDIO_OUTPUT_FLAG_TIMESTAMP)
            return out->compr_config.fragment_size - sizeof(struct snd_codec_metadata);
        else
            return out->compr_config.fragment_size;
    else if(out->usecase == USECASE_COMPRESS_VOIP_CALL)
    } else if(out->usecase == USECASE_COMPRESS_VOIP_CALL)
        return voice_extn_compress_voip_out_get_buffer_size(out);
    else if (is_offload_usecase(out->usecase) &&
             out->flags == AUDIO_OUTPUT_FLAG_DIRECT)
@@ -4097,6 +4100,11 @@ int adev_open_output_stream(struct audio_hw_device *dev,
         */
        if (!audio_extn_passthru_is_passthrough_stream(out))
            out->bit_width = AUDIO_OUTPUT_BIT_WIDTH;

        if (out->flags & AUDIO_OUTPUT_FLAG_TIMESTAMP)
            out->compr_config.codec->flags |= COMPRESSED_TIMESTAMP_FLAG;
        ALOGVV("%s : out->compr_config.codec->flags -> (%#x) ", __func__, out->compr_config.codec->flags);

        /*TODO: Do we need to change it for passthrough */
        out->compr_config.codec->format = SND_AUDIOSTREAMFORMAT_RAW;

@@ -4159,6 +4167,9 @@ int adev_open_output_stream(struct audio_hw_device *dev,
            out->compr_config.fragments = COMPRESS_OFFLOAD_NUM_FRAGMENTS;
        }

        if (out->flags & AUDIO_OUTPUT_FLAG_TIMESTAMP) {
            out->compr_config.fragment_size += sizeof(struct snd_codec_metadata);
        }
        if (config->offload_info.format == AUDIO_FORMAT_FLAC)
            out->compr_config.codec->options.flac_dec.sample_size = AUDIO_OUTPUT_BIT_WIDTH;

+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ struct stream_out {
    struct audio_out_start_delay_param delay_param; /*start delay*/

    audio_offload_info_t info;
    qahwi_stream_out_t qahwi_out;
};

struct stream_in {
Loading