Output to Icecast2 and Snapserver

Hello! Running 3.54.2 on a Debian 10 (buster) headless server and very happy with it! I’ve got it streaming to various computers around the home using snapserver and this works fine using the following under [audio] in /etc/mopidy.conf:

output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo

I can also output to my Google Chromecast Audio devices using pychromecast and Icecast and replacing the above with:

output = lamemp3enc ! shout2send async=false mount=mopidy ip=homeserver port=8000 password=icecast2

However, despite extensive Googling and reading of the gst-launch-1.0 documentation I can’t find any way to combine both of the above and output to both icecast and snapserver. Any pointers most gratefully received!

The third example at https://docs.mopidy.com/en/latest/icecast/ shows using a tee element to achieve multiple outputs. What did you try to use? I’ll warn you now (on top of the warning at the top of that page about Ubuntu), the shout2send element is not very good. Wouldn’t be surprised if I plays poorly with other sinks.

Thanks for the reply! I followed the hints and tried using gst-launch-1.0’s audiotestsrc with:

gst-launch-1.0 audiotestsrc ! audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo ! lamemp3enc ! shout2send async=false mount=mopidy ip=homeserver port=8000 password=icecast2

gst-launch-1.0 audiotestsrc ! tee name=t ! queue ! audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo ! queue ! autoaudiosink t. ! lamemp3enc

A grep of my history shows many variants on the above with differing errors about connecting inputs to outputs for each.

Your pointer on the shout2send element is most welcome - if there’s a better way to output audio in a format consumable by the Chromecast’s I’d be all ears. It seems to play nicely with M3U hence my attempts with icecast

[Edit: For completeness… I have also tried outputting icecast to snapserver and vice-versa to no avail. I also tried snapserver’s TCP server, however that isn’t something that Chromecast’s can play nicely with]

To answer my own question and if anyone else has the same requirement:

output = tee name=t ! queue ! audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo t. ! queue ! lamemp3enc ! shout2send async=false mount=<your mount name> ip=<your icecast server> port=<your icecast port> password=<your icecast password>