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.

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
Commit-Queue: Judy Hsiao <>
Commit-Queue: Yu-Hsuan Hsu <>
Tested-by: Judy Hsiao <>
Auto-Submit: Judy Hsiao <>
Reviewed-by: Yu-Hsuan Hsu <>
4 files changed