I have been messing around to get the snapserver to get it to work the way I want. I got it to play to all streams kodi, spotify, and airplay at the same time, which @Mr.Tiptop you asked about. I get it to also play the kodi audio out to the hdmi output and send it to snapserver.
To do this I edited the /storage/.kodi/addons/service.snapserver/bin/snapserver.start file.
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.snapserver
config="pulseaudio.conf"
link="/storage/.config/pulse-daemon.conf.d/50-snapserver.conf"
mkdir -p "$(dirname $link)"
ln -sf "$ADDON_HOME/$config" "$link"
if [ ! -e "$ADDON_HOME/$config" ]; then
cp "$ADDON_DIR/config/$config" "$ADDON_HOME"
fi
file="/tmp/snapkodi"
sink_name="Snapserver"
if [ -z "$(pactl list short | grep $sink_name)" ]; then
pactl load-module module-pipe-sink \
file="$file" \
rate=48000 \
sink_name="$sink_name" \
sink_properties=device.description="$sink_name"
fi
stream0="pipe://$file?name=Kodi"
stream1="spotify:///librespot?name=Spotify&devicename=$ss_ln"
#stream="$stream¶ms=--zeroconf-port%3D$ss_lp"
stream2="airplay:///shairport-sync?name=AirPlay"
if [ "$ss_eh" = "true" ] ; then
enable_http=1
else
enable_http=0
fi
nqptp &
pactl load-module module-combine-sink sink_name=combined_sink_name slaves=Snapserver,alsa_output.1.hdmi-stereo
HOME="$ADDON_HOME" \
nice -n "$ss_ni" \
snapserver \
--controlPort "$ss_cp" \
--port "$ss_sp" \
--http.enabled "$enable_http" \
--http.port "$ss_hp" \
--http.bind_to_address "$ss_ha" \
--http.doc_root="$ADDON_DIR/snapweb" \
--stream.stream "$stream1" \
--stream.stream "$stream2" \
--stream.stream "$stream0" \
> /dev/null
Display More
I added this line to combine the Snapserver audio sink and the sink that outputs the audio to hdmi. Allowing audio to be streamed from kodi and play out to hdmi. You can look @AllanK guide right above to get the alsa_output.1.hdmi-stereo sink.
pactl load-module module-combine-sink sink_name=combined_sink_name slaves=Snapserver,alsa_output.1.hdmi-stereo
I then removed all the if statements and made the each stream its own variable to add to the server separately.
stream0="pipe://$file?name=Kodi"
stream1="spotify:///librespot?name=Spotify&devicename=$ss_ln"
#stream="$stream¶ms=--zeroconf-port%3D$ss_lp"
stream2="airplay:///shairport-sync?name=AirPlay"
Then I just add --stream.stream for each stream source.
snapserver \
--controlPort "$ss_cp" \
--port "$ss_sp" \
--http.enabled "$enable_http" \
--http.port "$ss_hp" \
--http.bind_to_address "$ss_ha" \
--http.doc_root="$ADDON_DIR/snapweb" \
--stream.stream "$stream1" \
--stream.stream "$stream2" \
--stream.stream "$stream0" \
> /dev/null
Display More