From d6093c7f6c289bac7b8227959e9ef20da2bcfc8e Mon Sep 17 00:00:00 2001 From: "Vangala, Amarnath" Date: Tue, 7 Jul 2020 20:50:44 +0530 Subject: [PATCH] dsp: fix to race condition in voice call mute command handling. Apply the cached value of device mute setting to dsp, after voc state moves to RUN. Change-Id: I82bc9ab2d49a199f0277b1694cd00311eddd6115 Signed-off-by: Vangala, Amarnath --- dsp/q6voice.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dsp/q6voice.c b/dsp/q6voice.c index dbf038dfcfe2..c16ae81eaf84 100644 --- a/dsp/q6voice.c +++ b/dsp/q6voice.c @@ -7204,6 +7204,16 @@ int voc_enable_device(uint32_t session_id) goto done; } v->voc_state = VOC_RUN; + + if (v->lch_mode == 0) { + pr_debug("%s: dev_mute = %d, ramp_duration = %d ms\n", + __func__, v->dev_rx.dev_mute, + v->dev_rx.dev_mute_ramp_duration_ms); + ret = voice_send_device_mute_cmd(v, + VSS_IVOLUME_DIRECTION_RX, + v->dev_rx.dev_mute, + v->dev_rx.dev_mute_ramp_duration_ms); + } } else { pr_debug("%s: called in voc state=%d, No_OP\n", __func__, v->voc_state);