I’m using Mopidy with Snapcast and a mono speaker. I got it working with the output setting in
/etc/mopidy/mopidy.conf as described in the Snapcast setup instructions:
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo
This works but since my speaker is mono (connected to only one side of the amplifier) I don’t hear the second audio channel. I’d like to mix together the stereo channels into a single mono channel using GStreamer on the Snapcast server before sending it to the client (speaker). I searched the web and found in this thread from 2015 a suggestion to use this setting:
output=capsfilter caps=audio/x-raw-int,channels=1 ! alsasink
I adapted this for Snapcast’s output sink:
output = audioresample ! audioconvert ! capsfilter caps=audio/x-raw,rate=48000,channels=1,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo
but this makes audio play way too fast on the speaker. No combination of settings I tried, e.g. sample rates, format, whether
audioconvert are present, etc., seemed to work. I am kind of out of my depth here. I also found a GStreamer plugin
interleave which seems to be able to do this but I couldn’t get it to work with the other settings (it says in syslog: “mopidy: ERROR [Audio-2] mopidy.audio.actor Failed to create audio output “audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! interleave ! wavenc ! filesink location=/tmp/snapfifo”: gst_parse_error: could not link audioconvert0 to interleave0, interleave0 can’t handle caps audio/x-raw, rate=(int)48000, channels=(int)2, format=(string)S16LE (3)”).
Does anyone have a working solution for mixing stereo into mono for use with a Snapcast filesink?