tl;dr, solution is HERE. Original thread below.
I returned back to Raspberry Pi 3 and want to have two sound outputs: HDMI (for watching movies) and HiFi-Berry Analog (for listening music, when TV is off). Some time ago I've configured it to output same sound (best posibility for my configuration) on OSMC by adding following configuration (but, unfortunately, OSMC overwritted asound.conf with every update):
Code
pcm.both {
type route;
slave.pcm {
type multi;
slaves.a.pcm "hw:1,0";
slaves.b.pcm "hw:0,0";
slaves.a.channels 2;
slaves.b.channels 6;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
bindings.4.slave b;
bindings.4.channel 2;
bindings.5.slave b;
bindings.5.channel 3;
bindings.6.slave b;
bindings.6.channel 4;
bindings.7.slave b;
bindings.7.channel 5;
}
ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1; # front left
ttable.1.3 1; # front right
ttable.2.4 1;
ttable.3.5 1;
ttable.4.6 1;
ttable.5.7 1;
}
ctl.both {
type hw;
card 0;
}
Display More
That created virtual sound card which could be selected in Kodi settings. It worked fine - passthrough worked only via HDMI, PCM worked via both outputs. But when I've added this to /storage/.config/asound.conf - nothing happened. No new device is deceted neither by Kodi nor ALSA.
Code
Raspberry:~ # aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default
Default Audio Device
sysdefault
Default Audio Device
default:CARD=vc4hdmi
vc4-hdmi, MAI PCM i2s-hifi-0
Default Audio Device
sysdefault:CARD=vc4hdmi
vc4-hdmi, MAI PCM i2s-hifi-0
Default Audio Device
hdmi:CARD=vc4hdmi,DEV=0
vc4-hdmi, MAI PCM i2s-hifi-0
HDMI Audio Output
default:CARD=sndrpihifiberry
snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
Default Audio Device
sysdefault:CARD=sndrpihifiberry
snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
Default Audio Device
Display More
What am I doing wrong?