qcom/audio/hal: Fix the issue audio not routed to headset
- Boot the phone without headset plugged in, plug in headset and
play music. Audio is heard on speaker instead of headset.
- The devices of output stream corresponding to music playback
is not being updated correctly.
- Fix by correcting the output device uption logic in
out_set_parameters()
Bug: 8239898
Change-Id: Ie24de09847533660d2280744d33cba7d7fb7d535
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 01118ff..7e9fc18 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1273,7 +1273,7 @@
out->devices = val;
}
stop_voice_call(adev);
- } else if ((adev->out_device != (audio_devices_t)val) && (val != 0)) {
+ } else if ((out->devices != (audio_devices_t)val) && (val != 0)) {
if (!out->standby || adev->in_call) {
adev->out_device = get_active_out_devices(adev, out->usecase) | val;
ret = select_devices(adev);