audio: Legacy: Use pcm_update_avail for voice input frames

The pcm input stream is said to be "steady" when the ALSA buffer
has available frames to read.  However, the input stream could go
into the XRUN state when the voice thread takes too long between
explicitly starting the stream and querying the number of available
frames.  For the purpose of determining whether the input stream
is ready, the XRUN state means that the ALSA buffer is full and
the audio frames can be read immediately.

The number of available frames was previously queried using the
pcm_get_htimestamp() function which returns an error when the stream
is in overrun state and doesn't update the number of available frames.
The pcm_update_avail() function does return the amount of available
frames regardless of the stream state.

Change-Id: I3afbb6f3d274b5f4fbd7133e48d2cbe51c223ccc
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
1 file changed