diff options
author | Weiyin Jiang <wjiang@codeaurora.org> | 2020-11-09 14:08:59 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-11-09 01:15:01 -0800 |
commit | af20db9c2f9c9fe335b215122fcd258ab9c29eb6 (patch) | |
tree | 132ad17fa83d2211bc2774cd9e53ccbd5bb9bc6c | |
parent | ebda8eef02d5636e6c8964b0f5b71a30cbef715d (diff) |
audio: unmute non-offload streams when device switches
Non-offload streams are muted during a2dp suspend scenario, and they
won't be recovered until stream is stopped. When device switch happens,
these streams are still needed. To fix it, unmute non-offload streams
when device switch happens.
Change-Id: Iddbcc0b7a3891afb3b9e8c6078685f60cf041a9c
CRs-Fixed: 2813965
-rw-r--r-- | hal/audio_hw.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 4516448a..51658493 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1246,10 +1246,15 @@ int enable_audio_route(struct audio_device *adev, if (audio_extn_is_maxx_audio_enabled()) audio_extn_ma_set_device(usecase); audio_extn_utils_send_audio_calibration(adev, usecase); - if ((usecase->type == PCM_PLAYBACK) && is_offload_usecase(usecase->id)) { - out = usecase->stream.out; - if (out && out->compr) + if ((usecase->type == PCM_PLAYBACK) && + ((out = usecase->stream.out) != NULL)) { + if (!is_offload_usecase(out->usecase)) { + pthread_mutex_lock(&out->latch_lock); + out->muted = false; + pthread_mutex_unlock(&out->latch_lock); + } else if (out->compr) { audio_extn_utils_compress_set_clk_rec_mode(usecase); + } } if (usecase->type == PCM_CAPTURE) { |