hal: initialize value of stop_threshold for VoIP
The value of stop_threshold for VoIP is not initialized,
then it will be set to default value equals to frames
counts during pcm_open. If all frames are rendered out,
then it can trigger XRUN and stop VoIP stream. When the
stream is restarted, path configuration would fail and
cause RX mute.
Fix by initializing stop_threshold and avail_min value
to INT_MAX and default period_size for VoIP.
CRs-Fixed: 2130594
Change-Id: I141643b8fd653c4c4b27f9812b8f6a2f96b98bc0
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 3ba3f77..62aa146 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -115,6 +115,8 @@
.period_size = VOIP_IO_BUF_SIZE(DEFAULT_VOIP_SAMP_RATE, DEFAULT_VOIP_BUF_DURATION_MS, DEFAULT_VOIP_BIT_DEPTH_BYTE)/2,
.period_count = 2,
.format = PCM_FORMAT_S16_LE,
+ .avail_min = VOIP_IO_BUF_SIZE(DEFAULT_VOIP_SAMP_RATE, DEFAULT_VOIP_BUF_DURATION_MS, DEFAULT_VOIP_BIT_DEPTH_BYTE)/2,
+ .stop_threshold = INT_MAX,
};
#define MIN_CHANNEL_COUNT 1