--- /dev/null
+#!/bin/sh
+
+# This script is used by shairport-sync to stop MPD
+# before starting a new playback session, so that it can
+# access the sound card.
+
+mpc stop
SRC_URI += " \
file://0001-yocto-disable-user-group-creation.patch \
file://shairport-sync.conf.in \
+ file://mpc-stop.sh \
"
S = "${WORKDIR}/git"
${WORKDIR}/shairport-sync.conf.in > ${WORKDIR}/shairport-sync.conf
install -d ${D}${sysconfdir}/
install -m 0644 ${WORKDIR}/shairport-sync.conf ${D}${sysconfdir}/
+
+ # Modify shairport-sync start arguments to always stop MPD before playing:
+ sed -i -e "s@^\(ExecStart=.*\)@\1 -w --on-start=${bindir}/mpc-stop.sh@g" \
+ ${D}${systemd_unitdir}/system/shairport-sync.service
+
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/mpc-stop.sh ${D}${bindir}
}
SYSTEMD_SERVICE:${PN} = " \