qcom/audio/hal: Fix audio routing to wired headset
- Start music playback and plug in headset within 3sec. The
audio is heard on both headset and speaker whereas it is
expected to play on headset.
- Fix the output device updation and selection logic to resolve
the issue.
Bug: 8239898
Change-Id: I476c9ede241e319c90cb960dd302384f41a6b52c
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 7a20a86..0c4f526 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -174,13 +174,17 @@
VOICE_CALL
} usecase_type_t;
-// To store active use cases.
+union stream_ptr {
+ struct stream_in *in;
+ struct stream_out *out;
+};
+
struct audio_usecase {
struct listnode list;
audio_usecase_t id;
usecase_type_t type;
audio_devices_t devices;
- struct audio_usecase *next;
+ union stream_ptr stream;
};
typedef void (*acdb_deallocate_t)();
@@ -204,6 +208,7 @@
audio_mode_t mode;
audio_devices_t out_device;
struct stream_in *active_input;
+ struct stream_out *primary_output;
int in_call;
float voice_volume;
bool mic_mute;