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

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

Merge "audio: adjust latency for pcm offload stream"

parents 24d1f3b0 c49a3b50
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2014 The Android Open Source Project
@@ -102,6 +102,9 @@

/* ToDo: Check and update a proper value in msec */
#define COMPRESS_OFFLOAD_PLAYBACK_LATENCY  50
#define PCM_OFFLOAD_PLAYBACK_DSP_PATHDELAY 62
#define PCM_OFFLOAD_PLAYBACK_LATENCY \
    (PCM_OFFLOAD_BUFFER_DURATION + PCM_OFFLOAD_PLAYBACK_DSP_PATHDELAY)

#ifndef MAX_CHANNELS_SUPPORTED
#define MAX_CHANNELS_SUPPORTED 8
@@ -1806,6 +1809,12 @@ int audio_extn_utils_compress_get_dsp_latency(struct stream_out *out)
    struct snd_compr_metadata metadata;
    int delay_ms = COMPRESS_OFFLOAD_PLAYBACK_LATENCY;

    /* override the latency for pcm offload use case */
    if ((out->flags & AUDIO_OUTPUT_FLAG_DIRECT) &&
        !(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) {
        delay_ms = PCM_OFFLOAD_PLAYBACK_LATENCY;
    }

    if (property_get_bool("vendor.audio.playback.dsp.pathdelay", false)) {
        ALOGD("%s:: Quering DSP delay %d",__func__, __LINE__);
        if (!(is_offload_usecase(out->usecase))) {