hal: fix wrong VOIP volume during device switch
During device switch, when voip playback and lower-latency
are currently active handset, and out_set_parameters(speaker)
is received on low-latency output, then voip playback is also
switched to speaker. But previous volume is not applied even
if voip playback have routed new backend.
Fix this by setting cached volume after voip route to new
backend.
CRs-Fixed: 2209054
Change-Id: I60bf6a14a3a3fc2d97e9eaff390da0c95824f1db
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 9ebe142..2261e2f 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1423,6 +1423,11 @@
usecase->out_snd_device,
platform_get_input_snd_device(adev->platform, uc_info->devices));
enable_audio_route(adev, usecase);
+ if (usecase->id == USECASE_AUDIO_PLAYBACK_VOIP) {
+ out_set_voip_volume(&usecase->stream.out->stream,
+ usecase->stream.out->volume_l,
+ usecase->stream.out->volume_r);
+ }
if (usecase->id == USECASE_AUDIO_PLAYBACK_FM) {
struct str_parms *parms = str_parms_create_str("fm_restore_volume=1");
if (parms)