Multi-room audio (2 zones) by simultaneous Hifiberry and HDMI output?

Hi,

i try to find a solution to stream my music in two zones simultaneously with one Raspberry Pi B…is there any chance to activate analog and digital output simultaneously (Hifiberry B + HDMI and not Hifyberry or HDMI)? I ask this because my Receiver (Yamaha Rx-v671) accepts in zone 2 only analog input , in zone 1 analog and digital is fine. Actually it is possible to listen to the analog outbut of Hifiberry B in both zones…but i prefer in zone 1 the digital output via HDMI because the sound has much more dynamic (zone one is the main zone with bigger speakers). I would be really really happy, if someone has an idea how to activate both, the analog and digital output.

Thanks!!!

(update: I’ve testet a hdmi splitter for HDMI and analog output, but the splitter freezes to many times, so this is not a good solution…a solution just with Raspberry Pi and Hifiberry without additional hardware would be smartest)

I can do this on my Ubuntu (pulseaudio) machine if one of the devices is a USB soundcard with something really simple like the following in my Mopidy audio/output config:

output = tee name=t t. ! queue ! alsasink device=hw:2,0 t. ! queue ! alsasink device=hw:0,0

This plays the audio through card 2 device 0 and card 0 device 0 simultaneously. (You can run aplay -l to get the card indexes for your soundcards).

I’ve not tried to do the same thing on a raspberry pi using a hifiberry i2s card.

You can also do a similar thing system-wide using a multi element in your alsa config. I’m not sure if this is any different under the hood than the above gstreamer pipeline but it might be worth a go if the pipeline tee doesn’t work.