CRAS: fmt_conv: Support quad to 5.1 channel conversion

Add the logic to convert quad output to 5.1 surround by
copying the {front,rear} {left,right} of input to the {front,rear}
{left,right} of output respectively and fill others with zero.

BUG=b:183070810
TEST=1. `sox -n -c6 -b 16 -r 48000 /tmp/zero.raw synth 300 sine 0`
     2. `sox -n -c4 -b 16 -r 48000 /tmp/sine.raw synth 30 sine 300\
         sin 400 sin 500 sin 600`
     3. `cras_test_client -c6 -P /tmp/zero.raw`
     4. `cras_test_client -c4 -P /tmp/sine.raw` at the same time.
     5. Verified that each of the 4 chanel are are output with the
         correct tone with a 6 channel audio device.
TEST=`FEATURES=test USE=asan emerge-${BOARD} adhd`

Change-Id: I12784c3ff38da1d30994d0711ce0630e009775a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/2771463
Commit-Queue: Judy Hsiao <judyhsiao@chromium.org>
Commit-Queue: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Tested-by: Judy Hsiao <judyhsiao@chromium.org>
Auto-Submit: Judy Hsiao <judyhsiao@chromium.org>
Reviewed-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
4 files changed