audio HAL: support multiple active input streams
Implement support for more than one active input streams.
New implementation is limited to one active stream per capture use
case as there is one PCM ALSA device per front end and use case.
Note that the number of active sound trigger sessions is limited by the
soundtrigger implementation, not the number of PCM ALSA devices.
We do not enforce a max number of open streams per use case as this is
done by the audio_polcy_configuration file.
Bug: 111438757
Test: manual audio smoke tests for capture.
Change-Id: I1a372bca154d1ee034526f2b6b3ddeeae93a71f2
(cherry picked from commit d1b7a9b6b516e3313d65560a4b8004cfa3ae9a19)
Signed-off-by: Aniket Kumar Lata <alata@codeaurora.org>
diff --git a/hal/platform_api.h b/hal/platform_api.h
index f43aa88..3125f63 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -178,7 +178,9 @@
int platform_get_sample_rate(void *platform, uint32_t *rate);
int platform_set_device_mute(void *platform, bool state, char *dir);
snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *out);
-snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_device);
+snd_device_t platform_get_input_snd_device(void *platform,
+ struct stream_in *in,
+ audio_devices_t out_device);
int platform_set_hdmi_channels(void *platform, int channel_count);
int platform_edid_get_max_channels(void *platform);
void platform_add_operator_specific_device(snd_device_t snd_device,
@@ -355,4 +357,7 @@
struct audio_custom_mtmx_params_info *info);
int platform_add_custom_mtmx_params(void *platform,
struct audio_custom_mtmx_params_info *info);
+/* callback functions from platform to common audio HAL */
+struct stream_in *adev_get_active_input(const struct audio_device *adev);
+
#endif // AUDIO_PLATFORM_API_H