I don't know what possibilities were available back in 2016 when this question was first posted, but today I managed to get multi-channel audio working on my Android 12 TvOS tvbox with a USB 7.1 channel external soundcard.
I used the docs from https://source.android.com/docs/core/audio/implement-policy and edited /vendor/etc/usb_audio_policy_configuration.xml
to add a multi-channel output to the config. (As shipped, the config only supported stereo.) I basically copied some info from the HDMI policy. Here's a diff showing what I changed. Note that you'd need root access to make these changes on your box.
--- /tmp/usb0.xml 2023-04-04 08:53:35.572497487 +0100
+++ /tmp/usb1.xml 2023-04-04 09:18:15.012439753 +0100
@@ -21,6 +15,11 @@
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
+ <mixPort name="usb_multi output" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="44100 48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
+ </mixPort>
<mixPort name="usb_device output" role="source"/>
<mixPort name="usb_device input" role="sink"/>
</mixPorts>
@@ -38,7 +37,7 @@
<route type="mix" sink="USB Host Out"
sources="usb_accessory output"/>
<route type="mix" sink="USB Device Out"
- sources="usb_device output"/>
+ sources="usb_device output,usb_multi output"/>
<route type="mix" sink="USB Headset Out"
sources="usb_device output"/>
<route type="mix" sink="usb_device input"
For reference: I have an H96 Max V58 tvbox, and used this StarTech USB soundcard. https://www.startech.com/en-us/cards-adapters/icusbaudio7d
Also note: this soundcard also has SPDIF input and output. The SPDIF out carries the front left/right channels too, same as the analog output. That turns out to work perfectly for my purpose. I'm using Edifier S350DB for my front speakers; this is an active speaker set with 2 bookshelf speakers and a subwoofer and I'm using TOSlink optical cable for the connection. My original setup was
(back of room) (front of room)
Projector
|
HDMI
|
TVbox ---> SPDIF -> front speakers
Now it's
(back of room) (front of room)
Projector
|
HDMI
|
TVbox
|
USB ---> SPDIF -> front speakers
|
RCA -> rear speaker amp
I added a simple stereo amp and pair of passive bookshelf speakers for the rear surround channels, and use this with Kodi (version 20) set to use a 4.0 speaker configuration. In 4.0, the rear channels are actually coming out the output labeled "center/sub" on the StarTech box.