Fixed submix buffering when input and output stream formats differ.

When channel conversion is enabled and the pipe is opened with less channels
(e.g 1) than the output stream's channels (e.g 2) the input stream's buffer
size was calculated incorrectly which resulted in the input stream buffer size
being larger than the output stream buffer size in terms of time.  This
changes the pipe size to take into the account maximum frame size so the
output stream buffer size will be greater or equal to the input stream buffer
size.

In addition, if the pipe is created when the input stream is opened and the
output stream is opened at a different sample rate (e.g input = 8KHz,
output = 48Khz) the pipe will incorrectly rate limit writes to the pipe
resulting in gaps of silence in the data read from the pipe by the input
stream.

Bug: 15291446
Change-Id: I01480edff7ef3a199f509866c1e95ecd4c437a92
1 file changed