2013-06-04, 06:04
Anyone have a suggestion to get hdmi and optical to output surround at the same time? Would this work? Or would I have to convert the audio to be able to output 6 channels via spdif? I'm assuming I could streamline this a lot more, but if I do need to convert the audio, this should get me started in the correct direction.
Thanks!
-Erik
Code:
# asound.conf for Dual Audio - HDMI (5.1) + Optical out (5.1)
# by puntloos
# This should allow you to send audio to two devices, one HDMI (for surround) and one optical
# 1- Location of asound.conf in OpenELEC is ./storage/.config/asound.conf - create or modify that file.
# 2- Modify the bottom part of the file to match your hardware
pcm.!default {
type plug
slave {
pcm "both_digital"
}
}
# First we create a 'both' route, that has 12 channels
pcm.both_digital {
type route
slave {
pcm multi
channels 12
}
# And we route the channels 1:1
# 6 inputs (0-5) get mapped into 12 outputs (0-11)
# (this is how we copy channels)
# Channels are corrected for ION1
ttable.0.0 1.0
ttable.1.1 1.0
ttable.2.4 1.0
ttable.3.5 1.0
ttable.4.2 1.0
ttable.5.3 1.0
ttable.0.6 1.0
ttable.1.7 1.0
ttable.2.8 1.0
ttable.3.9 1.0
ttable.4.10 1.0
ttable.5.11 1.0
}
# Then define a multi device that splits the 12-channel input
# Into 2x 6 output
pcm.multi {
type multi
slaves.a {
pcm "hdmi_hw"
channels 6
}
slaves.b {
pcm "optical_hw"
channels 6
}
# 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 Optical outputs
bindings.6.slave b
bindings.6.channel 0
bindings.7.slave b
bindings.7.channel 1
bindings.8.slave b
bindings.8.channel 2
bindings.9.slave b
bindings.9.channel 3
bindings.10.slave b
bindings.10.channel 4
bindings.11.slave b
bindings.11.channel 5
}
# 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 0
device 3
channels 6
}
# Optical output
pcm.optical_hw {
type hw
card 0
device 1
channels 6
}
Thanks!
-Erik