Code
# asound.conf for Dual Audio - SPDIF (5.1) + HDMI Stereo out
# by puntloos
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)
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
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 "spdif_out"
channels 6
}
slaves.b {
# virtual hdmi still has 6 channels
# although I suppose I could try making it 2
pcm "hdmi_virtual"
channels 6
}
# Bind stuff to the SPDIF 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 HDMI 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
}
# Since hdmi is 2 channels, we downmix.
pcm.hdmi_virtual
{
type route
slave.pcm hdmi_out
slave.channels 2
# Front and rear, at 33% of original signal strength
ttable.0.0 0.33
ttable.1.1 0.33
ttable.2.0 0.33
ttable.3.1 0.33
# Center channel routing (routed to front-left and front-right),
# 6dB gaindrop (gain half of main channels) per channel
ttable.4.0 0.16
ttable.4.1 0.16
# LFE channel routing (routed to front-left and front-right),
# 6dB gaindrop (gain half of main channels) per channel
ttable.5.0 0.16
ttable.5.1 0.16
}
# And here is my actual hardware
# Note that this is linked to the output of 'aplay -l'
# HDMI output
pcm.spdif_out {
type hw
card 0
device 1
channels 6
}
# Stereo output
pcm.hdmi_out {
type hw
card 1
device 7
channels 2
}
Display More
I am trying to activate a dual audio output using this asound.conf (/storage/.config/asound.conf). It is not working!
I'm using Libreelec Generic-Build X86_64 on a ION2 system (HDA intel sound for SPDIF output / device 0,1 and NVIDIA for HDMI output / device 1,7). All devices are listed in the audio-setup dialog and working. The same asound.conf worked using an older Openelec-distribution. Are there any changes on the use of 'asound.conf'? Where are the logs including information on problems with alsa / reading of asound.conf?
Best regards
fhz