I use Gotham and was looking for this. My setup is XBMC on a Asus ION-thingy, and I wanted to use HDMI + USB DAC to output sound.
And this is the thread which made it possible for me to get that. Well, I did some modifications because I wanted ALSA to output to both cards and also passthrough to my surround amplifier via HDMI.
So, what are the modifications? Firstly I made so that the DAC has only two channels in the config file, I don't want to downsample to stereo as I am anyway never going to play surround sound on the DAC anyway. Else I skipped the "advancedguisettings.xml"-file inputs and the idea of setting the bitrate to "Fixed", I left it to "Optimized" so I can enjoy passthrough mode to my receiver via HDMI.
Now, when passthough is enabled (like getting sound from dolby or dts), the DAC won't get any input, which is fine by me as I only want it to work for stereo sounds (NB! Dolby (and DTS?) encoded stereo still does passthrough, and will not give sounds to the DAC. However I mainly use this for music, and that is encoded in MP3 or FLAC or any other codecs which is not Dolby or DTS).
I also made a "hint" in the file, so it's showing a little nicer name in XBMC Audio settings.
Note! I only use this file and choose "HDMI Surround 5.1 + DAC Stereo" from XBMC Audio settings, nothing else. It has only been tested with Gotham stable.
Code:
pcm.!default {
type plug
slave {
pcm "both_digital"
}
hint {
show on
description "HDMI Surround 5.1 + DAC Stereo"
}
}
# First we create a 'both' route, that has 8 channels
pcm.both_digital {
type route
slave {
pcm multi
channels 8
}
# And we route the channels 1:1
# 6 inputs (0-5) get mapped into 2 outputs (0-7)
# (this is how we copy channels)
ttable.0.0 1.0
ttable.1.1 1.0
ttable.2.2 1.0
ttable.3.3 1.0
ttable.4.4 1.0
ttable.5.5 1.0
ttable.0.6 1.0
ttable.1.7 1.0
}
# Then define a multi device that splits the 8-channel input
# Into 6/2 output
pcm.multi {
type multi
slaves.a {
pcm "hdmi_hw"
channels 6
}
slaves.b {
# dac usb has 2 channels
pcm "dac_hw"
channels 2
}
# Bind stuff to the HDMI outputs
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave a
bindings.1.channel 1
bindings.2.slave a
bindings.2.channel 2
bindings.3.slave a
bindings.3.channel 3
bindings.4.slave a
bindings.4.channel 4
bindings.5.slave a
bindings.5.channel 5
# And to the DAC outputs
bindings.6.slave b
bindings.6.channel 0
bindings.7.slave b
bindings.7.channel 1
}
# And here is my actual hardware
# Note that this is linked to the output of 'aplay -l'
# HDMI output
pcm.hdmi_hw {
type hw
card 2
device 7
channels 6
}
# Stereo output
pcm.dac_hw {
type hw
card 1
device 0
channels 2
}