hal: add the stream to uc_info for speaker protection enablement
Stream was null causing data abort when speaker
protection is enabled. Set it to primary_output in case
of playback and set device in case of recording.
Change-Id: I4b532ad7d76adab75e1ef0719eaba197eb3d9379
diff --git a/hal/audio_extn/spkr_protection.c b/hal/audio_extn/spkr_protection.c
index e0f1a54..7ab65c6 100644
--- a/hal/audio_extn/spkr_protection.c
+++ b/hal/audio_extn/spkr_protection.c
@@ -300,6 +300,7 @@
uc_info_rx->id = USECASE_AUDIO_SPKR_CALIB_RX;
uc_info_rx->type = PCM_PLAYBACK;
uc_info_rx->in_snd_device = SND_DEVICE_NONE;
+ uc_info_rx->stream.out = adev->primary_output;
uc_info_rx->out_snd_device = SND_DEVICE_OUT_SPEAKER_PROTECTED;
disable_rx = true;
list_add_tail(&adev->usecase_list, &uc_info_rx->list);
@@ -327,7 +328,7 @@
calloc(1, sizeof(struct audio_usecase));
uc_info_tx->id = USECASE_AUDIO_SPKR_CALIB_TX;
uc_info_tx->type = PCM_CAPTURE;
- uc_info_tx->in_snd_device = SND_DEVICE_NONE;
+ uc_info_tx->in_snd_device = SND_DEVICE_IN_CAPTURE_VI_FEEDBACK;
uc_info_tx->out_snd_device = SND_DEVICE_NONE;
disable_tx = true;
@@ -711,7 +712,7 @@
if (handle.spkr_processing_state == SPKR_PROCESSING_IN_IDLE) {
uc_info_tx->id = USECASE_AUDIO_SPKR_CALIB_TX;
uc_info_tx->type = PCM_CAPTURE;
- uc_info_tx->in_snd_device = SND_DEVICE_NONE;
+ uc_info_tx->in_snd_device = SND_DEVICE_IN_CAPTURE_VI_FEEDBACK;
uc_info_tx->out_snd_device = SND_DEVICE_NONE;
handle.pcm_tx = NULL;
list_add_tail(&adev->usecase_list, &uc_info_tx->list);